Page 1 of 1

solved: html matching in cpp file

Posted: 18 Jul 2025 02:50
by DerellLicht1
This has actually been going on for quite a while, but it isn't all that awful, it's just odd...

When I'm editing a .cpp file, and I type Control-B, I get this:

Code: Select all

<b></b>void getx_clear_output_str(void)
so the .cpp parser seems to be handling Ctrl-B as a "select Bold attribute" command...
I think this is probably unintended behavior ???

<context>
The reason I keep hitting this, is because the ancient Brief editor, which I used back in the MSDOS days, used Ctrl-B for "show list of all bookmarks", and I use bookmarks alot.
When I switched from Brief to MultiEdit, back around Y2K, it had a Brief keyboard emulation mode, which duplicated this command... so I'm used to it...

Yes, I know that Shift-F2 is what I actually want here, but 30 years of coding habit do not die away peacefully!!!
</context>

Re: minor issue: html matching in cpp file

Posted: 18 Jul 2025 09:01
by pjj
As I understand this, there are no "shortcuts per highlighter" and one shortcut acts the same irrespective of said highlighter. If I press ^B in .txt or .csv or .css or any other file, I always run the same InsertStrongEmphasisAction which inserts (in my case) <strong>%sel%</strong>.

Would it be cool to have "shortcuts per highlighter"? Yeah, maybe, but is it worth the effort? I suppose it would require overhaul of "Customize keyboard" module at the very least. If you don't edit HTML files, perhaps just remapping ^B (adding it as a wingman [so to speak] to Shift+F2) would do the trick for you?

Re: minor issue: html matching in cpp file

Posted: 18 Jul 2025 12:44
by Rickard Johansson
Maybe I should remove those shortcuts and let users set shortcuts themselves :?

Re: minor issue: html matching in cpp file

Posted: 18 Jul 2025 14:14
by DerellLicht1
Okay, that's interesting...
So I've been using RJTE for several years now, and only *now* am I discovering that it doesn't have per-extension key mappings??
My previous editor *did* have that, and I guess I just assumed this one would too!!

Anyway, now that I know, that's fine, I can live with that!!
I like pjj's suggestion of just mapping Ctrl-B to same as Shift-F2 ... I'll do that...

Re: minor issue: html matching in cpp file

Posted: 18 Jul 2025 17:19
by pjj
Rickard Johansson wrote: 18 Jul 2025 12:44 Maybe I should remove those shortcuts and let users set shortcuts themselves :?
I believe in the value of sane defaults; therefore I believe ^B should act as it currently does, and F1 should still invoke help :wink:
SANE defaults
The default behaviour of functions, APIs, applications, etc is often specified or designed to be ‘sane’ - but what does this actually mean? Use the SANE default acronym.

Simple
The default options should give usable and useful output for the majority of use cases. Little-used functionality is for non-default behaviours.
(...)
https://ebaker.me.uk/notes/SANE-defaults