Karsten Hopp 35bc25
To: vim_dev@googlegroups.com
Karsten Hopp 35bc25
Subject: Patch 7.4.925
Karsten Hopp 35bc25
Fcc: outbox
Karsten Hopp 35bc25
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 35bc25
Mime-Version: 1.0
Karsten Hopp 35bc25
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 35bc25
Content-Transfer-Encoding: 8bit
Karsten Hopp 35bc25
------------
Karsten Hopp 35bc25
Karsten Hopp 35bc25
Patch 7.4.925
Karsten Hopp 35bc25
Problem:    User may yank or put using the register being recorded in.
Karsten Hopp 35bc25
Solution:   Add the recording register in the message. (Christian Brabandt,
Karsten Hopp 35bc25
            closes #470)
Karsten Hopp 35bc25
Files:      runtime/doc/options.txt, runtime/doc/repeat.txt, src/ops.c,
Karsten Hopp 35bc25
            src/option.h, src/screen.c
Karsten Hopp 35bc25
Karsten Hopp 35bc25
Karsten Hopp 35bc25
*** ../vim-7.4.924/runtime/doc/options.txt	2015-11-10 19:41:30.519462341 +0100
Karsten Hopp 35bc25
--- runtime/doc/options.txt	2015-11-19 17:26:15.245736151 +0100
Karsten Hopp 35bc25
***************
Karsten Hopp 35bc25
*** 6507,6512 ****
Karsten Hopp 35bc25
--- 6528,6534 ----
Karsten Hopp 35bc25
  	  c	don't give |ins-completion-menu| messages.  For example,
Karsten Hopp 35bc25
  		"-- XXX completion (YYY)", "match 1 of 2", "The only match",
Karsten Hopp 35bc25
  		"Pattern not found", "Back at original", etc.
Karsten Hopp 35bc25
+ 	  q     use "recording" instead of "recording @a"
Karsten Hopp 35bc25
  
Karsten Hopp 35bc25
  	This gives you the opportunity to avoid that a change between buffers
Karsten Hopp 35bc25
  	requires you to hit <Enter>, but still gives as useful a message as
Karsten Hopp 35bc25
*** ../vim-7.4.924/runtime/doc/repeat.txt	2013-08-10 13:25:00.000000000 +0200
Karsten Hopp 35bc25
--- runtime/doc/repeat.txt	2015-11-19 17:26:15.245736151 +0100
Karsten Hopp 35bc25
***************
Karsten Hopp 35bc25
*** 102,108 ****
Karsten Hopp 35bc25
  q{0-9a-zA-Z"}		Record typed characters into register {0-9a-zA-Z"}
Karsten Hopp 35bc25
  			(uppercase to append).  The 'q' command is disabled
Karsten Hopp 35bc25
  			while executing a register, and it doesn't work inside
Karsten Hopp 35bc25
! 			a mapping and |:normal|.  {Vi: no recording}
Karsten Hopp 35bc25
  
Karsten Hopp 35bc25
  q			Stops recording.  (Implementation note: The 'q' that
Karsten Hopp 35bc25
  			stops recording is not stored in the register, unless
Karsten Hopp 35bc25
--- 109,121 ----
Karsten Hopp 35bc25
  q{0-9a-zA-Z"}		Record typed characters into register {0-9a-zA-Z"}
Karsten Hopp 35bc25
  			(uppercase to append).  The 'q' command is disabled
Karsten Hopp 35bc25
  			while executing a register, and it doesn't work inside
Karsten Hopp 35bc25
! 			a mapping and |:normal|.
Karsten Hopp 35bc25
! 
Karsten Hopp 35bc25
! 			Note: If the register being used for recording is also
Karsten Hopp 35bc25
! 			used for |y| and |p| the result is most likely not
Karsten Hopp 35bc25
! 			what is expected, because the put will paste the
Karsten Hopp 35bc25
! 			recorded macro and the yank will overwrite the
Karsten Hopp 35bc25
! 			recorded macro. {Vi: no recording}
Karsten Hopp 35bc25
  
Karsten Hopp 35bc25
  q			Stops recording.  (Implementation note: The 'q' that
Karsten Hopp 35bc25
  			stops recording is not stored in the register, unless
Karsten Hopp 35bc25
*** ../vim-7.4.924/src/ops.c	2015-08-11 19:36:37.050004181 +0200
Karsten Hopp 35bc25
--- src/ops.c	2015-11-19 17:26:15.249736106 +0100
Karsten Hopp 35bc25
***************
Karsten Hopp 35bc25
*** 1080,1086 ****
Karsten Hopp 35bc25
  	    retval = FAIL;
Karsten Hopp 35bc25
  	else
Karsten Hopp 35bc25
  	{
Karsten Hopp 35bc25
! 	    Recording = TRUE;
Karsten Hopp 35bc25
  	    showmode();
Karsten Hopp 35bc25
  	    regname = c;
Karsten Hopp 35bc25
  	    retval = OK;
Karsten Hopp 35bc25
--- 1080,1086 ----
Karsten Hopp 35bc25
  	    retval = FAIL;
Karsten Hopp 35bc25
  	else
Karsten Hopp 35bc25
  	{
Karsten Hopp 35bc25
! 	    Recording = c;
Karsten Hopp 35bc25
  	    showmode();
Karsten Hopp 35bc25
  	    regname = c;
Karsten Hopp 35bc25
  	    retval = OK;
Karsten Hopp 35bc25
*** ../vim-7.4.924/src/option.h	2015-11-10 19:41:30.519462341 +0100
Karsten Hopp 35bc25
--- src/option.h	2015-11-19 17:26:15.249736106 +0100
Karsten Hopp 35bc25
***************
Karsten Hopp 35bc25
*** 213,219 ****
Karsten Hopp 35bc25
  #define SHM_ATTENTION	'A'		/* no ATTENTION messages */
Karsten Hopp 35bc25
  #define SHM_INTRO	'I'		/* intro messages */
Karsten Hopp 35bc25
  #define SHM_COMPLETIONMENU  'c'		/* completion menu messages */
Karsten Hopp 35bc25
! #define SHM_ALL		"rmfixlnwaWtToOsAIc" /* all possible flags for 'shm' */
Karsten Hopp 35bc25
  
Karsten Hopp 35bc25
  /* characters for p_go: */
Karsten Hopp 35bc25
  #define GO_ASEL		'a'		/* autoselect */
Karsten Hopp 35bc25
--- 213,220 ----
Karsten Hopp 35bc25
  #define SHM_ATTENTION	'A'		/* no ATTENTION messages */
Karsten Hopp 35bc25
  #define SHM_INTRO	'I'		/* intro messages */
Karsten Hopp 35bc25
  #define SHM_COMPLETIONMENU  'c'		/* completion menu messages */
Karsten Hopp 35bc25
! #define SHM_RECORDING	'q'		/* short recording message */
Karsten Hopp 35bc25
! #define SHM_ALL		"rmfixlnwaWtToOsAIcq" /* all possible flags for 'shm' */
Karsten Hopp 35bc25
  
Karsten Hopp 35bc25
  /* characters for p_go: */
Karsten Hopp 35bc25
  #define GO_ASEL		'a'		/* autoselect */
Karsten Hopp 35bc25
*** ../vim-7.4.924/src/screen.c	2015-11-10 14:35:14.312069795 +0100
Karsten Hopp 35bc25
--- src/screen.c	2015-11-19 17:54:41.439168573 +0100
Karsten Hopp 35bc25
***************
Karsten Hopp 35bc25
*** 163,168 ****
Karsten Hopp 35bc25
--- 163,169 ----
Karsten Hopp 35bc25
  static int win_do_lines __ARGS((win_T *wp, int row, int line_count, int mayclear, int del));
Karsten Hopp 35bc25
  static void win_rest_invalid __ARGS((win_T *wp));
Karsten Hopp 35bc25
  static void msg_pos_mode __ARGS((void));
Karsten Hopp 35bc25
+ static void recording_mode __ARGS((int attr));
Karsten Hopp 35bc25
  #if defined(FEAT_WINDOWS)
Karsten Hopp 35bc25
  static void draw_tabline __ARGS((void));
Karsten Hopp 35bc25
  #endif
Karsten Hopp 35bc25
***************
Karsten Hopp 35bc25
*** 10163,10169 ****
Karsten Hopp 35bc25
  #endif
Karsten Hopp 35bc25
  		)
Karsten Hopp 35bc25
  	{
Karsten Hopp 35bc25
! 	    MSG_PUTS_ATTR(_("recording"), attr);
Karsten Hopp 35bc25
  	    need_clear = TRUE;
Karsten Hopp 35bc25
  	}
Karsten Hopp 35bc25
  
Karsten Hopp 35bc25
--- 10164,10170 ----
Karsten Hopp 35bc25
  #endif
Karsten Hopp 35bc25
  		)
Karsten Hopp 35bc25
  	{
Karsten Hopp 35bc25
! 	    recording_mode(attr);
Karsten Hopp 35bc25
  	    need_clear = TRUE;
Karsten Hopp 35bc25
  	}
Karsten Hopp 35bc25
  
Karsten Hopp 35bc25
***************
Karsten Hopp 35bc25
*** 10227,10237 ****
Karsten Hopp 35bc25
      {
Karsten Hopp 35bc25
  	msg_pos_mode();
Karsten Hopp 35bc25
  	if (Recording)
Karsten Hopp 35bc25
! 	    MSG_PUTS_ATTR(_("recording"), hl_attr(HLF_CM));
Karsten Hopp 35bc25
  	msg_clr_eos();
Karsten Hopp 35bc25
      }
Karsten Hopp 35bc25
  }
Karsten Hopp 35bc25
  
Karsten Hopp 35bc25
  #if defined(FEAT_WINDOWS)
Karsten Hopp 35bc25
  /*
Karsten Hopp 35bc25
   * Draw the tab pages line at the top of the Vim window.
Karsten Hopp 35bc25
--- 10228,10251 ----
Karsten Hopp 35bc25
      {
Karsten Hopp 35bc25
  	msg_pos_mode();
Karsten Hopp 35bc25
  	if (Recording)
Karsten Hopp 35bc25
! 	    recording_mode(hl_attr(HLF_CM));
Karsten Hopp 35bc25
  	msg_clr_eos();
Karsten Hopp 35bc25
      }
Karsten Hopp 35bc25
  }
Karsten Hopp 35bc25
  
Karsten Hopp 35bc25
+     static void
Karsten Hopp 35bc25
+ recording_mode(attr)
Karsten Hopp 35bc25
+     int attr;
Karsten Hopp 35bc25
+ {
Karsten Hopp 35bc25
+     MSG_PUTS_ATTR(_("recording"), attr);
Karsten Hopp 35bc25
+     if (!shortmess(SHM_RECORDING))
Karsten Hopp 35bc25
+     {
Karsten Hopp 35bc25
+ 	char_u s[4];
Karsten Hopp 35bc25
+ 	sprintf((char *)s, " @%c", Recording);
Karsten Hopp 35bc25
+ 	MSG_PUTS_ATTR(s, attr);
Karsten Hopp 35bc25
+     }
Karsten Hopp 35bc25
+ }
Karsten Hopp 35bc25
+ 
Karsten Hopp 35bc25
  #if defined(FEAT_WINDOWS)
Karsten Hopp 35bc25
  /*
Karsten Hopp 35bc25
   * Draw the tab pages line at the top of the Vim window.
Karsten Hopp 35bc25
*** ../vim-7.4.924/src/version.c	2015-11-19 13:46:43.658535430 +0100
Karsten Hopp 35bc25
--- src/version.c	2015-11-19 17:27:48.956717638 +0100
Karsten Hopp 35bc25
***************
Karsten Hopp 35bc25
*** 743,744 ****
Karsten Hopp 35bc25
--- 743,746 ----
Karsten Hopp 35bc25
  {   /* Add new patch number below this line */
Karsten Hopp 35bc25
+ /**/
Karsten Hopp 35bc25
+     925,
Karsten Hopp 35bc25
  /**/
Karsten Hopp 35bc25
Karsten Hopp 35bc25
-- 
Karsten Hopp 35bc25
FIXME and XXX are two common keywords used to mark broken or incomplete code
Karsten Hopp 35bc25
not only since XXX as a sex reference would grab everybody's attention but
Karsten Hopp 35bc25
simply due to the fact that Vim would highlight these words.
Karsten Hopp 35bc25
					-- Hendrik Scholz
Karsten Hopp 35bc25
Karsten Hopp 35bc25
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 35bc25
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 35bc25
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 35bc25
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///