aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Le <solnovus@gmail.com>2015-05-12 19:04:27 -0700
committerKevin Le <solnovus@gmail.com>2015-05-12 19:04:27 -0700
commitd794fabe4669d37c97aec57b20708ca5aa2fcb54 (patch)
tree4ccfdaeaef2a92548853353da32c505d2ed1fea3
parent89940cc381fb3df1ab0b8f0305309e758da148d2 (diff)
fix an issue with movement through words like 'lowercaseCAPS'
-rw-r--r--autoload/camelcasemotion.vim4
1 files changed, 2 insertions, 2 deletions
diff --git a/autoload/camelcasemotion.vim b/autoload/camelcasemotion.vim
index 7816ef7..d8a5696 100644
--- a/autoload/camelcasemotion.vim
+++ b/autoload/camelcasemotion.vim
@@ -73,8 +73,8 @@ function! s:Move( direction, count, mode )
"call search( '\<\|\u\(\l\+\|\u\+\ze\u\)\|\d\+', 'W' . l:direction )
"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 | ACRONYM followed by CamelCase or number | CamelCase | ACRONYM | underscore followed by ACRONYM, Camel, lowercase or number
- call search( '\<\D\|^$\|\%(^\|\s\)\+\zs\k\@!\S\|\>\<\|\d\+\|\u\+\zs\%(\u\l\|\d\)\|\u\l\+\|\u\@<!\u\+\|[-_]\zs\%(\u\+\|\u\l\+\|\l\+\|\d\+\)', 'W' . l:direction )
+ " 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)
" 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