Closes #2 Add NimRenameSymbolProject
This commit is contained in:
parent
33ff7a6206
commit
a47fb5e0fa
2 changed files with 8 additions and 2 deletions
|
|
@ -26,10 +26,14 @@ function! s:RenameImpl.run(data)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if res.file != expand("%:p")
|
if res.file != expand("%:p")
|
||||||
execute ":e " . expand("%:p")
|
execute ":e " . res.file
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let left = getline(res.line)[0:res.col - 1]
|
if getline(res.line)[res.col] == '*'
|
||||||
|
let res.col -= len(res.name)
|
||||||
|
endif
|
||||||
|
|
||||||
|
let left = res.col != 0 ? getline(res.line)[0:res.col - 1] : ""
|
||||||
let right = getline(res.line)[res.col + len(oldName):-1]
|
let right = getline(res.line)[res.col + len(oldName):-1]
|
||||||
call setline(res.line, left . newName . right)
|
call setline(res.line, left . newName . right)
|
||||||
endfor
|
endfor
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ setlocal nolisp
|
||||||
setlocal autoindent
|
setlocal autoindent
|
||||||
setlocal indentkeys=!^F,o,O,<:>,0),0],0},=elif
|
setlocal indentkeys=!^F,o,O,<:>,0),0],0},=elif
|
||||||
setlocal indentexpr=NimIndent()
|
setlocal indentexpr=NimIndent()
|
||||||
|
setlocal foldmethod=indent
|
||||||
|
setlocal foldexpr=NimIndent()
|
||||||
|
|
||||||
function! Down()
|
function! Down()
|
||||||
return indent(prevnonblank(v:lnum - 1)) - &tabstop
|
return indent(prevnonblank(v:lnum - 1)) - &tabstop
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue