Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Autocommand bodies with continued lines of lists/dicts end up with pipes and multiple backslashes #1

@deathlyfrantic

Description

@deathlyfrantic

Example (from vim-endwise):

autocmd FileType lua let b:endwise = {
      \ 'addition': 'end',
      \ 'words': 'function,do,then',
      \ 'pattern': '^\s*\zs\%(\%(local\s\+\)\=function\)\>\%(.*\<end\>\)\@!\|\<\%(then\|do\)\ze\s*$',
      \ 'syngroups': 'luaFunction,luaStatement,luaCond'}

This gets formatted as:

autocmd FileType lua
      \ let b:endwise = { |
      \       \ 'addition': 'end', |
      \       \ 'words': 'function,do,then', |
      \       \ 'pattern': |
      \       \ '^\s*\zs\%(\%(local\s\+\)\=function\)\>\%(.*\<end\>\)\@!\|\<\%(then\|do\)\ze\s*$', |
      \       \ 'syngroups': 'luaFunction,luaStatement,luaCond', |
      \       \ }

Haven't narrowed this down yet but probably it's because formatting an autocommand in f_node() is pretty janky and assumes all the lines of the body are individual expressions. Likely need to add a f_autocmd() method to handle this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions