File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed
packages/cursorless-vscode/src/ide/vscode Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { getCellIndex } from "@cursorless/vscode-common";
22import {
33 commands ,
44 NotebookDocument ,
5+ TabInputTextDiff ,
56 TextEditor ,
67 ViewColumn ,
78 window ,
@@ -58,12 +59,15 @@ function getViewColumn(editor: TextEditor): ViewColumn | undefined {
5859 }
5960 const uri = editor . document . uri . toString ( ) ;
6061 const tabGroup = window . tabGroups . all . find ( ( tabGroup ) =>
61- tabGroup . tabs . find (
62- ( tab : any ) =>
63- tab . input . uri ?. toString ( ) === uri ||
64- tab . input . original ?. toString ( ) === uri ||
65- tab . input . modified ?. toString ( ) === uri ,
66- ) ,
62+ tabGroup . tabs . find ( ( tab ) => {
63+ if ( tab . input instanceof TabInputTextDiff ) {
64+ return (
65+ tab . input . original . toString ( ) === uri ||
66+ tab . input . modified . toString ( ) === uri
67+ ) ;
68+ }
69+ return ( tab as any ) . input ?. uri ?. toString ( ) === uri ;
70+ } ) ,
6771 ) ;
6872 return tabGroup ?. viewColumn ;
6973}
Original file line number Diff line number Diff line change 1- import { TextEditor , window } from "vscode" ;
1+ import { TabInputTextDiff , TextEditor , window } from "vscode" ;
22
33/**
44 * @param editor The editor to check
@@ -10,6 +10,10 @@ export function isDiffEditorOriginal(editor: TextEditor): boolean {
1010 }
1111 const uri = editor . document . uri . toString ( ) ;
1212 return window . tabGroups . all . some ( ( tabGroup ) =>
13- tabGroup . tabs . find ( ( tab : any ) => tab . input . original ?. toString ( ) === uri ) ,
13+ tabGroup . tabs . find (
14+ ( tab ) =>
15+ tab . input instanceof TabInputTextDiff &&
16+ tab . input . original . toString ( ) === uri ,
17+ ) ,
1418 ) ;
1519}
You can’t perform that action at this time.
0 commit comments