Skip to content

Commit

Permalink
Copy to clipboard on yank op
Browse files Browse the repository at this point in the history
  • Loading branch information
mbozhilov-qb committed Mar 11, 2025
1 parent 4be1577 commit 8dbb91c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/actions/operator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Register, RegisterMode } from './../register/register';
import { VimState } from './../state/vimState';
import { TextEditor } from './../textEditor';
import { BaseAction, RegisterAction } from './base';
import { Clipboard } from '../../src/util/clipboard';

export abstract class BaseOperator extends BaseAction {
override actionType = 'operator' as const;
Expand Down Expand Up @@ -253,6 +254,8 @@ export class YankOperator extends BaseOperator {

await vimState.setCurrentMode(Mode.Normal);

await Clipboard.Copy(text);

const numLinesYanked = text.split('\n').length;
reportLinesYanked(numLinesYanked, vimState);
}
Expand Down

0 comments on commit 8dbb91c

Please sign in to comment.