aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChronial <git@chronial.de>2015-05-17 14:01:43 +0200
committerChronial <git@chronial.de>2015-05-17 14:01:43 +0200
commit51907d68b965fc8cc25c44822f414389ffd1d18b (patch)
tree42c88e4279799bbb2d00a8201b81e33c9580330d
parentd794fabe4669d37c97aec57b20708ca5aa2fcb54 (diff)
handle nomagic beeing set
-rw-r--r--autoload/camelcasemotion.vim4
1 files changed, 2 insertions, 2 deletions
diff --git a/autoload/camelcasemotion.vim b/autoload/camelcasemotion.vim
index d8a5696..ef4929c 100644
--- a/autoload/camelcasemotion.vim
+++ b/autoload/camelcasemotion.vim
@@ -32,7 +32,7 @@ function! s:Move( direction, count, mode )
"call search( '\>\|\(\a\|\d\)\+\ze_', 'We' )
" end of ...
" number | ACRONYM followed by CamelCase or number | CamelCase | underscore_notation | non-keyword | word
- call search( '\d\+\|\u\+\ze\%(\u\l\|\d\)\|\l\+\ze\%(\u\|\d\)\|\u\l\+\|\%(\a\|\d\)\+\ze[-_]\|\%(\k\@!\S\)\+\|\%([-_]\@!\k\)\+\>', 'We' )
+ call search( '\m\d\+\|\u\+\ze\%(\u\l\|\d\)\|\l\+\ze\%(\u\|\d\)\|\u\l\+\|\%(\a\|\d\)\+\ze[-_]\|\%(\k\@!\S\)\+\|\%([-_]\@!\k\)\+\>', 'We' )
" Note: word must be defined as '\k\>'; '\>' on its own somehow
" dominates over the previous branch. Plus, \k must exclude the
" underscore, or a trailing one will be incorrectly moved over:
@@ -74,7 +74,7 @@ function! s:Move( direction, count, mode )
"call search( '\<\|\u\(\l\+\|\u\+\ze\u\)\|\d\+\|_\zs\(\a\|\d\)\+', 'W' . l:direction )
" beginning of ...
" word | empty line | non-keyword after whitespaces | non-whitespace after word | number | lowercase folowed by capital letter or number | ACRONYM followed by CamelCase or number | CamelCase | ACRONYM | underscore followed by ACRONYM, Camel, lowercase or number
- call search( '\<\D\|^$\|\%(^\|\s\)\+\zs\k\@!\S\|\>\<\|\d\+\|\l\+\zs\%(\u\|\d\)\|\u\+\zs\%(\u\l\|\d\)\|\u\l\+\|\u\@<!\u\+\|[-_]\zs\%(\u\+\|\u\l\+\|\l\+\|\d\+\)', 'W' . l:direction)
+ call search( '\m\<\D\|^$\|\%(^\|\s\)\+\zs\k\@!\S\|\>\<\|\d\+\|\l\+\zs\%(\u\|\d\)\|\u\+\zs\%(\u\l\|\d\)\|\u\l\+\|\u\@<!\u\+\|[-_]\zs\%(\u\+\|\u\l\+\|\l\+\|\d\+\)', 'W' . l:direction)
" Note: word must be defined as '\<\D' to avoid that a word like
" 1234Test is moved over as [1][2]34[T]est instead of [1]234[T]est
" because \< matches with zero width, and \d\+ will then start