diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-04-23 22:48:41 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-04-27 09:21:28 -0400 |
commit | d4b65fa6fb330a5a174bdc3a8a838cffa28b0859 (patch) | |
tree | 3b3f5e20196607933f32f2ae8d6cfdc117897fe7 /runtime/indent/vim.vim | |
parent | 233292b0ba9fb5d60ef7b2973c3a778e9c12be0c (diff) | |
download | rneovim-d4b65fa6fb330a5a174bdc3a8a838cffa28b0859.tar.gz rneovim-d4b65fa6fb330a5a174bdc3a8a838cffa28b0859.tar.bz2 rneovim-d4b65fa6fb330a5a174bdc3a8a838cffa28b0859.zip |
vim-patch:1ff14ba24c4d
Update runtime files.
https://github.com/vim/vim/commit/1ff14ba24c4d85c008d7abe5e140dbb497ffea8d
Diffstat (limited to 'runtime/indent/vim.vim')
-rw-r--r-- | runtime/indent/vim.vim | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/runtime/indent/vim.vim b/runtime/indent/vim.vim index cd735c3a3c..db27f19714 100644 --- a/runtime/indent/vim.vim +++ b/runtime/indent/vim.vim @@ -1,7 +1,7 @@ " Vim indent file " Language: Vim script " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2016 Jun 27 +" Last Change: 2019 Oct 31 " Only load this indent file when no other was loaded. if exists("b:did_indent") @@ -56,6 +56,31 @@ function GetVimIndentIntern() " and :else. Add it three times for a line that starts with '\' or '"\ ' " after a line that doesn't (or g:vim_indent_cont if it exists). let ind = indent(lnum) + + " In heredoc indenting works completely differently. + if has('syntax_items') + let syn_here = synIDattr(synID(v:lnum, 1, 1), "name") + if syn_here =~ 'vimLetHereDocStop' + " End of heredoc: use indent of matching start line + let lnum = v:lnum - 1 + while lnum > 0 + if synIDattr(synID(lnum, 1, 1), "name") !~ 'vimLetHereDoc' + return indent(lnum) + endif + let lnum -= 1 + endwhile + return 0 + endif + if syn_here =~ 'vimLetHereDoc' + if synIDattr(synID(lnum, 1, 1), "name") !~ 'vimLetHereDoc' + " First line in heredoc: increase indent + return ind + shiftwidth() + endif + " Heredoc continues: no change in indent + return ind + endif + endif + if cur_text =~ s:lineContPat && v:lnum > 1 && prev_text !~ s:lineContPat if exists("g:vim_indent_cont") let ind = ind + g:vim_indent_cont |