diff options
Diffstat (limited to 'indent/nix.vim')
-rw-r--r-- | indent/nix.vim | 8 |
1 files changed, 7 insertions, 1 deletions
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 |