Merge ~pfsmorigo/ubuntu-cve-tracker:cve.vim_add_functions into ubuntu-cve-tracker:master

Proposed by Paulo Flabiano Smorigo
Status: Merged
Merged at revision: ce73461687e6d2fdb251287ed06c15d5ba80044f
Proposed branch: ~pfsmorigo/ubuntu-cve-tracker:cve.vim_add_functions
Merge into: ubuntu-cve-tracker:master
Diff against target: 39 lines (+29/-0)
1 file modified
scripts/cve.vim (+29/-0)
Reviewer Review Type Date Requested Status
Steve Beattie Approve
Eduardo Barretto Approve
Review via email: mp+461549@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Eduardo Barretto (ebarretto) wrote :

lgtm, thanks

review: Approve
Revision history for this message
Steve Beattie (sbeattie) wrote :

Also lgtm, too. Would it be useful to have a mapping for <leader>n to set the priority to negligible?

If people don't like using `\` as the prfix key, use 'let mapleader=` in your vimrc to map it to a different character; I did

  let mapleader=","

to make the prefix character for custom macros match what I also define in mutt.

[Also, one recommendation for everybody to make reviewing easier, please at least copy the commit message or add a description of the change to the launchpad merge request, so that it shows up in the emails that get sent out, as the individual commit messages are not included with the attached diff in the emails.]

review: Approve
Revision history for this message
Paulo Flabiano Smorigo (pfsmorigo) wrote :

Ok. I didn't realise that the commit doesn't show in the PR email. I'll start adding them.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/cve.vim b/scripts/cve.vim
2index 5be4ed9..7ab42cb 100644
3--- a/scripts/cve.vim
4+++ b/scripts/cve.vim
5@@ -82,5 +82,34 @@ if version >= 508 || !exists("did_cve_syn_inits")
6 delcommand HiLink
7 endif
8
9+" Replace priority. You don't need to be in the priority line to run this code
10+function! cve#set_priority(priority)
11+ %s/^Priority: .*$/\='Priority: ' . a:priority/|''
12+endfunction
13+command! -bar Critical call cve#set_priority("critical")
14+command! -bar High call cve#set_priority("high")
15+command! -bar Medium call cve#set_priority("medium")
16+command! -bar Low call cve#set_priority("low")
17+command! -bar Negligible call cve#set_priority("negligible")
18+:map <leader>h :High<CR>
19+:map <leader>m :Medium<CR>
20+:map <leader>l :Low<CR>
21+
22+" Replace status for current line (maybe add support for selected lines)
23+function! cve#set_status(status)
24+ s/: .*$/\=': ' . a:status/
25+endfunction
26+command! -bar DNE call cve#set_status("DNE")
27+command! -bar Ignored call cve#set_status("ignored")
28+command! -bar IgnoredEndStandardSupport call cve#set_status("ignored (end of standard support)")
29+command! -bar IgnoredEndOfLife call cve#set_status("ignored (end of life)")
30+command! -bar Needed call cve#set_status("needed")
31+command! -bar NeedsTriage call cve#set_status("needs-triage")
32+command! -bar NotAffected call cve#set_status("not-affected")
33+command! -bar NotAffectedCodeNotPresent call cve#set_status("not-affected (code not present)")
34+:map <leader>1 :Needed<CR>
35+:map <leader>2 :NotAffected<CR>
36+:map <leader>3 :NotAffectedCodeNotPresent<CR>
37+
38 let b:current_syntax = "cve"
39 " vim: ts=8 sw=2

Subscribers

People subscribed via source and target branches