diff options
| -rw-r--r-- | plugin/polyglot.vim | 13 | 
1 files changed, 13 insertions, 0 deletions
| diff --git a/plugin/polyglot.vim b/plugin/polyglot.vim index ccdef112..bcf255f0 100644 --- a/plugin/polyglot.vim +++ b/plugin/polyglot.vim @@ -31,6 +31,7 @@ function! s:guess(lines) abort    let triplequote = 0    let backtick = 0    let xmlcomment = 0 +  let heredoc = ''    let minindent = 10    let spaces_minus_tabs = 0 @@ -87,6 +88,18 @@ function! s:guess(lines) abort        continue      endif +    " This is correct order because both "<<EOF" and "EOF" matches end +    if heredoc != '' +      if line =~# heredoc +        let heredoc = '' +      endif +      continue +    endif +    let herematch = matchlist(line, '\C<<\W*\([A-Z]\+\)\s*$') +    if len(herematch) > 0 +      let heredoc = herematch[1] . '$' +    endif +      let spaces_minus_tabs += line[0] == "\t" ? 1 : -1      if line[0] == "\t" | 
