Skip to content

Commit

Permalink
use BufReadPost instead of BufEnter to trigger conflict detection
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Nov 1, 2022
1 parent 3df8be7 commit 11a4d42
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/test_default.vimspec
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Describe Default settings
for l in range(1, len(lines))
call setline(l, lines[l-1])
endfor
doautocmd BufEnter
doautocmd BufReadPost

Assert NotEmpty(mapcheck(']x', 'n'))
Assert NotEmpty(mapcheck('[x', 'n'))
Expand Down
6 changes: 3 additions & 3 deletions test/test_hooks.vimspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Describe g:conflict_marker_hooks
It does nothing if does not have on_detected hook
let g:conflict_marker_hooks = {}
" Check exception is not thrown
doautocmd BufEnter
doautocmd BufReadPost
End

It execute on_detected hook specified by string
Expand All @@ -34,7 +34,7 @@ Describe g:conflict_marker_hooks
endfunction
let g:conflict_marker_hooks = {'on_detected' : 'TestHook'}

doautocmd BufEnter
doautocmd BufReadPost
Assert g:test_hooked
unlet g:test_hooked
End
Expand All @@ -46,7 +46,7 @@ Describe g:conflict_marker_hooks
let g:test_hooked = 1
endfunction

doautocmd BufEnter
doautocmd BufReadPost
Assert g:test_hooked
unlet g:test_hooked
End
Expand Down
4 changes: 2 additions & 2 deletions test/test_matchit.vimspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Describe matchit
for l in range(1, len(s:lines))
call setline(l, s:lines[l-1])
endfor
doautocmd BufEnter
doautocmd BufReadPost
End

After
Expand Down Expand Up @@ -57,7 +57,7 @@ Describe matchit with diff3
for l in range(1, len(s:lines_diff3))
call setline(l, s:lines_diff3[l-1])
endfor
doautocmd BufEnter
doautocmd BufReadPost
End

After
Expand Down
2 changes: 1 addition & 1 deletion test/test_resolve.vimspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function! s:load(lines)
for l in range(1, len(a:lines))
call setline(l, a:lines[l-1])
endfor
doautocmd BufEnter
doautocmd BufReadPost
endfunction

Describe :ConflictMarkerThemselves
Expand Down
6 changes: 3 additions & 3 deletions test/test_syntax.vimspec
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Describe Conflict marker
End

It is highlighted
doautocmd BufEnter
doautocmd BufReadPost
for l in [1, 8, 15]
Assert Equals(GetHighlight(l, 1), 'ConflictMarkerBegin')
Assert Equals(GetHighlight(l+1, 2), 'ConflictMarkerOurs')
Expand All @@ -48,7 +48,7 @@ Describe Conflict marker
endfor
End

It is not highlighted if no marker is detected at BufEnter
It is not highlighted if no marker is detected at BufReadPost
for l in [1, 8, 15]
Assert NotEquals(GetHighlight(l, 1), 'ConflictMarkerBegin')
Assert NotEquals(GetHighlight(l+1, 2), 'ConflictMarkerOurs')
Expand All @@ -69,7 +69,7 @@ Describe Conflict marker

It can disable detection (#18)
let g:conflict_marker_enable_detect = 0
doautocmd BufEnter
doautocmd BufReadPost
for l in [1, 8, 15]
Assert NotEquals(GetHighlight(l, 1), 'ConflictMarkerBegin')
Assert NotEquals(GetHighlight(l+1, 2), 'ConflictMarkerOurs')
Expand Down

0 comments on commit 11a4d42

Please sign in to comment.