Skip to content

Commit

Permalink
fix small errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbra committed Mar 10, 2013
1 parent 63bdc03 commit efa17ca
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions autoload/ftimproved.vim
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -91,10 +91,16 @@ fun! <sid>HighlightMatch(char) "{{{1
if exists("s:matchid") if exists("s:matchid")
sil! call matchdelete(s:matchid) sil! call matchdelete(s:matchid)
endif endif
let output=''
if !empty(a:char) if !empty(a:char)
let output = matchstr(a:char, '^\%(\\c\)\?\\V\zs.*')
let s:matchid = matchadd('IncSearch', a:char) let s:matchid = matchadd('IncSearch', a:char)
endif endif
redraw redraw!
" Output input string after(!) redraw.
if !empty(output)
exe ':echon '. string(output)
endif
endfu endfu
fun! ftimproved#ColonCommand(f, mode) "{{{1 fun! ftimproved#ColonCommand(f, mode) "{{{1
" should be a noop " should be a noop
Expand Down Expand Up @@ -191,11 +197,12 @@ fun! ftimproved#FTCommand(f, fwd, mode) "{{{1
" Get next character " Get next character
let next = getchar() let next = getchar()
endw endw
if next == s:escape if nr2char(next) == s:escape
" abort when Escape has been hit " abort when Escape has been hit
return s:escape return s:escape
endif endif
endif endif
let oldsearchpat = @/
let no_offset = 0 let no_offset = 0
let cmd = (a:fwd ? '/' : '?') let cmd = (a:fwd ? '/' : '?')
let pat = char let pat = char
Expand Down Expand Up @@ -280,7 +287,8 @@ fun! ftimproved#FTCommand(f, fwd, mode) "{{{1


let pat = pat1 let pat = pat1
call <sid>DebugOutput(res) call <sid>DebugOutput(res)
return res ":call histdel('/', -1)\n" return res. ":call histdel('/', -1)\n:let @/='".oldsearchpat."'\n"
"return res. ":let @/='".oldsearchpat."'\n"
finally finally
call <sid>HighlightMatch('') call <sid>HighlightMatch('')
endtry endtry
Expand Down

0 comments on commit efa17ca

Please sign in to comment.