Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #739 #767

Merged
merged 3 commits into from
Sep 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/actions/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1344,10 +1344,11 @@ export class ChangeOperator extends BaseOperator {

// If we delete to EOL, the block cursor would end on the final character,
// which means the insert cursor would be one to the left of the end of
// the line.
if (Position.getLineLength(TextEditor.getLineAt(start).lineNumber) !== 0) {
// the line. We do want to run delete if it is a multiline change though ex. c}
if (Position.getLineLength(TextEditor.getLineAt(start).lineNumber) !== 0 || (end.line !== start.line)) {
state = await new DeleteOperator().run(vimState, start, end);
}

state.currentMode = ModeName.Insert;

if (isEndOfLine) {
Expand Down Expand Up @@ -2667,6 +2668,10 @@ 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;
}

/*
From the Vim manual:

Expand Down