mirror of
https://github.com/urbit/shrub.git
synced 2024-11-09 15:57:27 +03:00
Only allow ninja modes if hoon_ninja exists and is not 0.
This commit is contained in:
parent
f6db3e9200
commit
8e0dbaed41
@ -18,13 +18,28 @@ if exists("*HoonIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
if exists("b:hoon_did_submode_mapping")
|
||||
function! HoonIndent(lnum)
|
||||
let prevlnum = prevnonblank(a:lnum-1)
|
||||
if prevlnum == 0
|
||||
return 0
|
||||
endif
|
||||
let prevl = substitute(getline(prevlnum),'::.*$','','')
|
||||
|
||||
let ind = indent(prevlnum)
|
||||
if prevl =~ '++\s*\w*\s*$'
|
||||
" luslus operator
|
||||
let ind += &sw
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
if exists("b:hoon_did_submode_mapping") || !exists("g:hoon_ninja") || g:hoon_ninja == 0
|
||||
finish
|
||||
endif
|
||||
|
||||
let g:submode_timeout = 0
|
||||
|
||||
"call submode#enter_with('hoon_ninja', 'i', '', '/ninja')
|
||||
call submode#enter_with('hoon_ninja', 'i', '', '//')
|
||||
call submode#map('hoon_ninja', 'i', '', 'bar', '\|')
|
||||
call submode#map('hoon_ninja', 'i', '', 'gal', '<')
|
||||
@ -181,19 +196,3 @@ call submode#map('hoon_jnn', 'i', '', '9', 'pl')
|
||||
call submode#map('hoon_jnn', 'i', '', '0', 'pr')
|
||||
let b:hoon_did_submode_mapping = 1
|
||||
|
||||
function! HoonIndent(lnum)
|
||||
let prevlnum = prevnonblank(a:lnum-1)
|
||||
if prevlnum == 0
|
||||
return 0
|
||||
endif
|
||||
let prevl = substitute(getline(prevlnum),'::.*$','','')
|
||||
|
||||
let ind = indent(prevlnum)
|
||||
if prevl =~ '++\s*\w*\s*$'
|
||||
" luslus operator
|
||||
let ind += &sw
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user