I recently upgraded my home NR, and am now finding when I open a function node to edit, as soon as I click the code/text I want to change, it highlights a whole block between where I'd last left the cursor and just clicked on this edit session. Happening on both a desktop with a mouse and a laptop with a touchpad.
This wiped out a bunch of arbitrary lines I'd been tweaking, so it's very frustrating.
Is there a new setting I'm missing?
edit: just identified that it remembers where I left the cursor at last edit, and on next edit, highlights everything from the last cursor position to wherever I click now.
Don't worry about it is just highlighting the text block, it has not selected it, it is a feature of the Monaco editor. Node-red has changed to Monaco fro ace.
Should not of wiped any lines can you share an image?
It wipes because I get a concept in my head, click where I want to edit it, and start typing, then hit save, deploy, and get an error. Or, I close it and see the red triangle, etc.And on a laptop LCD, the contrast is apparently not strong enough to always see that it highlighted something.
Yes, I get that I'm responsible for my work, but this is like the crappy upgrades forced down by every other tech conglomerate, where they change something randomly and it screws up all your muscle-memory work habits.
Normal behavior in text editors is to highlight when you click and hold or click and hold a key combo. This is a bizarre deviation from "normal" expectations.
I don't know how helpful the image is, but here it is. I clicked the bottom cursor position, closed the editor window, moved the node around the flow, re-opened the editor, clicked the top cursor position, and everything you see was highlighted.
If I'd left the editor by changing one of these entrees, then returned to change a different entry, it's entirely possible to wipe out a section of conditional statements and not even notice if I was focused on other coding work.
A feature request was fulfilled quite some time ago, to enable remembering users selection and scroll position so they don't have to hunt for where they were up to over and over.
This should be per node (i.e. function 1 remembers it's scroll and highlight different to where you left scroll and highlight in function 2)
What I don't understand is how you are deleting losing text?
Typically you move your cursor before typing? Or at least look at where it is blinking before typing.
This is similar to switching tabs in an mdi application - they are maintained. I'd be super unhappy if the cursor kept losing selection and positioning and scrolling to the top.
I can see the utility on very long code sections, but even then (I have some huge functions in an experimental system), why does it highligjht as if I'd held down shift? I'd expect the editor to behave like an editor, without a custom nuance.
If it's a feature, can it be disabled?
Going by E1cid's comments, I'm going to look for how to change Monaco. THe whole concept of an editor within the editor is new to me, so it's a task for another day.
I just updated it recently, though.
Any idea if this behavior is different in the current version?
I've had updates kill mission-critical systems in my career, so I don't update unless it's to solve a specific problem.
Now it's really my own fault...literally talking about it, and I just opened a function, clicked an empty space, then hit ctrl-v to paste in code from another node (consolidating multiple functions), and wiped out the existing code because my fingers moved faster than my eyes seeing it highlighted.
Hit cancel, started over and did it right, so nothing lost. Still annoying to remember different text editing behaviors when I'm working on several things at once (working my day job right now also, so typing emails and editing spreadsheets).
`You hit cancel after you add the comment, that will revert back to before you added the comment, you have to hit done to save. Or am I still missing the issue?
Ĩ see the issue now watched a few times, this is not happening for me, I have to press and drag or use shift, it then highlights blue, only then does it over write. If grey it just inserts when cursor is.
You don't have to hit cancel you can press ctrl z to undo.
Here are the steps that lead to data loss in the video:
open editor
change some text
hit done and move to next task
bugs appear to be worked out, time to comment, so return to the function node editor
click in whitespace
start typing, see noise (error flags), realize I forgot the backslashes, so add them, then continue commenting
hit done, now having replaced my working code with a comment.
Yeah, I acknowledge that it's a very dumb-mistake scenario, but it's wholly dependent on the editor behaving like a standard text editor. I also realized after this post, that I'm conditioned to ignore text highlighting because some text seems to be arbitrarily highlighted. I just opened the editor to change a test variable, and saw the line highlighted, typed the new variable value, and the higlighting didn't change. Like different colored line or something.