Giter Club home page Giter Club logo

Comments (4)

segrey avatar segrey commented on September 3, 2024 1

Do you mean com.jediterm.terminal.TerminalColor#myColorSupplier by providers/lambdas?
For example, here is now com.jediterm.terminal.ui.settings.UserSettingsProvider#getDefaultStyle is implemented in IntelliJ:

  @Override
  public TextStyle getDefaultStyle() {
    return new TextStyle(new TerminalColor(() -> AwtTransformers.fromAwtColor(myUiSettingsManager.getDefaultForeground())),
                         new TerminalColor(() -> AwtTransformers.fromAwtColor(myUiSettingsManager.getDefaultBackground())));
  }

So, everything works even if UserSettingsProvider#getDefaultStyle is called only once.
I agree with you there is some inconsistency. Probably, these methods should be called only once and dynamic colors should be supported via implementing Supplier<Color>.

from jediterm.

segrey avatar segrey commented on September 3, 2024

@pskowronek I tried to optimize it a bit in af3a61a, but generally, UserSettingsProvider#getSelectionColor() and UserSettingsProvider#getFoundPatternColor() could be called multiple times to support switching between different UI themes. I'd recommend to implement some caching in your UserSettingsProvider if these methods are expensive.

from jediterm.

pskowronek avatar pskowronek commented on September 3, 2024

Thanks! However, hmm, how does it differ from UserSettingsProvider#getDefaultStyle() - it is called once and probably providers/lambdas are called multiple times (which is fine), but UserSettingsProvider#getSelectionColor() is/was (need to check your change) called multiple of times even though they also return 'providers'.

from jediterm.

pskowronek avatar pskowronek commented on September 3, 2024

Do you mean com.jediterm.terminal.TerminalColor#myColorSupplier by providers/lambdas? For example, here is now com.jediterm.terminal.ui.settings.UserSettingsProvider#getDefaultStyle is implemented in IntelliJ:

yes, I haven't had a code in front of me.

So, everything works even if UserSettingsProvider#getDefaultStyle is called only once. I agree with you there is some inconsistency. Probably, these methods should be called only once and dynamic colors should be supported via implementing Supplier<Color>.

Yes, that was my thought.

from jediterm.

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.