carlthome/vscode-git-line-blame

Popup error notification when opening git changes editor window

serg3295 opened this issue ยท 3 comments

Reproduce:
Timeline -> right click on a file 'Open Changes' ->
blame_err1

@carlthome, apparently I introduced this one.

Reverting the following should fix it with no visible issue ๐Ÿคž.

if (activeEditor === undefined || activeEditor !== e.textEditor) {
      vscode.window.showErrorMessage("No active text editor or incorrect one");
      return;
    }

Thanks for raising this @serg3295! ๐Ÿฅ‡

And thanks for pointing to a fix @dereli! ๐Ÿ‘

I've been a bit confused as to how one can access the editor within the event handler.

Since both vscode.window.onDidChangeTextEditorSelection and vscode.window.onDidChangeTextEditorVisibleRanges receive a TextEditor, it's easier to avoid accessing vscode.window.activeTextEditor in the event handler. Fix incoming: #31

Thanks!