Code Monkey home page Code Monkey logo

Comments (5)

hougesen avatar hougesen commented on September 27, 2024

Resizing the window also triggers a lot of rerenders.

Screencast.from.2024-01-28.16-40-10.webm

from rio.

raphamorim avatar raphamorim commented on September 27, 2024

Good findings, yes those behaviors should be fixed. Now cursor can come either from terminal and state, most of times comes from state, but would be good move part of cursor rendering logic outside of state (state reflects in the current window rendering state).

from rio.

hougesen avatar hougesen commented on September 27, 2024

Are the changes required affected by #428?

I also noticed selecting text is a lot slower when blinking-cursor is turned on.

Turned off:

Screencast.from.2024-01-28.23-58-52.webm

Turned on:

Screencast.from.2024-01-28.23-59-41.webm

It is not a problem when using nvim or zellij, which I am guessing is because they handle cursor state themself (?).

Edit:

Adding a check for whether there is a selection eliminates the delay after first render.

if self.state.has_blinking_enabled && has_blinking_enabled {
self.context_manager.schedule_render(800);
}

if self.state.has_blinking_enabled
	&& has_blinking_enabled
	&& self.selection_is_empty()
{
	self.context_manager.schedule_render(800);
}

I am not sure whether this is a desired long term solution, but it might make sense as a quick fix?

from rio.

raphamorim avatar raphamorim commented on September 27, 2024

Are the changes required affected by #428?

No shouldn't be affected, #428 should touch mostly sugarloaf crate.

I also noticed selecting text is a lot slower when blinking-cursor is turned on.

Hmm, that would make sense because is stacking rendering and blinking (rendering) in the same time.

Adding a check for whether there is a selection eliminates the delay after first render.

I like the solution for now but shouldn't be the final fix (I guess) because could be that users would expect the cursor to blink if have selected text (?? not sure tbh).

Would you mind create a PR with those changes?

from rio.

hougesen avatar hougesen commented on September 27, 2024

Sure, coming up.

from rio.

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.