Skip to content

Commit 78457d4

Browse files
authored
Merge pull request #18 from MageJohn/master
'tildeop' breaks preserving the case of the small camel
2 parents 1af9cde + c63c5e7 commit 78457d4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

autoload/textobj/variable_segment.vim

+3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ function! s:select_a()
3838
if start_column - 2 <= word_start ||
3939
\ getline(start_line)[:start_column - 2] =~# '^_*$'
4040
call setpos('.', end_position)
41+
let l:tildeop = &tildeop
42+
set notildeop
4143
normal! l~
44+
let &tildeop = l:tildeop
4245
endif
4346
endif
4447

t/variable-segment.vim

+9
Original file line numberDiff line numberDiff line change
@@ -404,4 +404,13 @@ describe 'av'
404404
normal dav
405405
Expect getline(1) == 'foo bazQuux'
406406
end
407+
it 'selects leading small camels and swaps case even with tildeop'
408+
set tildeop " Vim default is notildeop
409+
put! = 'fooBarQuux'
410+
normal! 0
411+
normal dav
412+
Expect getline(1) == 'barQuux'
413+
Expect &tildeop == 1
414+
set notildeop
415+
end
407416
end

0 commit comments

Comments
 (0)