@@ -518,16 +518,16 @@ export class JoinLinesAction extends EditorAction {
518518
519519 public run ( accessor : ServicesAccessor , editor : ICommonCodeEditor ) : void {
520520 let selections = editor . getSelections ( ) ;
521- let primarySelection = editor . getSelection ( ) ;
521+ let primaryCursor = editor . getSelection ( ) ;
522522
523523 selections . sort ( Range . compareRangesUsingStarts ) ;
524524 let reducedSelections : Selection [ ] = [ ] ;
525525
526526 let lastSelection = selections . reduce ( ( previousValue , currentValue ) => {
527527 if ( previousValue . isEmpty ( ) ) {
528528 if ( previousValue . endLineNumber === currentValue . startLineNumber ) {
529- if ( primarySelection . equalsSelection ( previousValue ) ) {
530- primarySelection = currentValue ;
529+ if ( primaryCursor . equalsSelection ( previousValue ) ) {
530+ primaryCursor = currentValue ;
531531 }
532532 return currentValue ;
533533 }
@@ -553,7 +553,7 @@ export class JoinLinesAction extends EditorAction {
553553 let model = editor . getModel ( ) ;
554554 let edits = [ ] ;
555555 let endCursorState = [ ] ;
556- let resultPrimarySelection = primarySelection ;
556+ let endPrimaryCursor = primaryCursor ;
557557 let lineOffset = 0 ;
558558
559559 for ( let i = 0 , len = reducedSelections . length ; i < len ; i ++ ) {
@@ -632,8 +632,8 @@ export class JoinLinesAction extends EditorAction {
632632 }
633633 }
634634
635- if ( Range . intersectRanges ( deleteSelection , primarySelection ) !== null ) {
636- resultPrimarySelection = resultSelection ;
635+ if ( Range . intersectRanges ( deleteSelection , primaryCursor ) !== null ) {
636+ endPrimaryCursor = resultSelection ;
637637 } else {
638638 endCursorState . push ( resultSelection ) ;
639639 }
@@ -642,7 +642,7 @@ export class JoinLinesAction extends EditorAction {
642642 lineOffset += deleteSelection . endLineNumber - deleteSelection . startLineNumber ;
643643 }
644644
645- endCursorState . unshift ( resultPrimarySelection ) ;
645+ endCursorState . unshift ( endPrimaryCursor ) ;
646646 editor . executeEdits ( this . id , edits , endCursorState ) ;
647647
648648 }
0 commit comments