From 556ba05ceeb3e1053c2a99a303a13b2b8e82f0f9 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 4 Sep 2020 18:55:51 +0200 Subject: Ignore heredoc when detecting indent --- plugin/polyglot.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'plugin') 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 "< 0 + let heredoc = herematch[1] . '$' + endif + let spaces_minus_tabs += line[0] == "\t" ? 1 : -1 if line[0] == "\t" -- cgit v1.2.3