Skip to content

Commit ac80025

Browse files
Add option to disable second highlights
unblevable#53
1 parent 49b00ee commit ac80025

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

autoload/quick_scope.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function! s:apply_highlight_patterns(patterns) abort
161161
" Ignore the leading | in the primary highlights string.
162162
call matchadd(g:qs_hi_group_primary, '\v%' . line('.') . 'l(' . patt_p[1:] . ')', g:qs_hi_priority)
163163
endif
164-
if !empty(patt_s)
164+
if !empty(patt_s) && g:qs_second_highlight
165165
call matchadd(g:qs_hi_group_secondary, '\v%' . line('.') . 'l(' . patt_s[1:] . ')', g:qs_hi_priority)
166166
endif
167167
endfunction

doc/quick-scope.txt

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
*quick-scope.txt* Highlight unique character targets for f/F and t/T motions.
22
*quick-scope*
33

4-
Version: 2.5.4
4+
Version: 2.5.5
55
Homepage: https://github.com/unblevable/quick-scope
66
Authors: Brian Le (unblevable)
77
Bradford Smith (https://github.com/bradford-smith94)
@@ -167,6 +167,14 @@ the same effect on a specific buffer.
167167
let b:qs_local_disable=1
168168
<
169169

170+
*g:qs_second_hightlight*
171+
If you don't want the secondary highlight group to be used you can set
172+
`g:qs_second_hightlight` equal to zero and only first occurrences will be
173+
highlighted. (default `1`)
174+
>
175+
let g:qs_second_hightlight=0
176+
<
177+
170178
4.4 DISABLE ON LONG LINES *qs-disable-on-longlines*
171179
------------------------------------------------------------------------------
172180

@@ -243,6 +251,9 @@ http://github.com/unblevable/quick-scope/issues
243251

244252
Version Date Release Notes~
245253
|---------|-----------|-----------------------------------------------------------|
254+
2.5.5 2020-04-04 * added
255+
- Added option |g:qs_second_hightlight| to turn off
256+
secondary highlighting
246257
2.5.4 2020-03-17 * Fixed
247258
- Fixed issue with getchar() and n2char() regarding '<'
248259
2.5.3 2020-03-09 * Changed

plugin/quick_scope.vim

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ if !exists('g:qs_lazy_highlight')
3636
let g:qs_lazy_highlight = 0
3737
endif
3838

39+
if !exists('g:qs_second_highlight')
40+
let g:qs_second_highlight = 1
41+
endif
42+
3943
if !exists('g:qs_max_chars')
4044
" Disable on long lines for performance
4145
let g:qs_max_chars = 1000

0 commit comments

Comments
 (0)