mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
add abort for functions
This commit is contained in:
parent
3e97ae117f
commit
e2b32df47f
@ -49,7 +49,7 @@ function! utils#RandInt(Low, High) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Custom fold expr, adapted from https://vi.stackexchange.com/a/9094/15292
|
" Custom fold expr, adapted from https://vi.stackexchange.com/a/9094/15292
|
||||||
function! utils#VimFolds(lnum)
|
function! utils#VimFolds(lnum) abort
|
||||||
" get content of current line and the line below
|
" get content of current line and the line below
|
||||||
let l:cur_line = getline(a:lnum)
|
let l:cur_line = getline(a:lnum)
|
||||||
let l:next_line = getline(a:lnum+1)
|
let l:next_line = getline(a:lnum+1)
|
||||||
@ -67,7 +67,7 @@ endfunction
|
|||||||
|
|
||||||
" Custom fold text, adapted from https://vi.stackexchange.com/a/3818/15292
|
" Custom fold text, adapted from https://vi.stackexchange.com/a/3818/15292
|
||||||
" and https://vi.stackexchange.com/a/6608/15292
|
" and https://vi.stackexchange.com/a/6608/15292
|
||||||
function! utils#MyFoldText()
|
function! utils#MyFoldText() abort
|
||||||
let line = getline(v:foldstart)
|
let line = getline(v:foldstart)
|
||||||
let folded_line_num = v:foldend - v:foldstart
|
let folded_line_num = v:foldend - v:foldstart
|
||||||
let line_text = substitute(line, '^"{\+', '', 'g')
|
let line_text = substitute(line, '^"{\+', '', 'g')
|
||||||
@ -76,7 +76,7 @@ function! utils#MyFoldText()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Toggle cursor column
|
" Toggle cursor column
|
||||||
function! utils#ToggleCursorCol()
|
function! utils#ToggleCursorCol() abort
|
||||||
if &cursorcolumn
|
if &cursorcolumn
|
||||||
set nocursorcolumn
|
set nocursorcolumn
|
||||||
echo "cursorcolumn: OFF"
|
echo "cursorcolumn: OFF"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user