I just downloaded and used your Notepad++ stuff to help setup Notepad++ for QB64, and I wanted to take a moment to thank you for the hard work you went through putting everything together for everyone.
One trick which I did come up with, which you might want to consider implementing for your own use, is to:
1) Remove REM from the Comment Line Style in the User Defined Language set up.
2) In the Folder & Default tab, set yourself a very simple set of commands for folding code, using that REM statement. I configured mine for "REM BlockStart" and "REM BlockEnd".
Now, whenever I want a segment of code to be foldable, all I have to do is place the code I want to fold into the middle of those two commands, such as:
REM BlockStart: Function ProcessMenu
FUNCTION ProcessMenu$ (k AS LONG, active AS INTEGER)
'k is for the keyboard
'active is a return code for which menu we got the result from, in case someone makes multiple menus
' with the same options listed in the sub menus, such as PAINT -- Circle as one menu/submenu
' and then DRAW -- Circle as another menu/submenu.
' Both would just return "Circle" as our final choice, so we'd need to know which menu was active
' and where the command came from.
DIM Caption AS STRING
STATIC oldmouse AS INTEGER 'the old status of our left mouse button (up or down)
mb = _MOUSEBUTTON(1) 'shortcut key so I don't have to type _mousebutton(1) multiple times.
mx = _MOUSEX: my = _MOUSEY 'same here.
IF mb AND NOT oldmouse THEN 'we only need to check the menu IF we clicked the mouse button
oldmouse = mb 'placed here in case we exit early (which we can)
FOR i = 1 TO UBOUND(menu) 'check for mouse interactions
IF Menu(i).Layout AND Visible THEN 'only if a menu is visible do we check to see if we can do something with it.
x = Menu(i).Left: y = Menu(i).Top 'top and left
w = Menu(i).Wide: h = Menu(i).High
r = x + w: b = y + h 'bottom and right
IF mx >= x AND mx <= r AND my >= y AND my <= b THEN 'the mouse in over a visible menu
IF Menu(i).Active THEN 'if that window is active, return a result
IF Menu(i).Layout AND Hortizontal THEN
IF Menu(i).Layout AND Minimized THEN
Menu(i).Layout = Menu(i).Layout AND NOT Minimized
Menu(i).Active = 0
HideSubMenus
EXIT FUNCTION
ELSE
FOR j = 1 TO Menu(i).Options
oldpx = px
Caption = SCC(Captions(i, j))
px = px + _PRINTWIDTH(Caption)
IF mx >= oldpx AND mx <= px THEN 'we clicked on an item
Menu(i).Active = j
GOTO itemselected
END IF
px = px + _FONTWIDTH * 2
NEXT
END IF
ELSE 'It's a vertical menu
Menu(i).Active = (my - y) \ _FONTHEIGHT + 1
GOTO itemselected
END IF
ELSE 'if the menu we're over isn't active, then make it the active menu
Menu(i).Active = 1
FOR j = 1 TO UBOUND(menu)
IF j <> i THEN 'close all the other (non-main) menus.
IF Menu(j).Layout AND SubMenu THEN Menu(j).Layout = Menu(j).Layout AND NOT Visible
Menu(j).Active = 0
END IF
NEXT
END IF
END IF
END IF
NEXT
END IF
oldmouse = mb 'placed here in case we don't go into the mouse checking loop
FOR i = 1 TO UBOUND(menu)
IF Menu(i).Active THEN EXIT FOR
NEXT
IF i > UBOUND(menu) THEN EXIT FUNCTION'no menus active
IF GCC(Captions(i, Menu(i).Active), "É", p%) <> "" THEN
Menu(i).Active = Menu(i).Active + 1
ELSEIF GCC(Captions(i, Menu(i).Active), "È", p%) <> "" THEN
Menu(i).Active = Menu(i).Active - 1
END IF
SELECT CASE k
CASE 13
itemselected:
IF Captions(i, Menu(i).Active) = "ð" THEN
IF Menu(i).Layout AND Minimized THEN
Menu(i).Layout = Menu(i).Layout AND NOT Minimized
ELSE
Menu(i).Layout = Menu(i).Layout OR Minimized
END IF
ELSE
active = i
ProcessMenu$ = SCC(Captions(i, Menu(i).Active)) 'Strip the command code for the return name
CC$ = GCC(Captions(i, Menu(i).Active), "{", p%) 'but process the command code, if it's available
IF CC$ <> "" THEN
OpenSubMenu i, CC$
ELSE
'we clicked on something without a command code
'hide all the submenus which are open from the screen
HideSubMenus
END IF
END IF
Menu(i).Active = 0
k = 0 'keyboard process has been handled internally
EXIT FUNCTION
CASE 27, 100319
FOR i = 1 TO UBOUND(menu) 'Turn all menus inactive
Menu(i).Active = 0
NEXT
HideSubMenus 'and hide them
k = 0 'don't return a keycode back to the main program itself
EXIT FUNCTION
CASE 19200 'left arrow
IF Menu(i).Layout AND Hortizontal THEN
Menu(i).Active = Menu(i).Active - 1
IF Menu(i).Active < 1 THEN Menu(i).Active = Menu(i).Options
END IF
k = 0 'keyboard process has been handled internally
CASE 19712 'right arrow
IF Menu(i).Layout AND Hortizontal THEN
Menu(i).Active = Menu(i).Active + 1
IF Menu(i).Active > Menu(i).Options THEN Menu(i).Active = 1
END IF
k = 0 'keyboard process has been handled internally
CASE 18432 'up arrow
IF (Menu(i).Layout AND Hortizontal) = 0 THEN
Menu(i).Active = Menu(i).Active - 1
IF Menu(i).Active < 1 THEN Menu(i).Active = Menu(i).Options
recheckup:
IF GCC(Captions(i, Menu(i).Active), "É", p%) <> "" THEN
Menu(i).Active = Menu(i).Active - 1
IF Menu(i).Active < 1 THEN Menu(i).Active = Menu(i).Options: GOTO recheckup
ELSEIF GCC(Captions(i, Menu(i).Active), "È", p%) <> "" THEN
Menu(i).Active = Menu(i).Active - 1
IF Menu(i).Active < 1 THEN Menu(i).Active = Menu(i).Options: GOTO recheckup
ELSEIF GCC(Captions(i, Menu(i).Active), "Ì", p%) <> "" THEN
Menu(i).Active = Menu(i).Active - 1
IF Menu(i).Active < 1 THEN Menu(i).Active = Menu(i).Options: GOTO recheckup
END IF
END IF
k = 0 'keyboard process has been handled internally
CASE 20480 'down arrow
IF (Menu(i).Layout AND Hortizontal) = 0 THEN
Menu(i).Active = Menu(i).Active + 1
IF Menu(i).Active > Menu(i).Options THEN Menu(i).Active = 1
recheckdown:
IF GCC(Captions(i, Menu(i).Active), "É", p%) <> "" THEN
Menu(i).Active = Menu(i).Active + 1
IF Menu(i).Active > Menu(i).Options THEN Menu(i).Active = 1: GOTO recheckdown
ELSEIF GCC(Captions(i, Menu(i).Active), "È", p%) <> "" THEN
Menu(i).Active = Menu(i).Active + 1
IF Menu(i).Active > Menu(i).Options THEN Menu(i).Active = 1: GOTO recheckdown
ELSEIF GCC(Captions(i, Menu(i).Active), "Ì", p%) <> "" THEN
Menu(i).Active = Menu(i).Active + 1
IF Menu(i).Active > Menu(i).Options THEN Menu(i).Active = 1: GOTO recheckdown
END IF
END IF
k = 0 'keyboard process has been handled internally
END SELECT
FOR j = 1 TO Menu(i).Options
CC$ = GCC(Captions(i, j), "@", p%)
IF CC$ <> "" THEN
c = ASC(LCASE$(CC$))
IF k = c OR k = c + 32 THEN
ProcessMenu$ = SCC(Captions(i, j)) 'Strip the command code for the return name
CC$ = GCC(Captions(i, j), "{", p%) 'but process the command code, if it's available
IF CC$ <> "" THEN OpenSubMenu i, CC$ ELSE HideSubMenus
Menu(i).Active = 0
k = 0
END IF
END IF
NEXT
END FUNCTION
REM BlockEnd
That whole function is now collapsable, with only the "REM BlockStart: Function ProcessMenu" displaying in the program listing.
Notepad++'s collapsing is a little glitched with EXIT FUNCTION or EXIT SUB being parsed as a SUB/FUNCTION in regards to folding (and thereby screwing things up majorly), and "ELSE IF" and "ELSE" doesn't want to play nicely together, but you can still work around the process with just a little creative use with comments to create a folding block.
It works quite nicely for me, where I use ' for my remarks, and never really make use of REM. In a way, it's nice to repurpose that command and make it useful in my coding once more. ;)