Jump to content
Lion09

C++ Builder Editor Questions

Recommended Posts

I am working on maintaining a project in C++ Builder 11 and have some questions about the built-in editor's features I haven't figure out.

 

1- When I click on a line past the last character the cursor stays where I clicked instead of positioning to just after the last character on the line.  If I start typing at that point it fills the intervening space with space characters which I guess is fine if I wanted to add a comment or something to the line.  But even if I don't start typing, I still need to back space all the intervening spaces to get to the end of the line (or try more accurate re-clicking).  Every other editor I have used puts the cursor after the last character when you click on a line past that last character.   I found an option for 'Cursor beyond EOF' which allows placing the cursor beyond the last line of the file in a similar way but not any related setting for 'Cursor beyond EOL' that I can turn off.  Are there hidden settings?

 

2- Any way to move the entire current line your cursor is on up or down a line like Alt+Arrow Up or Alt+Arrow Down in VS Code?

 

3- Multi-cursor?  With Alt key held down to click in multiple spots to insert multiple cursors to type in the same text at each spot?

 

4- Multi-select?  Highlight some text then Ctl+D to find and also select the next match? Repeat as needed and type over all of them at once.

 

Those are mainly from VS Code but also in other editors I have used.

 

5- Can you create custom key mappings to override the defaults?  Could only find wholesale key mapping sets in the options not individual ones.  One reason is that I am VNC-ing to the Windows machine from a Mac for some of this work and don't have certain keys like End or Home so want to map different key combos for things like Alt+Shift+End to select from the cursor to the end of line.

 

Basically I have a lot of editing to do with some legacy code and am finding the editor is slowing me down.  I tried to find a way to integrate an external editor but at this time the best I have found is right-clicking the files in the Project Explorer to show it in Windows Explorer then right-click the file to Open with VS Code (or UltraEdit).  Then when I save the file from those editors I have to deal with confirming the message in C++ Builder about date/time for the file changing and reloading it.   A bit cumbersome and potentially error prone so would like to find a way to stay within the IDE and have a better editing experience, any suggestions much appreciated.

 

Thanks- Jay

C++ Builder 11 Alexandria

Share this post


Link to post

Out of the box I don't believe it's possible to do 1,2 and 3 but I could be mistaken.

 

Number 4 is there, it's called Sync Edit. Highlight some text, press Ctrl+Shift+J, then either press TAB multiple times to select the string you want to replace or navigate to it using keyboard/mouse. Change the string and all instances within the highlighted text will change as well.

 

Remapping keys is best done using something like GExperts or maybe CnPack. They're third party add-on packs that extend the IDE and it's features. You may find within them something that resembles those first 3 features you're looking for.

 

If you have the time and the inclination the IDE is very extendible. The Open Tools API (OTAPI) is your starting point there. Both GExperts and CnPack are good examples with full source code of how to use it.

Share this post


Link to post

Thanks Lachlan, I will check out your suggestions and research further.  I had been thinking third party or Windows extensions might help and this gives me a start.

 

I am still baffled by 1 as my habit from every other editor or word processor is to click anywhere to the right of the line continue typing from the last character on that line, even this comment editor works that way!  I may even file a bug or feature report with Embarcadero over it to see what I get back from them.

 

Thanks again- Jay

C++ Builder 11 Alexandria

Share this post


Link to post
On 1/11/2022 at 11:06 AM, Der schöne Günther said:

I believe MMX does this with [Alt]+[Shift]+[Up/Down]

Not tested, but it should work with C++ projects as well.

Thanks for the suggestion. I took a look through the MMX site and would be a bit concerned about installing a large Delphi refactoring tool into C++ Builder for just a single editing feature!  It looks like it entirely replaces or wraps the native editor? The videos and screenshots on their site look like they are from earlier versions of RAD Studio so is hard to tell.  But if that is the case, it might mean the editor can be be scripted to add features?  Or at least that integrating another custom editor in to the IDE is possible?  Probably not going to get into that myself for this particular project but points to some possibilities. 

Share this post


Link to post

It can add a lot of different things, and is highly customizable. It can be properly uninstalled. I find it to be of very high quality.

@Uwe Raabe is maintaining it, maybe he can shed a bit of light how it works with C++ builder projects.

 

Share this post


Link to post
9 minutes ago, Der schöne Günther said:

maybe he can shed a bit of light how it works with C++ builder projects.

Unfortunately it was never designed to support C++ Builder. So, while this specific functionality may work, I doubt it would justify to install the whole product with near to none additional benefit.

Share this post


Link to post
On 1/14/2022 at 10:00 AM, Uwe Raabe said:

Unfortunately it was never designed to support C++ Builder. So, while this specific functionality may work, I doubt it would justify to install

Thanks, I kind of figured as much.  I have decided for now to use an external editor since most of the current work is refactoring and code cleanup that doesn't need IDE features.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×