Giter VIP home page Giter VIP logo

Comments (2)

leodevbro avatar leodevbro commented on September 22, 2024

Thank. I hope I will have time soon to try implementing this feature request.
Right now you can toggle disable/enable Blockman with F1 command:
>Blockman Toggle Enable/Disable
or
>Blockman Toggle Enable/Disable And Force Show/Hide Indent Guides

from vscode-blockman.

leodevbro avatar leodevbro commented on September 22, 2024

So far I found these solutions:

if (editor.document.uri.scheme === "git") {
    // this editor is the left side of the diff
}
const theUri = editor.document.uri.toString();

const trueOrFalse = window.tabGroups.all.some((tabGroup) =>
    tabGroup.tabs.some((tab) => {
        const tabInp: any = tab.input;

        return (
            tabInp?.modified?.toString() === theUri ||
            tabInp?.original?.toString() === theUri
        );
    }),
);

if (trueOrFalse) {
    // this editor has the document which is open in at least one diff editor
    // but this editor may not be the diff editor.
    // For example, maybe this editor is just a normal editor and this document is open in another editor which is diff editor.
}

Sources:
microsoft/vscode#36019
microsoft/vscode#15513

So, for now, we can detect the left side of diff editor, but I could not find a solution to detect the right side of diff editor. I mean, as you can see in the above code samples, we can detect that the editor has the document which is open in at least one diff editor, but we cannot be sure that this editor is the diff editor itself.

If you or anyone finds a solution for it, please let me know.

from vscode-blockman.

Related Issues (20)

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.