Skip to content

Commit

Permalink
Add support for custom (non-default) text objects. Possible fix for #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Giacomo Comitti committed Feb 17, 2014
1 parent 2011f2e commit 520da8f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugin/wildfire.vim
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fu! s:SelectBiggerBlock(repeat)
for object in keys(s:objects)

let selection = "v" . s:objects[object] . object
exe "sil! norm! \<ESC>v\<ESC>" . selection . "\<ESC>"
exe "sil! norm \<ESC>v\<ESC>" . selection . "\<ESC>"
let [startline, startcol, endline, endcol] = s:get_visual_block_edges()

cal winrestview(winview)
Expand Down Expand Up @@ -122,7 +122,7 @@ fu! s:SelectSmallerBlock()
if len(s:winners_history) > 1
let last_winner = remove(s:winners_history, -1)[0]
let s:objects[matchstr(last_winner, "\\D\\+$")] -= 1
exe "sil! norm! \<ESC>" . get(s:winners_history, -1)[0]
exe "sil! norm \<ESC>" . get(s:winners_history, -1)[0]
endif
endfu

Expand All @@ -133,13 +133,13 @@ fu! s:SelectBestBlock(candidates)
let [startcol, endcol] = [a:candidates[minsize], a:candidates[minsize]]
let s:winners_history = add(s:winners_history, [winner, minsize])
let s:objects[matchstr(winner, "\\D\\+$")] += 1
exe "sil! norm! \<ESC>" . winner
exe "sil! norm \<ESC>" . winner
elseif len(s:winners_history)
" get stuck on the last selection
exe "sil! norm! \<ESC>" . get(s:winners_history, -1)[0]
exe "sil! norm \<ESC>" . get(s:winners_history, -1)[0]
else
" do nothing
exe "sil! norm! \<ESC>"
exe "sil! norm \<ESC>"
endif
endfu

Expand Down

0 comments on commit 520da8f

Please sign in to comment.