Skip to content
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

third layout in grid mode causes vim.error: Vim(wincmd):E16: Invalid range: 5wincmd #29

Open
wfiveash opened this issue Mar 11, 2015 · 0 comments

Comments

@wfiveash
Copy link

Relating to splice, I noticed that when in grid mode and toggling to the
third layout I was seeing this error (I'm using a vim 7.4 patched to
658):

Error detected while processing function splice#SpliceLayout:
line 1:
Traceback (most recent call last):
File "", line 1, in
File "/home/wfiveash/.vim/bundle/splice/autoload/splice.py", line 58, in SpliceLayout
splice.modes.current_mode.key_layout()
File "/home/wfiveash/.vim/bundle/splice/autoload/splicelib/modes.py", line 81, in key_layout
self.layout(next_layout)
File "/home/wfiveash/.vim/bundle/splice/autoload/splicelib/modes.py", line 74, in layout
self.diff(self._current_diff_mode)
File "/home/wfiveash/.vim/bundle/splice/autoload/splicelib/modes.py", line 18, in diff
getattr(self, 'diff%d' % diffmode)()
File "/home/wfiveash/.vim/bundle/splice/autoload/splicelib/modes.py", line 276, in _diff_0
self.diffoff()
File "/home/wfiveash/.vim/bundle/splice/autoload/splicelib/modes.py", line 34, in diffoff
windows.focus(winnr)
File "/home/wfiveash/.vim/bundle/splice/autoload/splicelib/util/windows.py", line 5, in focus
vim.command('%dwincmd w' % winnr)
vim.error: Vim(wincmd):E16: Invalid range: 5wincmd w

I think I found a fix for this in splice (in ~/.vim/bundle/splice):

diff --git a/autoload/splicelib/modes.py b/autoload/splicelib/modes.py
--- a/autoload/splicelib/modes.py
+++ b/autoload/splicelib/modes.py
@@ -249,7 +249,8 @@
         windows.focus(3)
 
     def _layout_2(self):
-        self._number_of_windows = 4
+        self._number_of_windows = 3
         self._current_layout = 2
 
         # Open the layout

I haven't done extensive testing of this but so far it seems to have
fixed that issue and I haven't noticed a regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant