Skip Menu |

This queue is for tickets about the Code-ART CPAN distribution.

Report information
The Basics
Id: 132881
Status: open
Priority: 0/
Queue: Code-ART

People
Owner: Nobody in particular
Requestors: juerd [...] tnx.nl
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Alternative to CursorHold
Date: Fri, 26 Jun 2020 02:39:50 +0200
To: bug-code-art [...] rt.cpan.org
From: Juerd Waalboer <juerd [...] tnx.nl>
Hi again, Personally I'm not a big fan of CursorHold in vim, because when it does things by itself I get distracted. Of course, this was easily fixed by commenting out those lines from perlart.vim, but it would be nice if it did these things conditionally so I could just disable them from the comfort of my own .vimrc Adding "return ''" to the end of the function makes it suitable for nmap'ing it to a keybinding. (I couldn't find a way to bind a key to just calling a function in a way that ignores the return value.) -- Met vriendelijke groet, // Kind regards, // Korajn salutojn, Juerd Waalboer <juerd@tnx.nl> TNX
Subject: Re: [rt.cpan.org #132881] Alternative to CursorHold
Date: Fri, 26 Jun 2020 01:23:45 +0000
To: bug-Code-ART [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Thanks, Juerd. I don't have an answer yet, but I will consider this issue further. Just to clarify, if I were using CursorMove events instead, so the the highlighting occurred immediately when the cursor moved over a variable, would you still object to the approach? Thanks, Damian
Subject: Re: [rt.cpan.org #132881] Alternative to CursorHold
Date: Tue, 30 Jun 2020 02:28:41 +0200
To: "damian [...] conway.org via RT" <bug-Code-ART [...] rt.cpan.org>
From: Juerd Waalboer <juerd [...] tnx.nl>
damian@conway.org via RT skribis 2020-06-25 21:23 (-0400): Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=132881 > > Thanks, Juerd. > I don't have an answer yet, but I will consider this issue further. > Just to clarify, if I were using CursorMove events instead, so > the the highlighting occurred immediately when the cursor > moved over a variable, would you still object to the approach?
After having experimented a bit, I can conclude that indeed CursorMoved is much less annoying, but there was still a factor that managed to distract me: the stuff printed at the bottom. Something new appears, and my eyes immediately get drawn there. But with CursorHold changed to CursorMoved, and the echo/echohl stuff in PerlART_HandleVarAnalysis commented out, I'm really liking it! It is now very useful without getting in my way. It's probably better to still print the warnings (unused, undeclared, cacogram), since in those cases drawing attention is probably a good thing. But commenting out the entire block was easier :) There is a slight issue with CursorMoved: spinning up numerous processes when w'ing through a document (my favourite way of speed-reading in vim is to just hold w), does cause my laptop to heat up enough for it to start its fan. So I experimented with CursorHold and setting a different 'updatetime'. I settled on 50. This variable also controls when the swap file is written, but I don't think I'll even notice the difference. So maybe you could just document that 'set updatetime=<ms>' can be used to control the delay, and that values as low as 50 work may help people who are easily distracted. This is probably better than using CursorMoved, because it greatly reduces the number of perls forked when you hold a cursor moving key. And it would be nice if printing on the status line was configurable to print the warnings only. But in any case, I'm really enjoying the plugin now! -- Met vriendelijke groet, // Kind regards, // Korajn salutojn, Juerd Waalboer <juerd@tnx.nl> TNX