aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim
diff options
context:
space:
mode:
authorGravatar Bart Trojanowski <bart@jukie.net>2009-11-25 14:18:29 -0500
committerGravatar Bart Trojanowski <bart@jukie.net>2009-11-25 14:18:29 -0500
commit898b173a182ee37d6e54f5f09284f99a8aef8892 (patch)
tree24560aa6b9c7a3fa0baea19ad316717cf8474b4a /vim
parent0f39d2c4deef6f774e63d78a226857039d0cd978 (diff)
vim: more cleanup and fixes for show_next/previous handlers
Diffstat (limited to 'vim')
-rw-r--r--vim/plugin/notmuch.vim21
1 files changed, 9 insertions, 12 deletions
diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim
index c95e6b0e..7927dd62 100644
--- a/vim/plugin/notmuch.vim
+++ b/vim/plugin/notmuch.vim
@@ -410,20 +410,19 @@ function! s:NM_show_previous(can_change_thread, find_matching)
continue
endif
- exec printf('norm %dG', msg['start'])
+ exec printf('norm %dGzt', msg['start'])
" TODO: try to fit the message on screen
- norm zz
return
endfor
if !a:can_change_thread
return
endif
call <SID>NM_kill_this_buffer()
- if line('.') != line('0')
+ if line('.') > 1
norm k
call <SID>NM_search_show_thread()
norm G
- call <SID>NM_show_previous(0)
+ call <SID>NM_show_previous(0, a:find_matching)
else
echo 'No more messages.'
endif
@@ -440,14 +439,16 @@ function! s:NM_show_next(can_change_thread, find_matching)
continue
endif
- exec printf('norm %dG', msg['start'])
+ exec printf('norm %dGzt', msg['start'])
" TODO: try to fit the message on screen
- norm zz
return
endfor
- if !a:can_change_thread
- return
+ if a:can_change_thread
+ call <SID>NM_show_next_thread()
endif
+endfunction
+
+function! s:NM_show_next_thread()
call <SID>NM_kill_this_buffer()
if line('.') != line('$')
norm j
@@ -465,10 +466,6 @@ function! s:NM_show_mark_read_then_archive_thread()
echo 'not implemented'
endfunction
-function! s:NM_show_next_message()
- echo 'not implemented'
-endfunction
-
function! s:NM_show_mark_read_then_next_open_message()
echo 'not implemented'
endfunction