Skip to content

Commit

Permalink
Avoid unwanted behavior with text objects that cannot be nested. Fix #19
Browse files Browse the repository at this point in the history
  • Loading branch information
Giacomo Comitti committed Apr 27, 2014
1 parent 34a3930 commit 1f58950
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions autoload/wildfire.vim
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ endfor
" Internal variables
" =============================================================================

let s:cannot_be_nested = {"iw" : 1, "aw" : 1, "iW" : 1, "aW": 1}

let s:objects = [
\ "(", ")", "{", "}","[", "]", "<", ">", "b", "B",
\ "'", '"', "`", "t", "w", "W", "p", "s"]
Expand Down Expand Up @@ -101,6 +103,11 @@ fu! wildfire#_fuel()

cal winrestview(winview)

" Some text object cannot be nested. This avoids unwanted behavior.
if get(s:cannot_be_nested, to.object) && to.count > 1
continue
endif

" The selection failed with the candidate text object
if to.startline == to.endline && to.startcol == to.endcol
continue
Expand Down

0 comments on commit 1f58950

Please sign in to comment.