Skip to content

Autocommands sometimes not parsed correctly anymore, since 8.2.1365 #6634

@bfrg

Description

@bfrg

Describe the bug
Since bb1b5e2 (8.2.1365) autocommands are not always parsed correctly anymore.

To Reproduce

  1. Run vim --clean test.vim -S test.vim with
    augroup test
        autocmd!
        autocmd BufReadPost *
                \ if !exists("g:leave_my_cursor_position_alone") |
                \     if line("'\"") > 0 && line ("'\"") <= line("$") |
                \         exe "normal! g'\"" |
                \     endif |
                \ endif
    augroup END
  2. Run :edit foo | buffer #. Alternatively put the cursor on a keyword and press K.
  3. Result:
    Error detected while processing BufRead Autocommands for "*":
    E121: Undefined variable: line
    

Expected behavior
No errors.

Environment
Vim version 8.2.1377

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions