Sublime Forum

Bug with Vintage Command Mode and Word Wrap


Hi all

I have just been playing with split screen editing and came across a strange bug with Vintage mode and word wrapping. Basically if one character has wrapped onto the next line I can’t get the cursor to move past that line when moving the cursor down the screen. Going up is fine. For example, in the following screenshot I can’t get the cursor below that line in command mode with either j (vim down key) or the normal arrow key:

[attachment=0]Screen shot 2011-12-21 at 18.20.38.png[/attachment]

Now it all works fine if I do one of the following things:

  • Put it into insert mode
  • Move the split so that either no wrapping is happening or move it so two characters are wrapped instead of one.
  • Turn word wrapping off
  • Disable Vintage Mode




Same problem after 9 years. I’ve found a dirty fix.

@@ -465,7 +465,8 @@
         if s.empty():
             l = view.line(s.b)
             if s.b == l.b and not l.empty():
-                s = sublime.Region(l.b - 1, l.b - 1, s.xpos)
+                if view.text_to_layout(l.b - 1)[0] < view.text_to_layout(l.b)[0]:
+                    s = sublime.Region(l.b - 1, l.b - 1, s.xpos)