@Alan-Kilborn said in HTML colors in proper colors:
Did the earlier code run too slowly?
I ask because it seemed to process only what was on-screen to a user as opposed to the whole-file.
… maybe you encountered some other difficulty relating to it.
With my 90-color example, where I had multiple instances of those same 90 color blocks, as I would scroll up and down the file, it would slow down my scrolling as it kept redrawing the screen for every line of movement (ie, every time the UPDATEUI notification was triggered). That was annoying to me. My whole-file-once approach took 2-5sec to do the whole file, but then I could scroll to my heart’s content; the notification-based one-screen solution took <1s per screen, but it cost that same amount of time every scroll action; scrolling more than a few lines or a few times would quickly move the higher efficiency from one-page to color-once-then-move-freely.
If I were editing a large HTML file (I don’t do that – I am just doing this because it is interesting and I had an idea I wanted to try), I think I would prefer colorizing the whole thing, on demand. If I were trying to decide which color to put in the HTML/CSS, the NppQCP would be a better option, because you could start with what you have, then tweak the value in the plugin. But if I just want a quick visual reference of what color each of those are as I’m editing other things in my HTML/CSS, I wouldn’t need to refresh it often, and doing the whole document one time would mean I could scroll throughout the document without further delays.
To each his own, I guess. If someone wanted an on-demand-but-just-the-visible-screen, the start_position and end_position values could go back to the visible-line-start/ends that were in my first gist.
Since I was implementing this more for my own learning than to help the OP, I decided to implement it in the way that would most likely match the way I might use the feature in the future. And both gists are still there, so either are available for direct use or for taking and editing to match one’s own use-case.
I said,
It may already be changed in the gist by the time you get here.
It’s changed now, BTW.