Commit Graph

640 Commits

Author SHA1 Message Date
ZyX 186ad2d423 Remove useless Segment class
It was used solely for Segment.get (the only place where it was used just saved
its .get() method, throwing away instance itself) and looks more like abusal of
the purpose of the classes
2013-02-24 22:22:07 +01:00
ZyX 2fa64c42d1 Move translation of modes into renderers/vim.py
Fixes #147
2013-02-24 15:29:31 +04:00
ZyX 3c62e060be Don't use UUID for window IDs
This fix uses an incremented number instead.

Fixes #180
2013-02-22 15:31:27 +01:00
ZyX 861f7dc179 Fix &stl reset to global value when new file is loaded
Fixes #241
Ref #240
2013-02-21 12:51:25 +01:00
Kim Silkebækken b347d53b6d Remove obsolete Vundle warning from docs 2013-02-20 14:07:26 +01:00
Kim Silkebækken 282cb43eef Fix various minor formatting issues
Closes #242.
2013-02-20 13:47:54 +01:00
Martin Preisler ee51b8b76c Handle non-existant CWDs gracefully 2013-02-20 07:37:02 +01:00
ZyX e14f5e4208 Fix problem with wrong window ID/winnr after some window operations
Removed autocommands as well. Powerline() function is now responsible both for
displaying powerline and for updating statuslines. No cmdwin events not
triggered workaround nonsense anymore.

Fixes #237
Fixes #236
Fixes #222
Fixes #232
2013-02-20 07:34:36 +01:00
Kim Silkebækken ea56f4c26b Split optional dependencies to python packages and other apps
Closes #227.
2013-02-18 19:40:32 +01:00
ZyX baaf6cde1d Switch from `status` + `ls-files` to `status --ignored` 2013-02-18 09:07:51 +01:00
ZyX b8b7cfbbea Fix icon_names for unknown weather code 2013-02-18 08:57:03 +01:00
ZyX 2a3911dbe6 Make spaces around the divider configurable
Fixes #225
2013-02-18 08:56:57 +01:00
ZyX 6fc7d6acc9 Purge cache on BufWrite
Instead of much simpler solution define an API that may be used for anybody
willing to add cache purging on events with a few keystrokes
2013-02-18 08:56:57 +01:00
ZyX c45747a3b8 Ease E858/E860 errors debugging
E858: Eval did not return a valid python object
E860: Eval did not return a valid python 3 object
2013-02-15 21:06:08 +04:00
ZyX df7d0f2041 Remove 'before' key from file_vcs_status segment
Fixes #219
2013-02-15 13:05:34 +01:00
ZyX 0fddb24b9b Rework memoize class
- Removed *args: segments are not receiveing any non-keyword arguments so no
  need to bother with *args at all.
- Replaced additional_cache_key with cache_key: all functions that formerly used
  additional_cache_key appear not to need initial arguments as cache keys. It
  also simplifies the code.
- Made _cache be defined in __init__, it is much easier to implement cache
  purging this way.

Ref #205
Fixes #208
2013-02-15 13:05:30 +01:00
Kim Silkebækken 5202807269 Make Spotify segment more error-proof 2013-02-15 12:49:53 +01:00
ZyX ca4466cd83 Rework weather segment
Allows more precise icon selection and purges out unicode characters from
configuration.

Note: windy icon needs reworking, I used a trigram for it.

Fixes #203.
2013-02-13 08:12:31 +01:00
Kim Silkebækken 9aee288c18 Use requires_segment_info decorator on shell segments 2013-02-12 10:52:17 +01:00
Kim Silkebækken e89e083fee Don't use kwargs as part of the memoize key
This should be fixed later (if at all possible). Also see discussion at
http://stackoverflow.com/questions/6407993/how-to-memoize-kwargs

Refs #205.
2013-02-12 10:45:24 +01:00
ZyX d638f1d6ea Remove non-current window caching
API changes done:
- memoize additional_key function now accepts all function arguments
- get_theme now receives matcher_info
- render now receives segment_info and matcher_info, but segments and themes
  were removed
- due to very different ways of obtaining column information col_current
  splitted back to col_current and virtcol_current. The former should be false
  in case of horizontal scrollbind (when &scrollopt contains hor)
- added requires_segment_info decorator for convenience

Other changes:
- removed all vim function calls that were possible to remove
- removed direct vim.eval calls
2013-02-12 10:33:58 +01:00
Kim Silkebækken cc83d741ff Create fuzzy_time segment 2013-02-11 13:08:27 +01:00
Kim Silkebækken e48645f5d8 Move urllib_read/urlencode functions to lib 2013-02-11 07:23:37 +01:00
Kim Silkebækken d961116485 Move weather condition codes into weather function 2013-02-11 07:20:39 +01:00
ZyX 28547930cc Add screen_escape option
Refs #199.
2013-02-11 07:15:51 +01:00
ZyX d12299c18c Add a way to specify renderer options on command-line, added tmux_escape
Note: tmux escaping does not fix things, on my system it produces
![Gap between ... and directory name](http://img-fotki.yandex.ru/get/6439/9151298.2/0_93b4c_5d9a317f_orig.png)
Fixes #199
2013-02-11 07:15:46 +01:00
ZyX 52635d05ae Add support for italic and underline attributes in shell renderer 2013-02-11 07:15:19 +01:00
ZyX e18665c5fe Purge out constants from classes, lowercase TERM_24_BIT
Remove recursive import as well
2013-02-11 07:43:13 +04:00
Kim Silkebækken 21b59149bf Move docs to readthedocs.org 2013-02-10 14:04:07 +01:00
ZyX 2d9dd21a70 Add auto_rewrite method to pre_0_11
It raises error without this.
2013-02-10 13:55:35 +01:00
ZyX d414a7e491 Add more USE flags to gentoo ebuild 2013-02-10 13:55:32 +01:00
ZyX da5ac61062 Fix location of powerline.vim file
rm is uncommented because there is no “source_plugin” now.
2013-02-10 13:55:27 +01:00
ZyX 9a0b970b07 Clear highlight groups on ColorScheme event
Closes #196
Fixes #153
Fixes #194
2013-02-10 13:54:44 +01:00
ZyX 4202bd2ee6 Use escape_hl_* variables for prompts deriving from ShellRenderer
This is faster then super() calls and also more convenient.
Fixes #142 just as well
Conflicts:
	powerline/renderers/bash_prompt.py
	powerline/renderers/ipython.py
	powerline/renderers/shell.py
	powerline/renderers/zsh_prompt.py
2013-02-10 13:54:15 +01:00
ZyX a6b3bc93ab Don’t mess with hl()+contents
What does hl() mean? It looks like “highlight an empty string”, but is actually
“reset highlight style”. In addition if you are writing “hl()” function for new
renderer you need to care about “contents” variable (in two places!: None for
super() call and (contents or u'') after super() call) though function is
actually doing nothing with it. It is just inconvenient.
2013-02-10 13:53:18 +01:00
Kim Silkebækken 2caa136f26 Add docs for all segments 2013-02-08 17:35:15 +01:00
Kim Silkebækken b599761ae6 Work around missing vim module when generating sphinx docs
Horrible solution, should be fixed asap.
2013-02-08 17:35:07 +01:00
Kim Silkebækken 55ad48f0e6 Update sphinx configuration 2013-02-08 17:32:23 +01:00
Kim Silkebækken 6dc81ab855 Use functools.wraps on memoize decorator 2013-02-08 17:13:37 +01:00
Kim Silkebækken d386ae71fd Add modified_buffers segment
This segment returns a comma-separated list of modified buffers. The
segment is not enabled by default.

Closes #173.
2013-02-08 16:20:26 +01:00
ZyX 5399265135 Add note about zpython branch
TODO: To be removed after (if) zsh maintainers accept the patch.

Refs #104.
2013-02-08 14:43:32 +01:00
Kim Silkebækken 907e85931b Fix vim plugin path in Arch Linux packages 2013-02-08 14:40:46 +01:00
Kim Silkebækken 323a838511 Fix math error in humanize_bytes
Closes #175.
2013-02-07 13:48:36 +01:00
Kim Silkebækken 4e4a2b2ef8 Add tips & tricks to the docs
Closes #182.
2013-02-07 12:32:34 +01:00
Kim Silkebækken 8b8de32be9 Improve vim plugin loading
Several of the plugin loading methods have been joined into one plugin
file that will be loaded by updating the runtimepath. More informative
error messages will be displayed if Python support is missing or if the
module import fails.

Note that this commit will break existing plugin loading, the new
method with updating the runtimepath will be required.

Closes #156.
Closes #181.
2013-02-07 12:14:15 +01:00
Kim Silkebækken c2e7124da0 Fix statusline highlighting after leaving a cmdwin
Because vim doesn't trigger any autocmds after leaving a cmdwin the
statusline in the window the user returned to from the cmdwin would be
highlighted as non-current even if it should have been current.

This issue is resolved by storing the last current window ID in a script
variable, and when leaving the cmdwin we show the last current window as
current instead of detecting it after the WinEnter autocmd has been
triggered (which doesn't happen after leaving a cmdwin).

Closes #184.
2013-02-06 13:18:49 +01:00
ZyX 2e5b9383a5 Properly escape color codes in bash
Closes #177.
Closes #179.
2013-02-06 09:15:13 +01:00
Kim Silkebækken 4fa17f6ff5 Catch more errors in weather segment 2013-02-06 09:14:17 +01:00
Kim Silkebækken 9a95d738d5 Fix e-mail segment UTF-8 issues
Closes #178.
2013-02-06 09:14:17 +01:00
Kim Silkebækken c8d4e58a93 Add repository_status vim segment
Split segment highlighting compared to the file_vcs_status segment is
missing.

Refs #173.
2013-02-06 09:14:17 +01:00