0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 9.0.1239: cannot have a line break before an object member access

Problem:    Cannot have a line break before an object member access.
Solution:   Check for "." in next line. (closes #11864)
This commit is contained in:
Bram Moolenaar
2023-01-24 13:03:37 +00:00
parent 5c8771bc5a
commit b149d22796
3 changed files with 32 additions and 1 deletions

View File

@@ -6747,7 +6747,10 @@ handle_subscript(
// the next line then consume the line break.
p = eval_next_non_blank(*arg, evalarg, &getnext);
if (getnext
&& ((rettv->v_type == VAR_DICT && *p == '.' && eval_isdictc(p[1]))
&& ((*p == '.'
&& ((rettv->v_type == VAR_DICT && eval_isdictc(p[1]))
|| rettv->v_type == VAR_CLASS
|| rettv->v_type == VAR_OBJECT))
|| (p[0] == '-' && p[1] == '>' && (p[2] == '{'
|| ASCII_ISALPHA(in_vim9script() ? *skipwhite(p + 2)
: p[2])))))