Important: I fixed this bug as a byproduct of trying to fix some cw edge cases in
#69, just wanted to open an issue to link to when I send a PR
For d, there's handling for this case:
dw
becomes:
and not:
Handling:
|
" dw at the end of a line should not consume the newline or leading white |
|
" space on the next line |
|
let l:is_dw = a:mode == 'o' && v:operator == 'd' && l:flags == '' |
|
let l:next_line = l:pos[1] < getpos('.')[1] |
|
if l:is_dw && l:next_line |
|
let l:s = a:uppercase ? s:us : s:s |
|
" newline, leading whitespace, cursor |
|
if search('\m\n\%('.l:s.'\)*\%#', 'bW') != 0 |
|
let l:dwpos = getpos('.') |
|
" need to make range inclusive |
|
call setpos('.', l:pos) |
|
normal! v |
|
call setpos('.', l:dwpos) |
|
endif |
|
endif |
Bug: this needs to be handled for every operator, with the most obvious example being y
ywp
Expected:
Got:
fooo
^
(4 leading whitespace)
bar
With mini.surround
saw)
Expected:
Got:
It looks safe to say that every operator should be included in the handling of this edge
case, it's just that cw has its slight differences, but that doesn't matter for this.
Important: I fixed this bug as a byproduct of trying to fix some
cwedge cases in#69, just wanted to open an issue to link to when I send a PR
For
d, there's handling for this case:dwbecomes:
and not:
Handling:
vim-wordmotion/autoload/wordmotion.vim
Lines 127 to 141 in 81d9bd2
Bug: this needs to be handled for every operator, with the most obvious example being
yywpExpected:
Got:
With
mini.surroundsaw)Expected:
Got:
It looks safe to say that every operator should be included in the handling of this edge
case, it's just that
cwhas its slight differences, but that doesn't matter for this.