Mercurial > vim
comparison src/eval.c @ 31813:cd4065ab4503 v9.0.1239
patch 9.0.1239: cannot have a line break before an object member access
Commit: https://github.com/vim/vim/commit/b149d2279673aa89ab5e35958d05cc4bcc70f82a
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 24 13:03:37 2023 +0000
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 https://github.com/vim/vim/issues/11864)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 24 Jan 2023 14:15:03 +0100 |
parents | 57248cc8bd70 |
children | 7d505d77f6da |
comparison
equal
deleted
inserted
replaced
31812:5544b9783693 | 31813:cd4065ab4503 |
---|---|
6745 { | 6745 { |
6746 // When at the end of the line and ".name" or "->{" or "->X" follows in | 6746 // When at the end of the line and ".name" or "->{" or "->X" follows in |
6747 // the next line then consume the line break. | 6747 // the next line then consume the line break. |
6748 p = eval_next_non_blank(*arg, evalarg, &getnext); | 6748 p = eval_next_non_blank(*arg, evalarg, &getnext); |
6749 if (getnext | 6749 if (getnext |
6750 && ((rettv->v_type == VAR_DICT && *p == '.' && eval_isdictc(p[1])) | 6750 && ((*p == '.' |
6751 && ((rettv->v_type == VAR_DICT && eval_isdictc(p[1])) | |
6752 || rettv->v_type == VAR_CLASS | |
6753 || rettv->v_type == VAR_OBJECT)) | |
6751 || (p[0] == '-' && p[1] == '>' && (p[2] == '{' | 6754 || (p[0] == '-' && p[1] == '>' && (p[2] == '{' |
6752 || ASCII_ISALPHA(in_vim9script() ? *skipwhite(p + 2) | 6755 || ASCII_ISALPHA(in_vim9script() ? *skipwhite(p + 2) |
6753 : p[2]))))) | 6756 : p[2]))))) |
6754 { | 6757 { |
6755 *arg = eval_next_line(*arg, evalarg); | 6758 *arg = eval_next_line(*arg, evalarg); |