Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mattn
Copy link
Member

@mattn mattn commented Jul 24, 2017

Update cursor forcibly since GUI doesn't redraw cursor immediately.

@nuko8
Copy link

nuko8 commented Jul 24, 2017

GUI doesn't redraw cursor immediately.

Probably, the correct solution to that is to draw the cursor only when the windowing system asks Vim to redraw the screen (like the GTK+3 GUI), not every time Vim thinks it necessary to update simply because the contents of a buffer or the position of the cursor has been changed. After all, you cannot update any part of the screen anyway until after the windowing system asks the client to do so.

There should already be several events which are sufficient for Vim to update the screen smoothly even when the built-in terminal is working there (Rather, more events to come). Nonetheless, that "delay" happens (Actually, that's not delay, although I'm not going to talk about that in further detail here). We first need to look into the reason why that happens before immediately resorting to any brute force means.

At least, IMHO, we should wait for the cursor drawing itself being fixed for the non-GUI version, as too early optimization is bad in general.

@mattn
Copy link
Member Author

mattn commented Jul 24, 2017

Yes, you are right. There are many workaround for updating cursor immediately were over 60 places in code. We should make some common function for each use-case.

  • update cursor
  • draw cursor immediately
  • draw cursor in later
    etc...

@brammool brammool closed this in 1c84493 Jul 24, 2017
@mattn
Copy link
Member Author

mattn commented Jul 24, 2017

Hmm, it's heavy redrawing cursor.

dpelle pushed a commit to dpelle/vim that referenced this pull request Jul 31, 2017
Problem:    Cursor in a terminal window not always updated in the GUI.
Solution:   Call gui_update_cursor(). (Yasuhiro Matsumoto, closes vim#1868)
@mattn mattn deleted the cursor-update branch August 11, 2017 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants