mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
vim: refactor get_message_for_line out of show_message_id
This commit is contained in:
parent
898b173a18
commit
329f95eb77
1 changed files with 14 additions and 11 deletions
|
@ -517,23 +517,26 @@ endfunction
|
||||||
|
|
||||||
" --- --- show screen helper functions {{{2
|
" --- --- show screen helper functions {{{2
|
||||||
|
|
||||||
|
function! s:NM_show_get_message_for_line(line)
|
||||||
|
for msg in b:nm_raw_info['msgs']
|
||||||
|
if a:line > msg['end']
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
return msg
|
||||||
|
endfor
|
||||||
|
return {}
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:NM_show_message_id()
|
function! s:NM_show_message_id()
|
||||||
if !exists('b:nm_raw_info')
|
if !exists('b:nm_raw_info')
|
||||||
echoe 'no b:nm_raw_info'
|
echoe 'no b:nm_raw_info'
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
let info = b:nm_raw_info
|
let msg = <SID>NM_show_get_message_for_line(line('.'))
|
||||||
let lnum = line('.')
|
|
||||||
for msg in info['msgs']
|
|
||||||
if lnum > msg['end']
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
if has_key(msg,'id')
|
if has_key(msg,'id')
|
||||||
return msg['id']
|
return msg['id']
|
||||||
endif
|
endif
|
||||||
return ''
|
return ''
|
||||||
endfor
|
|
||||||
return ''
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:NM_show_search_words()
|
function! s:NM_show_search_words()
|
||||||
|
|
Loading…
Reference in a new issue