From 3e0c887365bc1ebd55b91dd69ab73f2dee1f00ed Mon Sep 17 00:00:00 2001 From: Dan Reif Date: Mon, 30 Apr 2018 12:00:42 -0700 Subject: Update (periodic rebuild) I originally meant to run this before adding haproxy, but accidentally pushed that into my branch. If you'd like to see that content, it's at https://github.com/CH-DanReif/vim-polyglot/commit/414ad25c3ad1ab9c4b6a99fe4f08d6c30b7e0f57. --- indent/nix.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indent/nix.vim') diff --git a/indent/nix.vim b/indent/nix.vim index 679b224f..fd277dcc 100644 --- a/indent/nix.vim +++ b/indent/nix.vim @@ -33,6 +33,12 @@ function! GetNixIndent() return 0 endif + " Skip indentation for single line comments explicitly, in case a + " comment was just inserted (eg. visual block mode) + if getline(v:lnum) =~ '^\s*#' + return indent(v:lnum) + endif + if synIDattr(synID(v:lnum, 1, 1), "name") !~ s:skip_syntax let current_line = getline(v:lnum) let last_line = getline(lnum) @@ -63,7 +69,7 @@ function! GetNixIndent() let ind = indent(v:lnum) let bslnum = searchpair('''''', '', '''''', 'bnW', - \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "InterpolationSpecial$"') + \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "StringSpecial$"') if ind <= indent(bslnum) let ind = indent(bslnum) + &sw -- cgit v1.2.3