Open staticshock opened 9 years ago
I had the same issue. Disabling CamelCaseMotion (per https://github.com/terryma/vim-expand-region/issues/3) resolved this issue for me – expand selection now always expands selection. If you happen to have CamelCaseMotion installed, try disabling it.
It seems like 'iW/iw'
and e.g. 'i]'
are conflicting rules in phrases like [ [a: 1] ]
, so when the cursor is on a
you could expand like [a:
(encased by spaces, i.e. word) or like a: 1
(encased by []
).
Removing the iW/iw rules in g:expand_region_text_objects helped for me. E.g.
let g:expand_region_text_objects = {
\ 'i"' :0,
\ 'i''' :0,
\ 'i]' :1,
\ 'ib' :1,
\ 'iB' :1,
\ 'il' :0,
\ 'ip' :0,
\ 'ie' :0,
\ }
I saw a report of something similar (#3) but I'll open this separately anyway, since the other one is closed.
Here are some issues I'm seeing, using this code as an example:
winrestview
,viw+
does not grow the selection beyond the initial word. If, however, the cursor is after the first character,viw+
seems to grow the selection. I can only reproduce this ~90% of the time, so it seems that there's some sort of a race going on.winrestview(
, hitting+
actually shrinks the selection.