Giter Site home page Giter Site logo

Allow settings to stick about hotsettings HOT 8 CLOSED

justcla avatar justcla commented on July 30, 2024 1
Allow settings to stick

from hotsettings.

Comments (8)

justcla avatar justcla commented on July 30, 2024 1

Well I implemented the solution and it is released to the Visual Studio Marketplace as Hot Settings v1.6.0.

I went with the first option. I did not add any button.

I hope you like it!

Feel free to be say thanks by being a sponsor. 😊
https://github.com/sponsors/justcla

from hotsettings.

josephan avatar josephan commented on July 30, 2024

Yes please! That would make this extension perfect!
Currently the Lightbulb margin reappears when opening a new file.

One of your users posted this snippet (https://marketplace.visualstudio.com/items?itemName=JustinClareburtMSFT.HotSettings&ssr=false#qna):

[Export(typeof(IWpfTextViewCreationListener))]
[ContentType("text")]
[TextViewRole(PredefinedTextViewRoles.Document)]
internal class TestViewCreationListener : IWpfTextViewCreationListener
{
    public void TextViewCreated(IWpfTextView textView)
    {
        textView.Options.SetOptionValue("TextViewHost/SuggestionMargin", false);
    }
}

from hotsettings.

justcla avatar justcla commented on July 30, 2024

Thanks for bringing my attention to it.

Regarding the snippet above, I can't implement that into the base product because always defaulting to no lightbulb would not be the desired functionality for all users.

So, I would need to do what I suggested in a previous post, which is to store the setting in the user setting store and try to restore/set the value when a page is first loaded.

It's possible to store the user choices in the VS registry and check them at start-up, or on opening of every file. But I haven't coded that, yet.
By Justin Clareburt 4/12/2020

from hotsettings.

justcla avatar justcla commented on July 30, 2024

Design decision:
One major difference between the Lightbulb margin and the other margins that appear on the left editor margin is that the other options (Breakpoint, Line numbers, Selection) immediately act across all open files (as well as any new files opened).
But the Lightbulb margin currently only acts on the file in focus.

If that behaviour remains the same (ie. LB margin only affects the active editor), with a mix of editors that have and don't have the LB margin, there could be confusion from the user as to what the current default sticky settings is (ie. for new files and when files are reopened after restart). We would not be able to reflect that state on the context menu item. (Currently shows a tick/check if that specific editor has the LB margin enabled.) So we might need to find a place to surface the sticky state. We could add a button to a main toolbar like the editor toolbar or the Solution Explorer toolbar. Otherwise, it's not a big harm if the user doesn't know the sticky state in advance. They will find out as soon as a new editor opens, and changing the state of that editor will change the sticky state.

Another option is to change the behaviour of the LB margin to disable it on all editors. This might be harder to achieve, and more likely to result in bugs, but it would then be consistent with the other editor margin items. And it might be the behaviour that users expect/want/prefer. It would also eliminate the issue with not knowing or showing the sticky state of the LB margin.

So the big question is:....
Should toggling the lightbulb margin affect ALL open editors?

Edit:
I think the cleanest and most consistent solution would be for the LB margin setting to apply to all open editors, and remain sticky until changed. (ie. new editors and restored editors will have the most recent setting applied.)

from hotsettings.

josephan avatar josephan commented on July 30, 2024

It works great. Thank you!

@justcla When I click the sponsor link it redirects me to your profile, and I'm unable to see a sponsor button.

from hotsettings.

justcla avatar justcla commented on July 30, 2024

It works great.

Excellent! I'm so glad. :-D

Thank you!

😊 Yay! You are most welcome. 😁

@justcla When I click the sponsor link it redirects me to your profile, and I'm unable to see a sponsor button.

Oh, I guess I haven't set it up completely. Thanks for trying anyway.
Your thanks is reward enough. 😊

from hotsettings.

justcla avatar justcla commented on July 30, 2024

@josephan Have you discovered Hot Status yet?
https://marketplace.visualstudio.com/items?itemName=JustinClareburtMSFT.HotStatus

from hotsettings.

josephan avatar josephan commented on July 30, 2024

That looks cool but I've actually hidden my status bar (and a bunch more tools)!
Here's what my editor looks like (the grey bar at the bottom is for VsVim):
devenv_xnzhoUYe5l

from hotsettings.

Related Issues (9)

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.