I cannot get this to work. MacOS Sequoia; Xojo 2025 r1.
Am I typing this wrong? Or misreading this. Does it work for others?
I cannot get this to work. MacOS Sequoia; Xojo 2025 r1.
Am I typing this wrong? Or misreading this. Does it work for others?
I love this little feature and have been using it for a while.
But I do just Shift+Return
(no ā). Thatās just the way itās always been for me on macOS.
Not sure why the documentation says otherwise.
It works with Opt + Shift + Return or only Shift + Return.
Had no idea this feature existed. Thanks for creating this thread and calling attention to it. Great little timesaver!
I always hated this shortcut because Iāve never intentionally used it, you canāt disable it, and I have a standard for closing if statements.
I have the opposite experience. Wanting and trying to use this feature a lot, but there are too many times where it wonāt work, like when having a āselect caseā statement around the āifā block, the IDE often closes the āifā with an āend selectā, even though thereās already an āend selectā below.
Iām also angry when I want to close a loop while Iām at a single āifā line and the IDE prefers to convert the single line to a block rather than closing the loop, like here:
for i as Integer=0 to 1
if true then MessageBox "Test" 'Cursor here
Pressing shift-return will produce this:
for i as Integer=0 to 1
if true then
MessageBox "Test"
end if
While I wanted this:
for i as Integer=0 to 1
if true then MessageBox "Test"
Next
So, because Iām using shift-return a lot, Iām often needing to undo and type the end of loop manually; Iād prefer the IDE to detect an inline āifā and recognise itās a valid statement not needing to be reformatted.
Whereas, for those of us who dislike inline If statements, I find this handy when reformatting free code acquired here on the forum or a public repo.
So it becomes a feature, not a bug
Agreed. But Iāve found if you move the cursor to the right location (like one line below what you donāt want changed, or where the Select or If should end), then itāll work. Then, in most case itāll close the correct statement, whether a comment line, a Select Case or For loops.
FWIW, the IDE doesnāt look downward in your code when trying to figure out what the correct end block needs to be, only up. So the fact that āthereās already an End Select below the cursorā is not even considered.
I do understand that it has trouble with if statements inside select blocks. I run into that from time to time as well.