Bug#422060: vim: cursor jumps over bracketed text on text terminal

David Lawyer dave at lafn.org
Thu May 3 09:26:23 UTC 2007


Package: vim
Version: 7.0.219

This didn't happen with older versions and it's caused by a
matchparen-plugin or the like.  When I'm moving the cursor from right
to left using either the arrow key ->, l, or the space bar, the cursor
appears to jump from the opening bracket to the closing bracket.

It actually doesn't jump, but only appears to.  I'll explain.
The plugin (or whatever) has made the bad mistake of using reverse
video both for the cursor and to emphasize brackets.  If reverse video
is use both for emphasis and for the cursor, it may be hard (or
impossible as I'll show) to distinguish the cursor from the emphasized
characters.  Furthermore, when the cursor is over an emphasized
character, both the cursor and the emphasis become invisible.  That's
because a reverse-video cursor reverses the video of whatever
character it's over and if it happens to be over an emphasized
character that's already in reverse video, then it reverses reverse
video to normal video.  It's like a language or math. where a double
negative makes a positive.  Reversing reverse-video makes normal
video.

OK, so I move the cursor one character at a time until I get just
before an opening bracket like a [, (, or {.  Then I move one more
space so the cursor is over the opening bracket, but the cursor then
appears to jump over all the way to reverse-video the closing bracket:
], ), or }.  Why?  Well, the opening bracket is emphasized  by reverse
video, then the closing bracket is made reverse also, then the reverse
video cursor is placed back on the emphasized opening  bracket where
it belongs and viola, the reverse video of the opening bracket
disappears and the opening bracket is displayed in normal video.  All
this happens so fast that the switching of the opening bracket to
reverse video and then back to normal video isn't visible to most
people.  Well, it is if you watch it intensely.  So it looks just like
the cursor has jumped over to the closing bracket.

When one continues to move the cursor and reaches the closing bracket,
a similar jump appears to happen which jumps to the opening bracket.
Very confusing!  Isn't the emphasis of the brackets supposed to be
momentary.  The reverse-video of the opposite bracket remains until
one moves the "invisible" cursor off of its mate.

I'm using a CIT-101e dumb terminal, but I think that this will happen
with many other terminals.  So the solution is to say use say
underlines to mark the brackets so as not to get the double reverse in
video.

I note that "noshownmatch" is set, so it may be a plugin that's
doing this and it must be by default since I never asked to use a
plugin.  But even if I can disable the plugin, it shouldn't behave
this way.  I've installed the vim-runtime package so something in that
may be causing the problem.

			David Lawyer




More information about the pkg-vim-maintainers mailing list