File tree Expand file tree Collapse file tree 3 files changed +14
-18
lines changed Expand file tree Collapse file tree 3 files changed +14
-18
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { isLiteralMode, unmapLiteral } from '../configuration/langmap';
1111export abstract class BaseAction implements IBaseAction {
1212 abstract readonly actionType : ActionType ;
1313
14- public name = '' ;
14+ public readonly name : string | undefined ;
1515
1616 /**
1717 * If true, the cursor position will be added to the jump list on completion.
@@ -204,14 +204,12 @@ export abstract class BaseCommand extends BaseAction {
204204
205205 const resultingCursors : Cursor [ ] = [ ] ;
206206
207- const cursorsToIterateOver = vimState . cursors
208- . map ( ( x ) => new Cursor ( x . start , x . stop ) )
209- . sort ( ( a , b ) =>
210- a . start . line > b . start . line ||
211- ( a . start . line === b . start . line && a . start . character > b . start . character )
212- ? 1
213- : - 1 ,
214- ) ;
207+ const cursorsToIterateOver = [ ...vimState . cursors ] . sort ( ( a , b ) =>
208+ a . start . line > b . start . line ||
209+ ( a . start . line === b . start . line && a . start . character > b . start . character )
210+ ? 1
211+ : - 1 ,
212+ ) ;
215213
216214 let cursorIndex = 0 ;
217215 for ( const { start, stop } of cursorsToIterateOver ) {
Original file line number Diff line number Diff line change @@ -114,14 +114,12 @@ class ActionJoin extends BaseCommand {
114114 }
115115
116116 public override async execCount ( position : Position , vimState : VimState ) : Promise < void > {
117- const cursorsToIterateOver = vimState . cursors
118- . map ( ( x ) => new Cursor ( x . start , x . stop ) )
119- . sort ( ( a , b ) =>
120- a . start . line > b . start . line ||
121- ( a . start . line === b . start . line && a . start . character > b . start . character )
122- ? 1
123- : - 1 ,
124- ) ;
117+ const cursorsToIterateOver = [ ...vimState . cursors ] . sort ( ( a , b ) =>
118+ a . start . line > b . start . line ||
119+ ( a . start . line === b . start . line && a . start . character > b . start . character )
120+ ? 1
121+ : - 1 ,
122+ ) ;
125123
126124 const resultingCursors : Cursor [ ] = [ ] ;
127125 for ( const [ idx , { start, stop } ] of cursorsToIterateOver . entries ( ) ) {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import type { VimState } from '../state/vimState';
44export type ActionType = 'command' | 'motion' | 'operator' | 'number' ;
55
66export interface IBaseAction {
7- name : string ;
7+ readonly name : string | undefined ;
88 readonly actionType : ActionType ;
99 readonly isJump : boolean ;
1010 readonly createsUndoPoint : boolean ;
You can’t perform that action at this time.
0 commit comments