PATCH: Highlighting not removed in Visual mode when r + CTRL-C hit

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PATCH: Highlighting not removed in Visual mode when r + CTRL-C hit

Lech Lorens
The attached patch fixes the problem with highlighting not being removed
after "r" + CTRL-R is pressed in Visual mode.

--
Cheers,
Lech

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


Index: src/normal.c
===================================================================
--- src/normal.c (revision 1341)
+++ src/normal.c (working copy)
@@ -6770,7 +6770,16 @@
     had_ctrl_v = NUL;
     }
     else
+    {
  had_ctrl_v = NUL;
+ if (Ctrl_C == cap->nchar)
+ {
+#ifdef FEAT_VISUAL
+    reset_VIsual();
+#endif
+    return;
+ }
+    }
 
     /* Abort if the character is a special key. */
     if (IS_SPECIAL(cap->nchar))
Index: runtime/doc/todo.txt
===================================================================
--- runtime/doc/todo.txt (revision 1341)
+++ runtime/doc/todo.txt (working copy)
@@ -192,9 +192,6 @@
 Problem with compound words?  (Bert, 2008 May 6)
 No warning for when flags are defined after they are used in an affix.
 
-With Visual selection, "r" and then CTRL-C  Visual mode is stopped but the
-highlighting is not removed.
-
 Screen redrawing when continuously updating the buffer and resizing the
 terminal. (Yakov Lerner, 2006 Sept 7)
 
Reply | Threaded
Open this post in threaded view
|

Re: PATCH: Highlighting not removed in Visual mode when r + CTRL-C hit

Bram Moolenaar


Lech Lorens wrote:

> The attached patch fixes the problem with highlighting not being
> removed after "r" + CTRL-R is pressed in Visual mode.

Thanks.  I think this method should do the same in less lines:


*** ../vim-7.2.093/src/normal.c Thu Nov 20 16:11:03 2008
--- src/normal.c Fri Jan 30 20:37:01 2009
***************
*** 6783,6788 ****
--- 6783,6790 ----
      /* Visual mode "r" */
      if (VIsual_active)
      {
+ if (got_int)
+    reset_VIsual();
  nv_operator(cap);
  return;
      }

--
Give a man a computer program and you give him a headache,
but teach him to program computers and you give him the power
to create headaches for others for the rest of his life...
        R. B. Forest

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---