-
Notifications
You must be signed in to change notification settings - Fork 989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Refactor editors code #1507
Open
ZyX-I
wants to merge
46
commits into
powerline:develop
Choose a base branch
from
ZyX-I:editors-refactor
base: develop
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZyX-I
force-pushed
the
editors-refactor
branch
from
January 7, 2016 01:48
4382993
to
5a32a82
Compare
ZyX-I
force-pushed
the
editors-refactor
branch
from
February 4, 2016 01:34
5a32a82
to
43637b1
Compare
ZyX-I
force-pushed
the
editors-refactor
branch
from
February 16, 2016 22:01
43637b1
to
1c2d756
Compare
ZyX-I
force-pushed
the
editors-refactor
branch
2 times, most recently
from
April 29, 2017 21:50
ff1cdb7
to
1d01df7
Compare
Merged
Reasoning: 1. Support other editors in the future without rewriting all bindings. 2. Support Vim without +python.
Also removes `except ImportError: vim = object()` hack. Removed code from powerline.bindings.vim that is no longer used.
EditorParameter('buffer') is buffer number only when using VimVimEditor.
- Fix typo: segment_info key is named input, not inputs - Fix typo: parameter name is tabpage, not tab
Still not enough to run with is_old_vim = True
It does not raise exceptions now, but still does not work correctly.
Fixes: - Conversion function did not recognize used keyword argument. - Number of tab pages did not have a type. - Updating tabpage or window parameters did not trigger updating buffer parameter (also updating tabpage should have updated window), which resulted in incorrect buffer names shown in the tabline when there are many tabs. Refactoring: - EditorObj objects used by listers are now EditorIterable subclasses. - powerline.editors.vim.VimTabAmount is now powerline.editors.EditorTabAmount. - Constant dictionaries used by segments_to_reqs_iter were moved to module constants.
This variant also supports Neovim, ref powerline#1287.
Still known issues: 1. When opening new tab in old vim mode new window in new tab appears as unfocused. 2. When opening new tab in new vim mode it raises AttributeError. Fixed issues: 1. Tabline does not work at all. 2. Opening new tab spawns AttributeError when determining width. 3. TypeError when trying to use string tab number as integer. 4. Generated code looks like crap (VimVimEditor, conv_code). 5. Conversion code generated for listers does not actually work due to numerous issues. 6. In some places tabline theme number is off-by-one. 7. Listing buffers lists only buffers that are shown in the current tab.
Statusline after `tab sp` with new bindings is now fine. Still bad with old bindings. Also found an issue: message from startup screen disappears.
Known issue: with old vim if one tab contains modified buffer all tabs are shown as modified.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are three long-term targets here: Vim without +python, neovim (ref #1287) and emacs. Main idea is reducing the necessity to communicate with the editor to nearly one stage. This PR is doing refactoring of the code, not adding new applications to support.
TODO:
powerline.segments.editors
module.powerline.segments.vim*
modulespowerline.segments.editors
.powerline.listers.editors
since they are not vim-specific. Requires doing something withbuffer
,window
,tabpage
,bufnr
,winnr
,tabnr
segment_info
keys.