Skip to content

Commit

Permalink
swap order of setTextDocumentLanguage and showTextDocument
Browse files Browse the repository at this point in the history
Think this was causing a subtle bug where the document would open as
plaintext before switching its type to "vsnetrw".

Reported in #20 as seeing line numbers flash for a second before the
extension specific settings were applied.
  • Loading branch information
danprince committed May 29, 2024
1 parent cbe534f commit a0af77a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ async function openExplorer(dirName) {

let uri = createUri(dirName);
let doc = await workspace.openTextDocument(uri);
await window.showTextDocument(doc, { preview: true });
await languages.setTextDocumentLanguage(doc, languageId);
await window.showTextDocument(doc, { preview: true });
moveCursorToPreviousFile();
}

Expand Down

0 comments on commit a0af77a

Please sign in to comment.