Skip to content

the text arguments of a command in a lambda block run onto later lines - #157

Merged
Galvarcus merged 1 commit into
Developmentfrom
155-block-line-args
Nov 15, 2026
Merged

Galvarcus merged 1 commit into
Developmentfrom
155-block-line-args

Conversation

@Galvarcus

Copy link
Copy Markdown
Owner

The lines of a lambda block stay in one statement. text_args read a word as an argument of every text command before it in the statement, up to a bar, and :normal past every bar. So after edit foo, highlight Foo guifg=red or normal! gg, a call Missing() on the next line of the block was marked as a word of Vim, and a call to a function that does not exist gave no unplaced name.

opens_block_line now tells a head that opens a line of the block, and the text of a command before it ends there. A head that a backslash carries on to a line of its own ends the text as well, which leaves a word counted and drops none.

fixes: #155

AI assistance

  • AI involvement is disclosed in the commit message

Checklist

  • The commit message follows the Problem and Solution form above
  • tools/check prints every check passed
  • The Signed-off-by: trailer is present, which the
    prepare-commit-msg hook adds. A fresh checkout has no hooks,
    so install them again before the first commit

Tests

  • Tests were added, and each was watched failing first

the_text_arguments_of_a_command_in_a_lambda_block_end_with_its_line in tests/vim9_excmds.rs fails without the change: all three Missing references were marked as Vim's. It also guards that the arguments themselves stay Vim's.

What the analyzer reports

  • No finding moves, and every parity fixture matches

The four corpora and the survey report the same as before.

Documentation

  • No documentation update is needed

Problem:  The text arguments of a command in a lambda block run onto
          later lines.
Solution: End the text of a command at a head that opens a line of the
          block (Galvarcus).

The lines of a lambda block stay in one statement. text_args read a word
as an argument of every text command before it in the statement, up to
a bar, and `:normal` past every bar. So after `edit foo`, `highlight Foo
guifg=red` or `normal! gg`, a call `Missing()` on the next line of the
block was marked as a word of Vim, and a call to a function that does not
exist gave no unplaced name.

opens_block_line now tells a head that opens a line of the block, and
the text of a command before it ends there. A head that a backslash
carries on to a line of its own ends the text as well, which leaves a
word counted and drops none.

The four corpora and the survey report the same as before.

fixes:   #155
related: #140
related: #153

Assisted-by: Claude Opus 5
Signed-off-by: Galvarcus <117151435+Galvarcus@users.noreply.github.com>
@Galvarcus Galvarcus self-assigned this Nov 15, 2026
@github-actions github-actions Bot added the analyzer Changes the Rust analyzer, the fixtures, or the tools that build them label Nov 15, 2026
@Galvarcus
Galvarcus merged commit a206cb5 into Development Nov 15, 2026
9 checks passed
@Galvarcus
Galvarcus deleted the 155-block-line-args branch November 15, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

analyzer Changes the Rust analyzer, the fixtures, or the tools that build them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant