mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-12 05:23:51 -05:00
Update dependencies
This commit is contained in:
@@ -21,6 +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:block_open = '\%({\|[\)'
|
||||
let s:block_close = '\%(}\|]\)'
|
||||
|
||||
@@ -43,6 +45,23 @@ function! GetNixIndent()
|
||||
let current_line = getline(v:lnum)
|
||||
let last_line = getline(lnum)
|
||||
|
||||
if current_line =~ '^\s*in\>'
|
||||
let save_cursor = getcurpos()
|
||||
normal ^
|
||||
let bslnum = searchpair(s:binding_open, '', s:binding_close, 'bnW',
|
||||
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "StringSpecial$"')
|
||||
call setpos('.', save_cursor)
|
||||
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
|
||||
@@ -51,6 +70,10 @@ function! GetNixIndent()
|
||||
let ind -= &sw
|
||||
endif
|
||||
|
||||
if last_line =~ '[(=]$'
|
||||
let ind += &sw
|
||||
endif
|
||||
|
||||
if last_line =~ '\<let\s*$'
|
||||
let ind += &sw
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user