X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=vim%2Fplugin%2Fnotmuch.vim;h=cb7f34f5e2e14985ecea8403e9c574f40d9245ce;hp=f32a134f01cd18261739fa547f0cf33c91b9d862;hb=dffee11a40dd85b174b726b602a3f53112229aff;hpb=e13bdc2c0e10dfa2786f65ee185e8a6563feb2db diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim index f32a134f..cb7f34f5 100644 --- a/vim/plugin/notmuch.vim +++ b/vim/plugin/notmuch.vim @@ -105,6 +105,7 @@ let s:notmuch_compose_headers_defaults = [ " --- --- bindings for folders mode {{{2 let g:notmuch_folders_maps = { + \ 'm': ':call NM_new_mail()', \ 's': ':call NM_search_prompt()', \ 'q': ':call NM_kill_this_buffer()', \ '=': ':call NM_folders_refresh_view()', @@ -346,7 +347,14 @@ function! s:NM_search_toggle_order() endfunction function! s:NM_search_reply_to_thread() - echo 'not implemented' + let cmd = ['reply'] + call add(cmd, NM_search_thread_id()) + call add(cmd, 'AND') + call extend(cmd, NM_get_search_words()) + + let data = NM_run(cmd) + let lines = split(data, "\n") + call NM_newComposeBuffer(lines, 0) endfunction function! s:NM_search_add_tags(tags) @@ -498,7 +506,14 @@ function! s:NM_show_previous_message() endfunction function! s:NM_show_reply() - echo 'not implemented' + let cmd = ['reply'] + call add(cmd, NM_show_message_id()) + call add(cmd, 'AND') + call extend(cmd, NM_get_search_words()) + + let data = NM_run(cmd) + let lines = split(data, "\n") + call NM_newComposeBuffer(lines, 0) endfunction function! s:NM_show_view_all_mime_parts() @@ -624,9 +639,19 @@ function! s:NM_show_fold_toggle(key, type, fold) let act = 'close' endif for fld in info['folds'] - if fld[0] == a:type - exec printf('%dfold%s', fld[1], act) + if fld[0] != a:type + continue 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 exec printf('nnoremap %s :call NM_show_fold_toggle(''%s'', ''%s'', %d)', a:key, a:key, a:type, !a:fold) endfunction @@ -1134,7 +1159,7 @@ function! s:NM_newComposeBuffer(lines, start_on_line) if start_on_line > 0 && start_on_line <= len(lines) call cursor(start_on_line, strlen(getline(start_on_line)) + 1) else - call cursor(real_hdr_start, strlen(getline(real_hdr_start) + 1) + call cursor(real_hdr_start, strlen(getline(real_hdr_start)) + 1) call NM_compose_next_entry_area() endif @@ -1231,7 +1256,7 @@ endfunction " --- external mail handling helpers {{{1 function! s:NM_new_mail() - echo 'not implemented' + call NM_cmd_compose([], []) endfunction " --- tag manipulation helpers {{{1