Skip to content

Commit

Permalink
fix comma is always prepended to b:match_words
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed May 20, 2024
1 parent b877faa commit 0b6710b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions plugin/conflict_marker.vim
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ function! s:set_conflict_marker_to_match_words()
return
endif

let b:match_words = get(b:, 'match_words', '')
\ . printf(',%s:%s:%s:%s',
\ g:conflict_marker_begin,
\ g:conflict_marker_common_ancestors,
\ g:conflict_marker_separator,
\ g:conflict_marker_end)
let group = printf('%s:%s:%s:%s',
\ g:conflict_marker_begin,
\ g:conflict_marker_common_ancestors,
\ g:conflict_marker_separator,
\ g:conflict_marker_end)

let b:match_words = exists('b:match_words') ? b:match_words . ',' . group : group
let b:conflict_marker_match_words_loaded = 1
endfunction

Expand Down
2 changes: 1 addition & 1 deletion test/test_matchit.vimspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Describe matchit

It defines b:match_words
Assert Exists('b:match_words')
Assert Equals(b:match_words, ',^<<<<<<<\+:^|||||||\+:^=======\+$:^>>>>>>>\+')
Assert Equals(b:match_words, '^<<<<<<<\+:^|||||||\+:^=======\+$:^>>>>>>>\+')
End

It can jump within a conflict marker
Expand Down

0 comments on commit 0b6710b

Please sign in to comment.