Mercurial > vim
comparison src/ex_getln.c @ 13933:bea665293ea0 v8.0.1837
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
commit https://github.com/vim/vim/commit/5e3423d192bfa502c6704f731fa2ec6821f9a2f0
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 13 18:36:27 2018 +0200
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 https://github.com/vim/vim/issues/2320)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 13 May 2018 18:45:05 +0200 |
parents | 1f95ec5de238 |
children | c3f9c37160e7 |
comparison
equal
deleted
inserted
replaced
13932:7f6bca9f4b78 | 13933:bea665293ea0 |
---|---|
3570 * backspaces and the replacement string is inserted, followed by "c". | 3570 * backspaces and the replacement string is inserted, followed by "c". |
3571 */ | 3571 */ |
3572 static int | 3572 static int |
3573 ccheck_abbr(int c) | 3573 ccheck_abbr(int c) |
3574 { | 3574 { |
3575 int spos = 0; | |
3576 | |
3575 if (p_paste || no_abbr) /* no abbreviations or in paste mode */ | 3577 if (p_paste || no_abbr) /* no abbreviations or in paste mode */ |
3576 return FALSE; | 3578 return FALSE; |
3577 | 3579 |
3578 return check_abbr(c, ccline.cmdbuff, ccline.cmdpos, 0); | 3580 /* Do not consider '<,'> be part of the mapping, skip leading whitespace. |
3581 * Actually accepts any mark. */ | |
3582 while (VIM_ISWHITE(ccline.cmdbuff[spos]) && spos < ccline.cmdlen) | |
3583 spos++; | |
3584 if (ccline.cmdlen - spos > 5 | |
3585 && ccline.cmdbuff[spos] == '\'' | |
3586 && ccline.cmdbuff[spos + 2] == ',' | |
3587 && ccline.cmdbuff[spos + 3] == '\'') | |
3588 spos += 5; | |
3589 else | |
3590 /* check abbreviation from the beginning of the commandline */ | |
3591 spos = 0; | |
3592 | |
3593 return check_abbr(c, ccline.cmdbuff, ccline.cmdpos, spos); | |
3579 } | 3594 } |
3580 | 3595 |
3581 #if defined(FEAT_CMDL_COMPL) || defined(PROTO) | 3596 #if defined(FEAT_CMDL_COMPL) || defined(PROTO) |
3582 static int | 3597 static int |
3583 #ifdef __BORLANDC__ | 3598 #ifdef __BORLANDC__ |