Permalink
Browse files

handle cedit option gracefully

  • Loading branch information...
1 parent 647aa7f commit 8138aef6f216ff497027a6bd7e167780393bc578 @chrisbra committed Mar 19, 2013
Showing with 9 additions and 3 deletions.
  1. +9 −3 autoload/ftimproved.vim
View
12 autoload/ftimproved.vim
@@ -1,6 +1,6 @@
" ftimproved.vim - Better f/t command for Vim
" -------------------------------------------------------------
-" Version: 0.5
+" Version: 0.6
" Maintainer: Christian Brabandt <cb@256bit.org>
" Last Change: Sat, 16 Feb 2013 23:21:31 +0100
"
@@ -218,8 +218,12 @@ fun! ftimproved#FTCommand(f, fwd, mode) "{{{1
if get(g:, "ft_improved_multichars", 0)
call <sid>HighlightMatch(char, a:fwd)
let next = getchar()
- while !empty(next) && ( next >= 0x20 ||
- \ ( len(next) == 3 && next[1] == 'k' && next[2] =='b'))
+ " break on Enter, Esc or Backspace
+ while !empty(next) && ((
+ \ next != 13 &&
+ \ next != 10 &&
+ \ next != 27) ||
+ \ len(next) == 3 && next[1] == 'k' && next[2] =='b')
" There seems to be a bug, when <bs> is pressed, next should be
" equal to €kb but it isn't,
" therefore, this ugly workaround is needed....
@@ -325,6 +329,8 @@ fun! ftimproved#FTCommand(f, fwd, mode) "{{{1
if <sid>CheckSearchWrap(pat, a:fwd, cnt)
let res = s:escape
endif
+ " handle 'cedit' key gracefully
+ let res = substitute(res, &cedit, ''.&cedit, '')
" save pattern for ';' and ','
call <sid>ColonPattern(cmd, pat,

0 comments on commit 8138aef

Please sign in to comment.