Skip to content

Commit 07dfa8b

Browse files
committed
Add comments and highlights to jump motion but not editor
1 parent 1188cc2 commit 07dfa8b

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

autoload/criticmarkup.vim

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,24 @@ function! criticmarkup#Critic(args)
7575
endif
7676
endfunction
7777

78-
function! criticmarkup#JumpNext()
79-
exe "normal ".v:count1."/{[-+\\~]\{2}\<CR>"
78+
function! criticmarkup#JumpNext(editorial)
79+
if a:editorial == 1
80+
exe "normal ".v:count1."/{[-+\\~]\{2}\<CR>"
81+
else
82+
exe "normal ".v:count1."/{[-+\\~\>=]\{2}\<CR>"
83+
endif
8084
endfunction
8185

82-
function! criticmarkup#JumpPrevious()
83-
exe "normal ".v:count1."?{[-+\\~]\{2}\<CR>"
86+
function! criticmarkup#JumpPrevious(editorial)
87+
if a:editorial == 1
88+
exe "normal ".v:count1."?{[-+\\~]\{2}\<CR>"
89+
else
90+
exe "normal ".v:count1."?{[-+\\~\>=]\{2}\<CR>"
91+
endif
8492
endfunction
8593

8694
function! criticmarkup#CriticNext()
87-
call criticmarkup#JumpNext()
95+
call criticmarkup#JumpNext(1)
8896
let op = input("What to do? ", "", "custom,criticmarkup#CriticCompleteFunc")
8997
if op =~ "accept"
9098
call criticmarkup#Accept()
@@ -101,5 +109,5 @@ function! criticmarkup#CriticCompleteFunc(a, c, p)
101109
endif
102110
endfunction
103111

104-
nmap ]m :call criticmarkup#JumpNext()<CR>
105-
nmap [m :call criticmarkup#JumpPrevious()<CR>
112+
nmap ]m :call criticmarkup#JumpNext(0)<CR>
113+
nmap [m :call criticmarkup#JumpPrevious(0)<CR>

0 commit comments

Comments
 (0)