mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -6,6 +6,10 @@ if !exists("g:go_textobj_include_function_doc")
|
||||
let g:go_textobj_include_function_doc = 1
|
||||
endif
|
||||
|
||||
if !exists("g:go_textobj_include_variable")
|
||||
let g:go_textobj_include_variable = 1
|
||||
endif
|
||||
|
||||
" ( ) motions
|
||||
" { } motions
|
||||
" s for sentence
|
||||
@ -60,6 +64,16 @@ function! go#textobj#Function(mode) abort
|
||||
" want's to include doc comments for function declarations
|
||||
if has_key(info, 'doc') && g:go_textobj_include_function_doc
|
||||
call cursor(info.doc.line, info.doc.col)
|
||||
elseif info['sig']['name'] == '' && g:go_textobj_include_variable
|
||||
" one liner anonymous functions
|
||||
if info.lbrace.line == info.rbrace.line
|
||||
" jump to first nonblack char, to get the correct column
|
||||
call cursor(info.lbrace.line, 0 )
|
||||
normal! ^
|
||||
call cursor(info.func.line, col("."))
|
||||
else
|
||||
call cursor(info.func.line, info.rbrace.col)
|
||||
endif
|
||||
else
|
||||
call cursor(info.func.line, info.func.col)
|
||||
endif
|
||||
|
Reference in New Issue
Block a user