mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 19:36:40 +00:00
vim-patch:8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Problem: One character cmdline abbreviation not triggered after '<,'>.
Solution: Skip over the special range. (Christian Brabandt, closes vim/vim#2320)
5e3423d192
This commit is contained in:
@@ -3522,10 +3522,27 @@ void gotocmdline(int clr)
|
||||
*/
|
||||
static int ccheck_abbr(int c)
|
||||
{
|
||||
int spos = 0;
|
||||
|
||||
if (p_paste || no_abbr) /* no abbreviations or in paste mode */
|
||||
return FALSE;
|
||||
|
||||
return check_abbr(c, ccline.cmdbuff, ccline.cmdpos, 0);
|
||||
// Do not consider '<,'> be part of the mapping, skip leading whitespace.
|
||||
// Actually accepts any mark.
|
||||
while (ascii_iswhite(ccline.cmdbuff[spos]) && spos < ccline.cmdlen) {
|
||||
spos++;
|
||||
}
|
||||
if (ccline.cmdlen - spos > 5
|
||||
&& ccline.cmdbuff[spos] == '\''
|
||||
&& ccline.cmdbuff[spos + 2] == ','
|
||||
&& ccline.cmdbuff[spos + 3] == '\'') {
|
||||
spos += 5;
|
||||
} else {
|
||||
// check abbreviation from the beginning of the commandline
|
||||
spos = 0;
|
||||
}
|
||||
|
||||
return check_abbr(c, ccline.cmdbuff, ccline.cmdpos, spos);
|
||||
}
|
||||
|
||||
static int sort_func_compare(const void *s1, const void *s2)
|
||||
|
Reference in New Issue
Block a user