Giter Club home page Giter Club logo

Comments (4)

lwieckowski avatar lwieckowski commented on July 20, 2024 1

I can confirm it works now. Thanks for fixing this so quickly!

from vsnetrw.

danprince avatar danprince commented on July 20, 2024

Hey @lwieckowski 👋! Taking a look at this now.

I have line numbers disabled globally across vscode, so I'm afraid I wouldn't ever have caught this in development.

I can't explicitly remember doing anything specific to turn line numbers off as part of the extension, but it seems like I did add that to the package specific configuration here.

"editor.lineNumbers": "off",

Given that they appear then disappear, I wonder if vscode is reloading the package level config each time?

A quick test could be to add the following to your own settings.json and see whether that prevents the flashing?

"[vsnetrw]": {
  "editor.lineNumbers": "off"
}

It could also be the case that the extension mode isn't set initially, which causes the flash? In that case, I'm not sure what the workaround would be. It seems a little bit odd that there would be any time window where editor.lineNumbers was not "off".

If you get any more clues, do shout and I can look at what the fix might be.

from vsnetrw.

lwieckowski avatar lwieckowski commented on July 20, 2024

Hey @danprince, thanks for looking into it so quickly. Unfortunately, explicitly setting line numbers to off for vsnetrw in settings.jsondid not help. It seems these settings are set by default anyway (vscode suggested autocomplete).

It seems that vscode loads extension specific settings after the document has been loaded with the global settings.

What seems to work is to set line numbers to off globally, and then enable them for specific file types. I think this is good enough for me, there are not that many.

BTW, I love the extension, exactly what I've been looking for after not being able to use vim at work. Great job 👍

EDIT:
I just noticed that when a new directory is opened in vsnetrw, the file type briefly changes to plain text. Setting line numbers to off for plain text solves the issue. This way I can keep the line number enabled globally, and don't need to set them for different file types.

from vsnetrw.

danprince avatar danprince commented on July 20, 2024

BTW, I love the extension, exactly what I've been looking for after not being able to use vim at work. Great job 👍

🥳

Thanks for investigating! The plain text discovery was a great clue. It turns out the extension was setting the language type after showing the document. The order should be correct now.

vsnetrw/extension.js

Lines 118 to 122 in e5b5966

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

I've published that change in v0.3.2, so feel free to try it out and see if it fixes that problem without a need for the workaround.

from vsnetrw.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.