Commit Graph

125 Commits

Author SHA1 Message Date
ZyX 7882583dcb Update continuation segment tests 2014-08-12 08:16:26 +04:00
ZyX 117661e186 Add tests for visual_range 2014-08-05 22:49:53 +04:00
ZyX 74a3c9a0ca Add file_scheme segment
Fixes #207
2014-08-03 23:58:34 +04:00
ZyX 120a9cc8fa Add winnr segment
Closes #705
2014-08-03 13:25:58 +04:00
ZyX f877516e54 Add bufnr segment
Ref #705
2014-08-03 13:25:58 +04:00
ZyX 6cf0c485fa Add single_tab segment 2014-08-03 12:53:53 +04:00
ZyX 85f252652e Add tabnr segment 2014-08-03 12:53:53 +04:00
Collin Grady f615d85172 Added line_count segment for vim.
Returns total number of lines in current buffer.

Addresses #556
2014-08-03 05:54:57 +00:00
ZyX 9e8c115eea Add trailing whitespace segment
Note: by default this segment is disabled. Until #923 it may only be enabled by
copying the whole file and changing "enabled" to "true". After #923 it may be
enabled by having `~/.config/powerline/themes/vim/default.json` with the
following contents:

    {
        "segment_data": {
            "trailing_whitespace": {
                "display": true
            }
        }
    }

Fixes #388
2014-08-02 18:39:16 +04:00
ZyX 3ac75eeca6 Add window_title tests 2014-07-10 22:33:10 +04:00
ZyX a0a5b44173 Use battery_full and battery_empty for displaying hearts
Red hearts for battery full are still more optimal in case white hearts are for
empty (though I do not understand why they have to be red). Cannot agree about
per cents though: red is better for empty then white is if there are no related
parts to compare.
2014-07-10 18:35:24 +04:00
ZyX 39316c429b Reverse the gradient in battery segment
Closes #910
2014-07-10 18:35:23 +04:00
ZyX c570a98065 Add watcher option
Ref #818
2014-06-28 21:10:15 +04:00
ZyX e51d7a9dd3 Add fuzzy_time(unicode_text) argument 2014-03-13 20:54:07 +04:00
ZyX 3f1e621f1d Add ellipsis argument to cwd segment 2014-03-13 20:47:06 +04:00
ZyX c3b4654bfb Fix flake8 complaints 2014-03-13 20:41:54 +04:00
ZyX 55858e1a9d Fix tests for new psutil 2014-03-13 20:05:52 +04:00
ZyX 8718bf76ce Add tests for continuation segment 2014-02-16 20:41:01 +04:00
ZyX 66d98e7def Improved battery segment:
- Ignore `steps` if gamify is False.
- Add `full_heart` and `empty_heart` keywords.
- Document `format` keyword.
- Replace `draw_soft_divider` with `draw_inner_divider`.
2014-02-09 13:44:06 +04:00
Joshua Perry c4fb09a418 Update tests to support parameter on _get_capacity() 2014-02-09 02:36:19 +04:00
ZyX e7820efe56 Make powerline work with non-utf filenames
Fixes #281
2014-01-26 21:01:19 +04:00
ZyX 64e23d346e Merge branch 'patch-1' into develop
Fixes #724
2014-01-23 18:45:46 +04:00
ZyX b75d2b531f Add tests 2014-01-23 18:45:09 +04:00
EinfachToll 10cd7b78f0 More test cases for position segment 2014-01-23 09:23:53 +01:00
EinfachToll 90132fe386 Small fixes for new position segment
- use vim_funcs
- use a dictionary instead of a tuple for translation strings
2014-01-21 15:48:05 +01:00
EinfachToll 7aa978fdba New fixed segment showing position of current view
Solves #539
Fixed version of #540 and #579
Works now for split windows and wrapped lines.
2014-01-15 10:32:04 +01:00
Kenny Root c33d56e73c Add arg to optionally suppress user segment
This adds the option to common.user to suppress display if the username
matches the given string in the new "hide_user" argument.
2014-01-13 23:57:41 -08:00
Kenny Root 54e7fe91ba Fix common.user test
The username was being cached from previous tests, so clear it before
running this test.
2014-01-10 14:15:54 -08:00
ZyX 2ef0d4412d Add jobnum segment
Replaces #596. Differences:
- Tests and metavar.
- Uses “jobnum” name in place of “jobs”.
- Does not use subshell for zsh. Also counts jobs correctly in zsh.
- Adds an option to force showing jobnum segment even if there are no jobs.
2013-11-19 01:01:49 +04:00
Kim Silkebækken ab6140136d Add visual_range segment
Returns a value similar to `showcmd`.

TODO: Make proper test case.
2013-08-06 10:57:04 +02:00
Kim Silkebækken 225ac48cfc Merge remote-tracking branch 'tmurph/feature/504-battery-segment' into develop
Conflicts:
	powerline/config_files/colorschemes/tmux/default.json
2013-07-31 15:28:54 +02:00
Trevor Murphy 24cda1d947 Add a battery info segment.
Default colors range from red (full battery) to white (no battery) but can be changed via the
`battery' and `battery_gradient' settings.

Default presentation is a formatted percentage string (with keyword `batt').  The `gamify' setting
changes this to a sequence of video game hearts.

Number of steps from 100% to 0% / number of video game heart icons is controlled by the `steps'
setting (default 5).
2013-07-13 22:44:38 -04:00
Kim Silkebækken 1581d9be9b Merge remote-tracking branch 'jacobwalker0814/feature/477-environment-segment' into develop 2013-05-21 10:12:50 +02:00
Kovid Goyal 7b495aff0c Fix tests failing if inotify not available 2013-05-03 10:34:50 +05:30
Jacob Walker ed65d34e1a Segment to Print Environment Variables
- Added segment function to powerline.segments.common.
 - Added test to check return values.
 - Added default colorschemes for everything but iPython.

Ref #477
2013-05-02 09:35:13 -05:00
Kovid Goyal ad55daf9c3 Make vcs segments *much* faster
Do not call vcs status unless the relevant files have changed.
Uses inotify, if available, otherwise falls back to stat() based
monitoring. Fixes #396
2013-05-02 11:13:54 +05:30
ZyX bd0546d688 Add virtcol_current textwidth-based gradient 2013-04-13 19:37:43 +04:00
ZyX 71329cdb5d Add gradient for cpu_load_percent
Note: no changes to colorschemes: no cpu_load_percent in colorscheme
2013-04-08 08:04:22 +04:00
Kim Silkebækken 2685f61e88 Merge branch 'various-improvements' into develop 2013-04-05 16:22:46 +02:00
Kovid Goyal 80be4071c9 Disable continuous polling of CPU count in load segment 2013-04-05 16:12:25 +02:00
Kim Silkebækken 2d9110b5f1 Update tests 2013-04-03 14:23:20 +02:00
ZyX 691efbfc9b Also do the same for `last_pipe_status` 2013-04-02 19:06:05 +04:00
ZyX 4e5bd54f79 Fix cwd segment, add use_path_separator option
cwd segment was not drawing inner separators because of new default for 
multisegment functions. use_path_separator was added because current variant 
looks bad for my taste.
2013-04-02 19:01:03 +04:00
ZyX 66beaaaa9d Replace draw_soft_divider setting with draw_inner_divider
If weather or system_load segments were moved to the left draw_soft_divider
variant resulted in incorrect renderring. Thus it was replaced by
draw_inner_divider.
2013-04-02 17:22:55 +04:00
ZyX f15cdd9413 Replace draw_divider setting with draw_(soft|hard)_divider
Previous variant was bad because
1. draw_divider only applied to soft dividers. Hard dividers were always drawn
2. But there was a hack with width=auto segments: for this segments draw_divider 
   setting applied always.

Now there are no additional dependencies: draw_*_divider applies no matter what 
other properties of the segment are.
2013-04-02 17:21:22 +04:00
Kim Silkebækken fcc009a6f5 Merge remote-tracking branch 'mspaulding06/hostname_exclude_domain' into develop
Conflicts:
	powerline/segments/common.py
	tests/test_segments.py
2013-04-02 11:29:08 +02:00
Matt Spaulding 3a6c0ab8fd Add test for hostname exclude_domain option 2013-03-30 15:32:29 -07:00
ZyX c6be4426d3 Fix whitespace errors 2013-03-31 00:03:35 +04:00
ZyX 3ebc16a48c Replace pl.environ/getcwd/home with segment_info 2013-03-30 21:55:00 +04:00
ZyX 27c9a05782 Change indentation of closing }, ], ) and combinations of them 2013-03-25 19:04:18 +04:00
ZyX ada5dede25 Fix network_load test
It was using old network_load.sleep and also was not shutting down network_load 
in case it failed test
2013-03-25 18:45:43 +04:00
ZyX 92652ca5c4 Some fixes for flake8 2013-03-25 00:10:54 +04:00
ZyX 00271c2a0c Shut down network_load segment in tests 2013-03-24 22:24:48 +04:00
ZyX d27c720279 Fix race condition, don’t rely on detect feature
detect feature is to be tested though
2013-03-24 20:36:28 +04:00
ZyX 1351207462 Some fixes for flake8 2013-03-24 19:59:56 +04:00
ZyX 8a51d99389 Some fixes for zsh, remove some exceptions handling
Those exceptions are now handled and logged at top level, thus no need to handle
them in segment.

Ref #330, it is now fixed for zsh/zpython

Note: do not use zsh/zpython + python3, it does not work properly, even though
this changeset contains fixes for it as well

Fixes #360
2013-03-24 19:48:51 +04:00
ZyX ed435f8063 Add required pl argument to segments
Fixes #340
Ref #330
2013-03-24 19:44:01 +04:00
ZyX 840ac0109b Port common.branch segment to KwThreaded*, add common.repository_status 2013-03-24 19:35:25 +04:00
ZyX 25806fa075 Added gradient for network_load segment 2013-03-24 01:33:56 +04:00
ZyX 157b849d33 Make weather gradient configurable, add system_load gradient
Also make gradients floating-point and fix #332 by removing “normalized” from 
system_load segment documentation.
2013-03-24 00:55:54 +04:00
ZyX 11aa74c634 Make it use gradient for weather temperature
Ref #301
2013-03-19 23:25:44 +04:00
ZyX fb2e9b6cdb Test all other segments
Still uncovered: email_imap_alert and now_playing
2013-03-17 21:23:27 +04:00
ZyX f547e8b85f Some fixes for flake8 2013-03-17 21:23:15 +04:00
ZyX 62e731314e Replace memoize with threading where applicable
NOTE: Documentation now gets attached to *classes*, not actual segments. Hiding
      away classes (by changing their names to start with `_`) and/or doing

          self.__doc__ = self.__class__.__doc__

      does not work (hiding classes only hides documentation completely). I am
      not familiar with sphinx enough to say how this should be fixed.

Ref #168
2013-03-17 21:22:33 +04:00
ZyX 29eccf409b Use psutil module for `user` segment 2013-03-17 13:28:57 +04:00
ZyX c237e66958 Make file_size segment output buffer size 2013-03-15 19:31:08 +04:00
ZyX 48470221f0 Make git.Repository.status() also return None
Fixes #326
2013-03-14 20:03:26 +04:00
ZyX e24703dbdd Add status_colors argument to branch segments
Closes #206
2013-03-13 16:51:53 +04:00
Kim Silkebækken 111eaa27e8 Combine vim modelines and Python encoding declarations
Ref #314
2013-03-11 10:40:09 +01:00
Kim Silkebækken 6748701fcb Add vim modelines to all Python files
Added with `sed -i '2i# vim:fenc=utf-8:noet' `find -name '*.py'`` and
fixed in a couple of files without the UTF-8 encoding on top.

Ref #314
2013-03-11 08:11:25 +01:00
ZyX aa0a8bf76d Make tests support python2.6
Old unittest is not working for unknown reason, using unittest2 instead
2013-03-03 21:03:40 +01:00
ZyX 0a05b2961a Add support for with: statement to tests.vim
Also made everything use new vim_module._with where possible
2013-03-03 21:03:34 +01:00
ZyX c429d9eeb2 Omit using sys.modules if possible
Does not work though: still TypeError due to some global in multiproccessing
that got None
2013-03-03 21:03:34 +01:00
ZyX c334be416d Add tests.lib module with `replace_*()` with statement functions
Note: there is new problem: now multiprocessing() globals got assigned None
values. It is likely somehow related to extended `sys.modules` utilization
2013-03-03 21:03:26 +01:00
ZyX 584755765b Start adding tests
Tests are temporary disabled on all branches except tests (does not really work
though, needs travis.yml in all branches).
2013-03-03 21:03:19 +01:00