From 9d2d71a14650bdbeb94aeda6d0ba86a95c722257 Mon Sep 17 00:00:00 2001 From: Platzer Date: Tue, 10 Jan 2017 01:52:02 +0100 Subject: [PATCH] fixes #1214 (#1217) --- src/actions/actions.ts | 2 +- src/register/register.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/actions/actions.ts b/src/actions/actions.ts index 70217f168d9..f30cf88d0cf 100644 --- a/src/actions/actions.ts +++ b/src/actions/actions.ts @@ -2703,7 +2703,7 @@ class CommandDeleteToLineEnd extends BaseCommand { } @RegisterAction -class CommandYankFullLine extends BaseCommand { +export class CommandYankFullLine extends BaseCommand { modes = [ModeName.Normal]; keys = ["Y"]; diff --git a/src/register/register.ts b/src/register/register.ts index 147836b57d1..fa5d852d9da 100644 --- a/src/register/register.ts +++ b/src/register/register.ts @@ -1,6 +1,6 @@ import { VimState, RecordedState } from './../mode/modeHandler'; import * as clipboard from 'copy-paste'; -import { YankOperator, BaseOperator, CommandRegister, DeleteOperator } from './../actions/actions'; +import { YankOperator, CommandYankFullLine, BaseOperator, BaseCommand, CommandRegister, DeleteOperator } from './../actions/actions'; import * as vscode from "vscode"; /** @@ -261,10 +261,11 @@ export class Register { private static ProcessNumberedRegister(content: RegisterContent, vimState: VimState): void { // Find the BaseOperator of the current actions const baseOperator = vimState.recordedState.actionsRun.find( (value) => { - return value instanceof BaseOperator; + return value instanceof BaseOperator || + value instanceof BaseCommand; }); - if (baseOperator instanceof YankOperator) { + if (baseOperator instanceof YankOperator || baseOperator instanceof CommandYankFullLine) { // 'yank' to 0 only if no register was specified const registerCommand = vimState.recordedState.actionsRun.find( (value) => { return value instanceof CommandRegister;