[Feature Request] Undo for Auto-Insert: tags and parentheses
-
Noob here. Not sure if this is the best place for this…
Very simple. I think it would be a great tweak to have Ctrl-Z remove the auto-completed tag/parenthesis.
When writing fresh code, I love it. When updating existing code (such as inserting a <strong> in a <p>), it’s entirely annoying.
I could turn it off, but ain’t nobody got time for that.
On the other hand, has anyone found a convenient way to deal?
-
@Jonah-Clarence said in [Feature Request] Undo for Auto-Insert: tags and parentheses:
to have Ctrl-Z remove the auto-completed tag/parenthesis.
There is already a keyboard mapped to the exact function you want. It’s the
DEL
delete key. When you typefunction(
and it autocompetes tofunction()
, your cursor is between the(
and the)
; theDEL
key will remove the closing parenthesis. With tags, it will take a few more hits of the key, but it still works.The best advice is to change the setting when you switch from creating fresh code to updating existing code. Unfortunately, I don’t know of a way with macros or scripting plugins to automate changing that preference, so there’s no “easy way” to change.
However, some of the scripting plugins will give you access to lanugages that can do some pretty cool stuff with the Win32 API. PythonScript might be able to automate the process of launching the dialog and clicking on the selections for you… but that’s a more advanced PythonScript than I currently have time to develop for free.
If you want to make a feature request, you can follow this FAQ – but understand that it might not be accepted, or might just not become a priority feature to implement, even if you ask for it.
If you do make a feature request, I would suggest that “but ain’t nobody got time for that” won’t endear anyone to you, and that a more professional phrasing might increase the chances that your request will be considered. For example, I might phrase it as, “I would like a command that could be bound to a shortcut that would undo the most recent auto-complete. Or, if it’s more convenient, it would at least be more efficient for me if I were able to assign a keyboard shortcut to be able to toggle the Auto-complete auto-insert xml/html close tag setting, so I could avoid navigating through all those menus and dialogs to change that setting”.
-
@PeterJones Yeah, parentheses are simple. Suppose I could have not mentioned it. Typically, I’m coding both existing & fresh lines simultaneously.
Forums are typically a bit informal. Definitely would keep it brief and technical on GitHub. Maybe it’s better to discuss, before impulsively opening a request.
I have these kind of ideas all the time, which come and go, so creating a profile here took a stronger impulse. Mostly because I’ve been using Notepad++ both at home and work literally every day. There are other respectable web dev IDEs, but Notepad++ has a small footprint. Also, I code various other languages, so it’s great to have a consistent experience for all notepad purposes, including simple notes, csv sanitizing, monospace formatting, regex everything. But I digress.
I have a few clunky tricks, but they are varied, relatively difficult, and a minor distraction to make the choice, depending on the situation.
- If it’s EOL, a simple Shift+Ctrl+Del will truncate the line.
- Mid-line, Shift+Ctrl+[left/right arrow] often lands you where you want slightly faster than Shift+arrow alone, while you can release Ctrl to fine tune – then Del.
- Reach for the mouse, highlight, then drag the tag where you want it
I think it’s very intuitive and would be widely applicable that Ctrl+Z reverses the last action, which in this case is not the user action, but that of Notepad++. There’s an autocorrect/complete type thing or somesuch in a software (I can’t recall) that works in this way. The “traditionally” expected reversal of the last character or even the opening <tag> seems much less useful, if not entirely unnecessary.
Like I said, it’s a miniscule and simple (as an idea, not necessarily to code) improvement… but every second counts towards a smooth workflow experience. This one’s been bothering me for a while.
-
@Jonah-Clarence said in [Feature Request] Undo for Auto-Insert: tags and parentheses:
Notepad++ has a small footprint. Also, I code various other languages, so it’s great to have a consistent experience for all notepad purposes, including simple notes, csv sanitizing, monospace formatting, regex everything. But I digress.
EXACTLY!!
-
Hello, @jonah-clarence, @peterjones, @michael-vincent and All,
I think that the @jonah-clarence’s regquest is rather pertinent !
For instance, in my old Microsoft Word, version
2002
, it is already the case, in various sistuations :-
Normally if I begin a sentence with a lower letter, Word replaces it, with its upper form, as soon as the first space is written. But, using the
Ctrl + Z
shortcut, it restores the lower initial letter typed in -
If I type in the three chars
(c)
, Word replaces it with the©
symbol, as soon as the ending parenthese is written. But, usingCtrl + Z
, it does restore it as the string(c)
-
If I type the simple
"
English double-quote, to indicate the beginning of a speech, Word, automatically, replaces it with the opening French quote or chevron«
. But, after usingCtrl + Z
, it does restore the original"
English double-quote symbol
And so on…
So, it seems logic that any change, introduced by Notepad++ itself, should be undone with a
Ctrl + Z
action ;-))Best regards,
guy038
-
-
@guy038 said in [Feature Request] Undo for Auto-Insert: tags and parentheses:
So, it seems logic that any change, introduced by Notepad++ itself, should be undone with a Ctrl + Z action ;-))
I completely agree. I believe at one time I opened an issue (maybe even a PR as well) but Don rejected it.
-
@dail said in [Feature Request] Undo for Auto-Insert: tags and parentheses:
any change
I’m confused about the scope of “any change”. Is this any textual change? Or is it truly any change? Say for example one runs a marking operation – should that be undoable/redoable as well?
-
-
@Alan-Kilborn said in [Feature Request] Undo for Auto-Insert: tags and parentheses:
Is this any textual change? Or is it truly any change?
In the context of any change Notepad++ did that the user did not specifically do themselves. I wont say this is a hard rule though.