Skip to content

Commit

Permalink
fix justinmk#27: multibyte highlighting!
Browse files Browse the repository at this point in the history
fix a (literal) edge case: matches near edge of screen were not
considered on-screen.
  • Loading branch information
justinmk committed Apr 10, 2014
1 parent 7ee6049 commit 07cfbd6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# sneak.vim :shoe:

Sneak is a minimalist, versatile Vim *motion* plugin that flies you to any location specified by two characters.
Sneak is a minimalist, versatile Vim *motion* plugin that jumps to any location specified by two characters.
It works with **multiple lines**, **operators** (including **repeat** `.`
and **[surround]**), **[keymaps]**, **visual mode**,
and **macros**. Many small details have been carefully considered to minimize
and **[surround]**), **[keymaps]**, **visual mode**, **[unicode]** ("multibyte"),
and **macros**. Many details have been carefully balanced to minimize
friction between *intent* and *action*.

The plugin chooses sane defaults, easily changed via `<Plug>` mappings
Expand All @@ -14,6 +14,7 @@ to [EasyMotion](https://github.com/Lokaltog/vim-easymotion):

let g:sneak#streak = 1

[unicode]: http://vimdoc.sourceforge.net/htmldoc/mbyte.html#UTF-8
[keymaps]: http://vimdoc.sourceforge.net/htmldoc/mbyte.html#mbyte-keymap
[surround]: https://github.com/tpope/vim-surround
[count]: http://vimdoc.sourceforge.net/htmldoc/intro.html#[count]
Expand Down
2 changes: 1 addition & 1 deletion autoload/sneak/search.vim
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func! sneak#search#new()
let wincol_lhs = a:w.leftcol "this is actually just to the _left_ of the first onscreen column.
let wincol_rhs = 2 + (winwidth(0) - sneak#util#wincol1()) + wincol_lhs
"restrict search to window
return '\%>'.(wincol_lhs).'c'.'\%<'.wincol_rhs.'c'
return '\%>'.(wincol_lhs).'v'.'\%<'.(wincol_rhs+1).'v'
endf

func! s.get_stopline()
Expand Down
3 changes: 1 addition & 2 deletions autoload/sneak/streak.vim
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ let g:sneak#target_labels = get(g:, 'sneak#target_labels', "asdfghjkl;qwertyuiop

func! s:placematch(c, pos)
let s:matchmap[a:c] = a:pos
"TODO: figure out why we must +1 the column...
exec "syntax match SneakStreakTarget '.\\%".a:pos[0]."l\\%".(a:pos[1]+1)."c' conceal cchar=".a:c
exec "syntax match SneakStreakTarget '\\%".a:pos[0]."l\\%".a:pos[1]."c.' conceal cchar=".a:c
endf

func! s:decorate_statusline() "highlight statusline to indicate streak-mode.
Expand Down

0 comments on commit 07cfbd6

Please sign in to comment.