Skip to content

Commit 054f10f

Browse files
committed
More wisely space detection
1 parent 327bf13 commit 054f10f

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

autoload/eft/index.vim

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ function! eft#index#camel(state, text, index) abort
1111
endfunction
1212

1313
function! eft#index#symbol(state, text, index) abort
14-
return a:text[a:index] =~# '\A'
14+
return a:text[a:index] !~# '\s' && a:text[a:index] =~# '\A'
15+
endfunction
16+
17+
function! eft#index#space(state, text, index) abort
18+
return a:text[a:index - 1] !~# '\s' && a:text[a:index] =~# '\s'
1519
endfunction
1620

doc/eft.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ VARIABLE *eft-variable*
4848
2. `EftSubChar`
4949

5050
>
51-
let g:eft_index_function = { 'head': ..., 'tail': ..., 'camel': ..., 'symbol': ... }
51+
let g:eft_index_function = { 'head': ..., 'tail': ..., 'camel': ..., 'space': ..., 'symbol': ... }
5252
<
5353

5454
Specify function that detects jumpable index.

plugin/eft.vim

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ let g:eft_index_function = get(g:, 'eft_index_function', {
99
\ 'head': function('eft#index#head'),
1010
\ 'tail': function('eft#index#tail'),
1111
\ 'camel': function('eft#index#camel'),
12+
\ 'space': function('eft#index#space'),
1213
\ 'symbol': function('eft#index#symbol'),
1314
\ })
1415

0 commit comments

Comments
 (0)