How to disable "Remembering cursor position" in function node (version 3.0)

How to disable "Remembering cursor position" in function node.

Hi @sahsha - there is no option provided to disable that feature. Is it not useful for you?

As with all things, we could add an option to disable it - just depends how much demand there is to turn it off.

I'd like to see a disable option also.

Whenever I need to update one of my instance which is already running for months & on scrolling way down then click a position to edit, it selects the entire code up till the last known cursor position.

This feature is best if I'm working on same day. After few days I forget where I've left the cursor.

So wanted to know if disabling can be done.

What code editor are you using? This is a bug with the old ACE editor.

How to tell:

  • Monaco is a rich editor with tons of built in Node-RED aware snippets & many tools built-in...
  • ACE does not!

Dont you ever refresh the browser? Cursor position is only memory based!

You are the first and only person to ask this :thinking:

on my keyboard cmd- (up arrow) jumps the cursor to the top of the function.

On windows/linux, CTRL-Home takes the cursor to the top/beginning of the editor, CTRL-End takes the cursor to the bottom/end of the editor

  • If you want to just start at the top

    • then as Dave says, there is a standard (system wide) shortcut.
  • If you want to find where you left the cursor...

    1. It should already be on screen as the editor reloads the scroll position too
    2. If it is not on screen (because you scrolled, leaving the cursor off screen), then simply press one of your arrow keys and it will immediately scroll into view.

Would be good to know which editor you are using (ACE or MONACO), what browser you are using, and whether these things are working for you

Maybe then you'd prefer "auto forget cursor position after [ xx ] hours" ?

I quite like the remember cursor position feature, but it's value does diminish over time so forget after 1 day would be handy.

While we are on the subject of Monaco, is it possible to curb it's overenthusiastic use of popover tooltips?
eg here with the mouse over "set"

Yes, there are tons of customisations to suit everyone's needs.

The defaults I chose were with beginner in mind (who wouldn't know how to find these tips if they were disabled by default - in fact, they wouldn't even know such help exists at all).

I felt keeping it as close to how VSCode is (out of the box) made more sense than dumbing down/up choices made by microsoft. This (I hope) makes users aware of what it can do, then they can tailor it to their preference - but at least they would know such things exist.

I only go into this detail as this is the 2nd time someone has asked for "less"

Essentially, the tweaking is (currently) done by modifying your settings.js file.

Try this...

        codeEditor: {
            lib: "monaco", //can be "monaco" or "ace"
            options: {
                // /* theme - must match the file name of a theme in 
                //  * packages/node_modules/@node-red/editor-client/src/vendor/monaco/dist/theme
                //  * e.g. "tomorrow-night", "upstream-sunburst", "github", "my-theme"
                //  */
                theme: "vs-dark",
                minimap: {
                    enabled: true,
                    maxColumn: 40,
                    scale: 1,
                    showSlider : "mouseover",
                    renderCharacters: true
                fontSize: 14,
                fontLigatures: true,
                fontFamily: "Cascadia Code, Fira Code, Consolas, 'Courier New', monospace",
                fontWeight: "300",
                colorDecorators: true,
                showFoldingControls: 'always',
                "bracketPairColorization.enabled": true,
                    delay: 1000,
                    sticky: false,
                    enabled: true

:point_up: that goes inside editorTheme { ... }

More options here: IStandaloneEditorConstructionOptions | Monaco Editor API
Playground for trying stuff out here: Monaco Editor Playground

1 Like

Given how often we're hearing this feedback, I do think providing some options in the editor (without resorting to editing the settings file) are needed.

As I've said elsewhere, I do find the auto-suggest can be overwhelming and overly aggressive. I think we can tune it to be less in your face, whilst not diminishing the help it can provide. Even just a short delay before it pops up would mean it doesn't keep shouting at you whilst you type.

@knolleary I changed setting from "ace" to "monaco", seems to suit my requirement.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.