Commit Graph

528 Commits

Author SHA1 Message Date
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
Kim Silkebækken 5cc265affd Fix repo.status() functions 2013-02-06 09:14:17 +01:00
Kim Silkebækken e3ce4adc3d Fix UTF-8 encoding issue with weather segment
Closes #172.
2013-02-06 09:14:03 +01:00
Kim Silkebækken 56e661b21b Handle more request errors in common segments 2013-02-06 08:51:47 +01:00
Kim Silkebækken 184dac1bff Add solarized support for shell exit status segments
Closes #165.
2013-02-05 13:48:33 +01:00
ZyX 6f69322024 Add support for zsh/zpython
Closes #163.
2013-02-05 12:00:03 +01:00
Kim Silkebækken b99e9cb074 Revert "Make 'powerline' a namespace package"
This reverts commit 57bd0af272.
2013-02-04 13:04:17 +01:00
ZyX 7a25ab1d53 Fix “'NoneType' object is not iterable” error
Fixes #158
2013-02-04 00:19:04 +04:00
Kim Silkebækken 57bd0af272 Make 'powerline' a namespace package
This will allow third-party plugins to use the 'powerline' namespace for
contributed segments.

Refs #3.
2013-02-03 16:27:30 +01:00
Kim Silkebækken 7e14a84cc9 Add cmus player to now_playing segment
Closes #162.
2013-02-01 22:35:01 +01:00
Kim Silkebækken def7a1e82e Update now_playing methods to use common formatting methods 2013-02-01 22:33:24 +01:00
Kim Silkebækken e8ebb07662 Add common player conversion methods 2013-02-01 22:33:07 +01:00
Kim Silkebækken ea32006715 Fix Unicode issues with mail segment 2013-02-01 22:32:39 +01:00