mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
vim-patch:8.0.1766: expanding abbreviation doesn't work
Problem: Expanding abbreviation doesn't work. (Tooth Pik)
Solution: Return OK instead of FALSE and FAIL instead of TRUE. (Christian
Brabandt)
c3c3e69896
This commit is contained in:
parent
44c111e49f
commit
a9b7debbbc
@ -8360,10 +8360,10 @@ static bool ins_tab(void)
|
||||
static bool ins_eol(int c)
|
||||
{
|
||||
if (echeck_abbr(c + ABBR_OFF)) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
if (stop_arrow() == FAIL) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
undisplay_dollar();
|
||||
|
||||
|
@ -214,3 +214,19 @@ func Test_cabbr_visual_mode()
|
||||
call assert_equal(expected, getreg(':'))
|
||||
cunabbr s
|
||||
endfunc
|
||||
|
||||
func Test_abbreviation_CR()
|
||||
new
|
||||
func Eatchar(pat)
|
||||
let c = nr2char(getchar(0))
|
||||
return (c =~ a:pat) ? '' : c
|
||||
endfunc
|
||||
iabbrev <buffer><silent> ~~7 <c-r>=repeat('~', 7)<CR><c-r>=Eatchar('\s')<cr>
|
||||
call feedkeys("GA~~7 \<esc>", 'xt')
|
||||
call assert_equal('~~~~~~~', getline('$'))
|
||||
%d
|
||||
call feedkeys("GA~~7\<cr>\<esc>", 'xt')
|
||||
call assert_equal(['~~~~~~~', ''], getline(1,'$'))
|
||||
delfunc Eatchar
|
||||
bw!
|
||||
endfunc
|
||||
|
Loading…
Reference in New Issue
Block a user