]> git.notmuchmail.org Git - notmuch/blobdiff - vim/plugin/notmuch.vim
Fix typo in message
[notmuch] / vim / plugin / notmuch.vim
index c5655617c862fcbd6da463c58fc0b3397ee4de08..a9754f2b4b2e94de332931806260323ff674bfaa 100644 (file)
@@ -114,7 +114,8 @@ let g:notmuch_folders_maps = {
 
 " --- --- bindings for search screen {{{2
 let g:notmuch_search_maps = {
-        \ '<Enter>':    ':call <SID>NM_search_show_thread()<CR>',
+        \ '<Space>':    ':call <SID>NM_search_show_thread(0)<CR>',
+        \ '<Enter>':    ':call <SID>NM_search_show_thread(1)<CR>',
         \ '<C-]>':      ':call <SID>NM_search_expand(''<cword>'')<CR>',
         \ 'a':          ':call <SID>NM_search_archive_thread()<CR>',
         \ 'f':          ':call <SID>NM_search_filter()<CR>',
@@ -177,7 +178,7 @@ let g:notmuch_compose_imaps = {
 
 function! s:NM_cmd_folders(words)
         if len(a:words)
-                throw 'Not exapecting any arguments for folders command.'
+                throw 'Not expecting any arguments for folders command.'
         endif
         let cmd = ['count']
         let disp = []
@@ -266,17 +267,15 @@ endfunction
 
 " --- --- search screen action functions {{{2
 
-function! s:NM_search_show_thread()
-        let id = <SID>NM_search_thread_id()
-        if id != ''
-                let words = [id]
-                if exists('b:nm_search_words')
-                        let words = ['('] + b:nm_search_words + [')', 'AND', id]
-                endif
-                if len(words)
-                        call <SID>NM_cmd_show(words)
-                endif
+function! s:NM_search_show_thread(everything)
+        let words = [ <SID>NM_search_thread_id() ]
+        if !a:everything && exists('b:nm_search_words')
+                call extend(words, ['AND', '('])
+                call extend(words, b:nm_search_words)
+                call add(words, ')')
         endif
+        call <SID>NM_cmd_show(words)
+        let b:nm_show_everything = a:everything
 endfunction
 
 function! s:NM_search_prompt()
@@ -410,7 +409,7 @@ endfunction
 
 function! s:NM_cmd_show(words)
         let prev_bufnr = bufnr('%')
-        let data = s:NM_run(['show'] + a:words)
+        let data = s:NM_run(['show', '--entire-thread'] + a:words)
         let lines = split(data, "\n")
 
         let info = s:NM_cmd_show_parse(lines)
@@ -432,6 +431,7 @@ function! s:NM_cmd_show(words)
 endfunction
 
 function! s:NM_show_previous(can_change_thread, find_matching)
+        let everything = exists('b:nm_show_everything') ? b:nm_show_everything : 0
         let info = b:nm_raw_info
         let lnum = line('.')
         for msg in reverse(copy(info['msgs']))
@@ -452,7 +452,7 @@ function! s:NM_show_previous(can_change_thread, find_matching)
         call <SID>NM_kill_this_buffer()
         if line('.') > 1
                 norm k
-                call <SID>NM_search_show_thread()
+                call <SID>NM_search_show_thread(everything)
                 norm G
                 call <SID>NM_show_previous(0, a:find_matching)
         else
@@ -481,10 +481,11 @@ function! s:NM_show_next(can_change_thread, find_matching)
 endfunction
 
 function! s:NM_show_next_thread()
+        let everything = exists('b:nm_show_everything') ? b:nm_show_everything : 0
         call <SID>NM_kill_this_buffer()
         if line('.') != line('$')
                 norm j
-                call <SID>NM_search_show_thread()
+                call <SID>NM_search_show_thread(everything)
         else
                 echo 'No more messages.'
         endif