mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-14 06:23:50 -05:00
Update
This commit is contained in:
@@ -11,7 +11,7 @@ endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetNixIndent()
|
||||
setlocal indentkeys+=0=then,0=else,0=inherit,*<Return>
|
||||
setlocal indentkeys+=0=then,0=else,0=inherit,0=in,*<Return>
|
||||
|
||||
if exists("*GetNixIndent")
|
||||
finish
|
||||
@@ -21,8 +21,8 @@ let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let s:skip_syntax = '\%(Comment\|String\)$'
|
||||
let s:binding_open = '\%(\<let\>\|{\)'
|
||||
let s:binding_close = '\%(\<in\>\|}\)'
|
||||
let s:binding_open = '\%(\<let\>\)'
|
||||
let s:binding_close = '\%(\<in\>\)'
|
||||
let s:block_open = '\%({\|[\)'
|
||||
let s:block_close = '\%(}\|]\)'
|
||||
|
||||
@@ -54,14 +54,6 @@ function! GetNixIndent()
|
||||
return indent(bslnum)
|
||||
endif
|
||||
|
||||
if last_line =~ ';$'
|
||||
let bslnum = searchpair(s:binding_open, '', s:binding_close, 'bnW',
|
||||
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "StringSpecial$"')
|
||||
if bslnum != 0
|
||||
let ind = indent(bslnum) + &sw
|
||||
endif
|
||||
endif
|
||||
|
||||
if last_line =~ s:block_open . '\s*$'
|
||||
let ind += &sw
|
||||
endif
|
||||
@@ -78,7 +70,7 @@ function! GetNixIndent()
|
||||
let ind += &sw
|
||||
endif
|
||||
|
||||
if getline(v:lnum - 1) =~ '^\<in\s*$'
|
||||
if last_line =~ '^\<in\s*$'
|
||||
let ind += &sw
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user