BCX Editor (BED) 3.67 available for download

Started by MrBcx, January 10, 2025, 05:41:28 PM

Previous topic - Next topic

MrBcx

Quote from: Quin on January 27, 2025, 12:37:58 PM
MrBCX,
I have that option checked, but I can't find the keyboard shortcuts to collapse/expand the function/sub/etc. that my cursor is currently focused over.

Sorry ... I forgot about your vision.  There is no shortcut. 

Within the editor itself, little expando / contracto toggle control buttons appear at the far left of the
supported keyword (SUB, FUNCTION, CMDHANDLER, MSGHANDLER, etc). 

Off the top of head, any Scintilla-based or BED-based shortcut would need to know that the cursor is over a line starting with a recognized control word.  Easy enough to understand - the devil is in the details.  I'll do a bit of research but I'm making no promises.

Quin

MrBCX,
I have that option checked, but I can't find the keyboard shortcuts to collapse/expand the function/sub/etc. that my cursor is currently focused over.

MrBcx

#24
Quote from: Quin on January 27, 2025, 11:51:53 AM
Quote from: MrBcx on January 27, 2025, 11:46:37 AM
Hi Quin,

I don't know if this interests you but CMDHANDLER and MSGHANDLER blocks also react to BED's

fold feature on the View Menu. 

When folds is enabled, you can collapse or expand CMDHANDLER, MSGHANDLER, FUNCTIONS, SUBS, etc

  is it possible for me to collapse/expand individual functions/subs/etc at a time with the keyboard rather than all of them at once with control+t?[/color]



Yes.  On the View menu, just above Toggle all folds, is a menu item named Folds.  Enable that (click it). 


Quin

Quote from: Robert on January 26, 2025, 05:27:43 PM
Hi Quin:

Download BEd again.

Here's the link
https://bcxbasiccoders.com/bcxusers/mrbcx/bed.zip

My first download of 3.69 did not have the "cmdhandler", "msghandler" corrections in Beautify.inc.
Hi again Robert,
As they say, two steps forward, one step backward :D
This is a much more minor issue, but now each Case statement of a Select Case block is on the same indentation as all of the statement inside of it, rather than that of the Select/End Select statements.
Thanks,
Quin.

Quin

Quote from: MrBcx on January 27, 2025, 11:46:37 AM
Hi Quin,

I don't know if this interests you but CMDHANDLER and MSGHANDLER blocks also react to BED's

fold feature on the View Menu. 

When folds is enabled, you can collapse or expand CMDHANDLER, MSGHANDLER, FUNCTIONS, SUBS, etc
MrBCX,
Thanks for the suggestion! This is definitely something that interests me, PureBasic has this feature and I am in love with it!
It seems to work quite well in BED, but I do have one question: is it possible for me to collapse/expand individual functions/subs/etc at a time with the keyboard rather than all of them at once with control+t?
Thanks,
Quin.

MrBcx

Hi Quin,

I don't know if this interests you but CMDHANDLER and MSGHANDLER blocks also react to BED's

fold feature on the View Menu. 

When folds is enabled, you can collapse or expand CMDHANDLER, MSGHANDLER, FUNCTIONS, SUBS, etc

Quin

Quote from: Robert on January 26, 2025, 05:27:43 PM
Hi Quin:

Download BEd again.

Here's the link
https://bcxbasiccoders.com/bcxusers/mrbcx/bed.zip

My first download of 3.69 did not have the "cmdhandler", "msghandler" corrections in Beautify.inc.
Hi Robert,
Thanks so much, this works like a charm! Well, sans the casing issue, but that's far less of a big deal. The indentation was a big deal for me though, I have a tool that lets me jump to the previous or next line with the same indentation, as well as going in and out indentation levels, just like a windows tree view, and not being able to skip over handler macros like this because they were all outdented was as frustrating as you can imagine. It's amazing now though, thanks for all your great work! :)

Robert

Quote from: Quin on January 26, 2025, 08:01:11 AM
Quote from: Robert on January 22, 2025, 06:30:43 PM
Hi Quin:

In Beautify.inc change

SET BumpUps$[] AS PCHAR
    "if", "union", "type", "function", "sub", "enum", "do", "while", "for", "for_each", "xfor",
    "class", "callback", "set", "sharedset", "repeat", "begin", "select", "with",
    "$if", "$ifdef", "property", "propset", "propget", "method", "constructor", "case"
END SET

to
SET BumpUps$[] AS PCHAR
    "if", "union", "type", "function", "sub", "enum", "do", "while", "for", "for_each", "xfor",
    "class", "callback", "set", "sharedset", "repeat", "begin", "select", "with",
    "$if", "$ifdef", "property", "propset", "propget", "method", "constructor", "case",
    "cmdhandler", "msghandler"
END SET

Robert,
Thanks for your reply! Unfortunately though this doesn't work for me, I did what you suggested and rebuilt BED, then pressed control+b in my project and the msghandlers were still unindented and cased incorrectly :(

Hi Quin:

Download BEd again.

Here's the link
https://bcxbasiccoders.com/bcxusers/mrbcx/bed.zip

My first download of 3.69 did not have the "cmdhandler", "msghandler" corrections in Beautify.inc.

Robert

#18
Quote from: Quin on January 26, 2025, 08:01:11 AM
Quote from: Robert on January 22, 2025, 06:30:43 PM
Hi Quin:

In Beautify.inc change

SET BumpUps$[] AS PCHAR
    "if", "union", "type", "function", "sub", "enum", "do", "while", "for", "for_each", "xfor",
    "class", "callback", "set", "sharedset", "repeat", "begin", "select", "with",
    "$if", "$ifdef", "property", "propset", "propget", "method", "constructor", "case"
END SET

to
SET BumpUps$[] AS PCHAR
    "if", "union", "type", "function", "sub", "enum", "do", "while", "for", "for_each", "xfor",
    "class", "callback", "set", "sharedset", "repeat", "begin", "select", "with",
    "$if", "$ifdef", "property", "propset", "propget", "method", "constructor", "case",
    "cmdhandler", "msghandler"
END SET

Robert,
Thanks for your reply! Unfortunately though this doesn't work for me, I did what you suggested and rebuilt BED, then pressed control+b in my project and the msghandlers were still unindented and cased incorrectly :(

Hi Quin:
I'm sorry that it didn't work.
I have been trying to get the Beautifier functioning properly for a couple of years.
As a start, it may be a good idea to remove the lower, Title and UPPER casing code and just put in BEd a good indenter.
Indentation is important to quickly understand the structure of the code and, I imagine, even more important if the coder is visually challenged.
Hang in there ! We will get this done.

MrBcx

#17
Quote from: MrBcx on January 26, 2025, 10:45:26 AM
I put Robert's addition into BED a couple days ago

https://bcxbasiccoders.com/smf/index.php?topic=420.0

When I load this sample into BED : https://bcxbasiccoders.com/webhelp/html/bcx_mdiguistatement.htm#bcx_framewnd

my experience is that pressing ctrl-b pops up the beautifier dialog box (as it should) which in turn allows me to format

all of the MSGHANDLER and CMDHANDLER blocks correctly, according to my Beautifier settings.

Correction -- the indentation works but the keyword case does not.   

You might recall my initial warning about my frustration working with the Beautifier code.

https://bcxbasiccoders.com/smf/index.php?topic=1257.msg6756#msg6756

MrBcx

I put Robert's addition into BED a couple days ago

https://bcxbasiccoders.com/smf/index.php?topic=420.0

When I load this sample into BED : https://bcxbasiccoders.com/webhelp/html/bcx_mdiguistatement.htm#bcx_framewnd

my experience is that pressing ctrl-b pops up the beautifier dialog box (as it should) which in turn allows me to format

all of the MSGHANDLER and CMDHANDLER blocks correctly, according to my Beautifier settings.


Quin

Quote from: Robert on January 22, 2025, 06:30:43 PM
Hi Quin:

In Beautify.inc change

SET BumpUps$[] AS PCHAR
    "if", "union", "type", "function", "sub", "enum", "do", "while", "for", "for_each", "xfor",
    "class", "callback", "set", "sharedset", "repeat", "begin", "select", "with",
    "$if", "$ifdef", "property", "propset", "propget", "method", "constructor", "case"
END SET

to
SET BumpUps$[] AS PCHAR
    "if", "union", "type", "function", "sub", "enum", "do", "while", "for", "for_each", "xfor",
    "class", "callback", "set", "sharedset", "repeat", "begin", "select", "with",
    "$if", "$ifdef", "property", "propset", "propget", "method", "constructor", "case",
    "cmdhandler", "msghandler"
END SET

Robert,
Thanks for your reply! Unfortunately though this doesn't work for me, I did what you suggested and rebuilt BED, then pressed control+b in my project and the msghandlers were still unindented and cased incorrectly :(

MrBcx

For The Win!   

Thanks for carrying the water Robert

Robert

Quote from: Quin on January 22, 2025, 03:26:04 PM
Quote from: MrBcx on January 15, 2025, 09:14:24 PM
Quote from: Quin on January 15, 2025, 09:02:16 PM
MrBCX,
Why is it that commands inside a CMDHhandler or MSGHandler aren't indented like that of subs/functions when the beautify tool is ran over them?

It's possible, probable I think, that those keywords did not even exist at the time that the beautifier was created.
MrBCX,
I'm using these macros in my program heavily, and having the indentation break every time I try to beautify my code breaks my workflow, so I'm trying to fix it. However I seem to be doing something wrong, I added "cmdhandler" and "msghandler" to the very end of the list in the beautify file, but it doesn't work. I assume this is because the keywords have to be in a specific order, but I don't know what that order is.
Any suggestions?
Thanks!

Hi Quin:

In Beautify.inc change

SET BumpUps$[] AS PCHAR
    "if", "union", "type", "function", "sub", "enum", "do", "while", "for", "for_each", "xfor",
    "class", "callback", "set", "sharedset", "repeat", "begin", "select", "with",
    "$if", "$ifdef", "property", "propset", "propget", "method", "constructor", "case"
END SET

to
SET BumpUps$[] AS PCHAR
    "if", "union", "type", "function", "sub", "enum", "do", "while", "for", "for_each", "xfor",
    "class", "callback", "set", "sharedset", "repeat", "begin", "select", "with",
    "$if", "$ifdef", "property", "propset", "propget", "method", "constructor", "case",
    "cmdhandler", "msghandler"
END SET

MrBcx

Quote from: Quin on January 22, 2025, 03:26:04 PM
Quote from: MrBcx on January 15, 2025, 09:14:24 PM
Quote from: Quin on January 15, 2025, 09:02:16 PM
MrBCX,
Why is it that commands inside a CMDHhandler or MSGHandler aren't indented like that of subs/functions when the beautify tool is ran over them?

It's possible, probable I think, that those keywords did not even exist at the time that the beautifier was created.
MrBCX,
I'm using these macros in my program heavily, and having the indentation break every time I try to beautify my code breaks my workflow, so I'm trying to fix it. However I seem to be doing something wrong, I added "cmdhandler" and "msghandler" to the very end of the list in the beautify file, but it doesn't work. I assume this is because the keywords have to be in a specific order, but I don't know what that order is.
Any suggestions?
Thanks!

Quin,

I suggest you abort that mission unless you enjoy working on puzzles with missing pieces.

Of all the parts of BED, I've found the code beautifier to be the most frustrating and confusing.

It really needs to be overhauled but I lack the time and motivation to take it on right now.