mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-09-11 12:25:59 +03:00
Fix #798.
This commit is contained in:
parent
d89398a18d
commit
bb7af6e9da
@ -2803,11 +2803,13 @@ export class MoveWordBegin extends BaseMovement {
|
||||
|
||||
public async execAction(position: Position, vimState: VimState): Promise<Position> {
|
||||
if (vimState.recordedState.operator instanceof ChangeOperator) {
|
||||
|
||||
if (TextEditor.getLineAt(position).text.length < 1) {
|
||||
return position;
|
||||
}
|
||||
|
||||
const line = TextEditor.getLineAt(position).text;
|
||||
const char = line[position.character];
|
||||
|
||||
/*
|
||||
From the Vim manual:
|
||||
|
||||
@ -2815,7 +2817,12 @@ export class MoveWordBegin extends BaseMovement {
|
||||
on a non-blank. This is because "cw" is interpreted as change-word, and a
|
||||
word does not include the following white space.
|
||||
*/
|
||||
return position.getCurrentWordEnd(true).getRight();
|
||||
|
||||
if (" \t".indexOf(char) >= 0) {
|
||||
return position.getWordRight();
|
||||
} else {
|
||||
return position.getCurrentWordEnd(true).getRight();
|
||||
}
|
||||
} else {
|
||||
return position.getWordRight();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user