mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:partial:9.0.0737: Lisp word only recognized when a space follows
Problem: Lisp word only recognized when a space follows.
Solution: Also match a word at the end of a line. Rename the test. Use a
compiled function to avoid backslashes.
d26c5805bc
Keep the old Test_lisp_indent().
This commit is contained in:
parent
433818351b
commit
eaac095825
@ -1138,7 +1138,7 @@ static int lisp_match(char_u *p)
|
||||
(void)copy_option_part(&word, (char *)buf, LSIZE, ",");
|
||||
len = (int)STRLEN(buf);
|
||||
|
||||
if ((STRNCMP(buf, p, len) == 0) && (p[len] == ' ')) {
|
||||
if ((STRNCMP(buf, p, len) == 0) && ascii_iswhite_or_nul(p[len])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ source test_fnamemodify.vim
|
||||
source test_ga.vim
|
||||
source test_glob2regpat.vim
|
||||
source test_global.vim
|
||||
source test_lispwords.vim
|
||||
source test_move.vim
|
||||
source test_put.vim
|
||||
source test_reltime.vim
|
||||
|
@ -86,6 +86,11 @@ func Test_lisp_indent()
|
||||
set nolisp
|
||||
endfunc
|
||||
|
||||
func Test_lispindent_negative()
|
||||
" in legacy script there is no error
|
||||
call assert_equal(-1, lispindent(-1))
|
||||
endfunc
|
||||
|
||||
func Test_lisp_indent_works()
|
||||
" This was reading beyond the end of the line
|
||||
new
|
Loading…
Reference in New Issue
Block a user