Skip to content

Commit

Permalink
Merge branch 'dev': Bump up version to 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
haya14busa committed May 3, 2015
2 parents 3c8ee37 + 8544265 commit 1ed6367
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
9 changes: 6 additions & 3 deletions autoload/incsearch.vim
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,18 @@ function! s:pattern_saver.on_enter(cmdline) abort
if ! g:incsearch#no_inc_hlsearch
let self.pattern = @/
let self.hlsearch = &hlsearch
set hlsearch | nohlsearch
if exists('v:hlsearch')
let self.vhlsearch = v:hlsearch
endif
set hlsearch | nohlsearch
endif
endfunction
function! s:pattern_saver.on_leave(cmdline) abort
if ! g:incsearch#no_inc_hlsearch && a:cmdline.exit_code()
let @/ = self.pattern
if ! g:incsearch#no_inc_hlsearch
let is_cancel = a:cmdline.exit_code()
if is_cancel
let @/ = self.pattern
endif
let &hlsearch = self.hlsearch
if exists('v:hlsearch')
let v:hlsearch = self.vhlsearch
Expand Down
5 changes: 4 additions & 1 deletion doc/incsearch.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*incsearch.txt* Incrementally highlight all pattern matches

Author : haya14busa <hayabusa1419@gmail.com>
Version : 1.0.2
Version : 1.0.3
License : MIT license {{{

Copyright (c) 2014-2015 haya14busa
Expand Down Expand Up @@ -387,6 +387,9 @@ Version 2.0(?) Roadmap~
3. More configurable options
- e.g. option for prompt format including right prompt feature

1.0.3 2015-05-03
1. Fix 'hlsearch' handling #74

1.0.2 2015-04-16
1. Implement experimental API (undocumented) to access vital-over
command line object
Expand Down
1 change: 0 additions & 1 deletion test/.themisrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ call themis#helper('command').with(themis#helper('assert')).with({'Expect': g:Ex

language C


" Helper Functions:

function! AddLine(str)
Expand Down
13 changes: 13 additions & 0 deletions test/cancel.vim
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,16 @@ function! s:suite.default_highlight_will_not_remain()
set hlsearch& | nohlsearch
endfunction

function! s:suite.preserve_vhlsearch_with_esc()
if !exists('v:hlsearch')
call s:assert.skip("Skip because vim version are too low to test it")
endif
set hlsearch
for keyseq in ['/', '?', 'g/']
let v:hlsearch = 1
exec "normal" keyseq . "pattern\<Esc>"
call s:assert.equals(v:hlsearch, 1)
endfor
set hlsearch& | nohlsearch
endfunction

15 changes: 14 additions & 1 deletion test/highlight.vim
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ function! s:suite.hlsearch()
if !exists('v:hlsearch')
call s:assert.skip("Skip because vim version are too low to test it")
endif
" FIXME:
set hlsearch
" FIXME: <- why...???
for keyseq in ['/', '?', 'g/']
nohlsearch
call s:assert.equals(v:hlsearch, 0)
Expand All @@ -55,6 +56,18 @@ function! s:suite.hlsearch()
call s:assert.equals(v:hlsearch, 0)
exec "normal!" "hl" | " dummy
call s:assert.equals(v:hlsearch, 0)
set hlsearch&
endfunction

function! s:suite.preserve_nohlsearch() abort
for keyseq in ['/', '?', 'g/']
set nohlsearch
nohlsearch
call s:assert.equals(&hlsearch, 0)
exec "normal" keyseq . "pattern\<CR>"
call s:assert.equals(&hlsearch, 0)
endfor
set hlsearch&
endfunction

function! s:suite.incremental_highlight()
Expand Down

0 comments on commit 1ed6367

Please sign in to comment.