Draw issue in gvim when calling matchadd() from timer callback.

66 views
Skip to first unread message

Davit Samvelyan

unread,
Jul 4, 2016, 9:13:46 AM7/4/16
to vim_dev
Hi Everyone,

I have written a plugin which auto-highlights word under cursor when cursor is idle for given time. https://github.com/davits/autohighlight

Recently I've updated Vim to the latest version and noticed a strange draw issue when timer callback is fired and word is "highlighted".
As if cursor jumps to the end of last highlighted word and jumps back.

To reproduce issue:
open test.txt file in gvim
:source test.vim
:call FireTimer()

There were no such issue with the old version (I don't remember it exactly, somewhere around 7.4.1600)

Regards,
Davit.

test.txt
test.vim

Davit Samvelyan

unread,
Jul 4, 2016, 9:46:14 AM7/4/16
to vim_dev

> There were no such issue with the old version (I don't remember it exactly, somewhere around 7.4.1600)

After a lot of compiles and tests:
This issue was introduced in 7.4.1890

Bram Moolenaar

unread,
Jul 4, 2016, 4:26:35 PM7/4/16
to Davit Samvelyan, vim_dev
Thanks, that helps.

I suppose do need to update the cursor when actually redrawing.
But without restarting the blinking.

--
hundred-and-one symptoms of being an internet addict:
197. Your desk collapses under the weight of your computer peripherals.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Kazunobu Kuriyama

unread,
Jul 5, 2016, 1:02:25 AM7/5/16
to vim...@googlegroups.com, Davit Samvelyan
Although I'm not sure which GUI Davit was talking about in the original post, in case it were the GTK3 GUI,  a tiny patch attached below might be enough to fix the issue.

Best regards,
Kazunobu Kuriyama


--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

gui_gtk_x11.c.patch

Bram Moolenaar

unread,
Jul 5, 2016, 3:08:25 PM7/5/16
to Kazunobu Kuriyama, vim...@googlegroups.com, Davit Samvelyan

Kazunobu Kuriyama wrote:

> Although I'm not sure which GUI Davit was talking about in the original
> post, in case it were the GTK3 GUI, a tiny patch attached below might be
> enough to fix the issue.

I don't think this is the right solution. We need to fix it for all GUI
versions.


--
panic("Foooooooood fight!");
-- In the kernel source aha1542.c, after detecting a bad segment list
Reply all
Reply to author
Forward
0 new messages