comparison src/ex_getln.c @ 2937:0a650db02653 v7.3.241

updated for version 7.3.241 Problem: Using CTRL-R CTRL-W on the command line may insert only part of the word. Solution: Use the cursor position instead of assuming it is at the end of the command. (Tyru)
author Bram Moolenaar <bram@vim.org>
date Thu, 07 Jul 2011 16:44:37 +0200
parents f2c108f44f41
children eff686fb8de6
comparison
equal deleted inserted replaced
2936:73c9479ccf57 2937:0a650db02653
3044 { 3044 {
3045 char_u *w; 3045 char_u *w;
3046 int len; 3046 int len;
3047 3047
3048 /* Locate start of last word in the cmd buffer. */ 3048 /* Locate start of last word in the cmd buffer. */
3049 for (w = ccline.cmdbuff + ccline.cmdlen; w > ccline.cmdbuff; ) 3049 for (w = ccline.cmdbuff + ccline.cmdpos; w > ccline.cmdbuff; )
3050 { 3050 {
3051 #ifdef FEAT_MBYTE 3051 #ifdef FEAT_MBYTE
3052 if (has_mbyte) 3052 if (has_mbyte)
3053 { 3053 {
3054 len = (*mb_head_off)(ccline.cmdbuff, w - 1) + 1; 3054 len = (*mb_head_off)(ccline.cmdbuff, w - 1) + 1;
3062 if (!vim_iswordc(w[-1])) 3062 if (!vim_iswordc(w[-1]))
3063 break; 3063 break;
3064 --w; 3064 --w;
3065 } 3065 }
3066 } 3066 }
3067 len = (int)((ccline.cmdbuff + ccline.cmdlen) - w); 3067 len = (int)((ccline.cmdbuff + ccline.cmdpos) - w);
3068 if (p_ic ? STRNICMP(w, arg, len) == 0 : STRNCMP(w, arg, len) == 0) 3068 if (p_ic ? STRNICMP(w, arg, len) == 0 : STRNCMP(w, arg, len) == 0)
3069 p += len; 3069 p += len;
3070 } 3070 }
3071 3071
3072 cmdline_paste_str(p, literally); 3072 cmdline_paste_str(p, literally);