mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -24,7 +24,7 @@ if exists("*GoIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
function! GoIndent(lnum)
|
||||
function! GoIndent(lnum) abort
|
||||
let prevlnum = prevnonblank(a:lnum-1)
|
||||
if prevlnum == 0
|
||||
" top of file
|
||||
@ -38,10 +38,17 @@ function! GoIndent(lnum)
|
||||
|
||||
let ind = previ
|
||||
|
||||
if prevl =~ ' = `[^`]*$'
|
||||
" previous line started a multi-line raw string
|
||||
return 0
|
||||
endif
|
||||
for synid in synstack(a:lnum, 1)
|
||||
if synIDattr(synid, 'name') == 'goRawString'
|
||||
if prevl =~ '\%(\%(:\?=\)\|(\|,\)\s*`[^`]*$'
|
||||
" previous line started a multi-line raw string
|
||||
return 0
|
||||
endif
|
||||
" return -1 to keep the current indent.
|
||||
return -1
|
||||
endif
|
||||
endfor
|
||||
|
||||
if prevl =~ '[({]\s*$'
|
||||
" previous line opened a block
|
||||
let ind += shiftwidth()
|
||||
|
Reference in New Issue
Block a user