mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 09:24:54 +01:00
vim: don't toggle folds that are inside closed folds in show mode
This commit is contained in:
parent
e5a25c7692
commit
dffee11a40
1 changed files with 12 additions and 2 deletions
|
@ -639,9 +639,19 @@ function! s:NM_show_fold_toggle(key, type, fold)
|
||||||
let act = 'close'
|
let act = 'close'
|
||||||
endif
|
endif
|
||||||
for fld in info['folds']
|
for fld in info['folds']
|
||||||
if fld[0] == a:type
|
if fld[0] != a:type
|
||||||
exec printf('%dfold%s', fld[1], act)
|
continue
|
||||||
endif
|
endif
|
||||||
|
"let idx = fld[3]
|
||||||
|
"let msg = info['msgs'][idx]
|
||||||
|
"if has_key(msg,'match') && msg['match'] == '0'
|
||||||
|
" continue
|
||||||
|
"endif
|
||||||
|
let cls = foldclosed(fld[1])
|
||||||
|
if cls != -1 && cls != fld[1]
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
exec printf('%dfold%s', fld[1], act)
|
||||||
endfor
|
endfor
|
||||||
exec printf('nnoremap <buffer> %s :call <SID>NM_show_fold_toggle(''%s'', ''%s'', %d)<CR>', a:key, a:key, a:type, !a:fold)
|
exec printf('nnoremap <buffer> %s :call <SID>NM_show_fold_toggle(''%s'', ''%s'', %d)<CR>', a:key, a:key, a:type, !a:fold)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
Loading…
Reference in a new issue