Open tomxp411 opened 2 years ago
may i suggest also Ctrl+q to exit? I use this often and was actually trying to fix it myself but i gave up bc im not very good with navigating the QB64 source code.
The section that does find/replace is actually a few lines after that, at 1830..1833;
Hmm... I thought I just added a second key sequence to the existing find/replace code. I'll re-check that. ** My bad. I had to merge in my change from the release version, because you've added a lot in the dev branch. You're right - I changed the "Find" line, rather than the "Find And Replace" line. Fixed.
For ^L, you might wanna cater for when there's an active selection (what do other IDEs do in that case?)
Notepad++ and Visual Studio both delete every line that has selected text, including the line with the cursor (whether or not text on the cursor line is selected.) So that sounds like the approach to take. I haven't dug into QB64's text selection mechanism yet, so I'll take a look at that tonight.
I have updated the source file. The ^L shortcut now checks the ideselected flag and counts the number of selected lines. It removes all selected lines and checks on each iteration to ensure the cursor is still on a valid line and that there is at least one line in the buffer. (The IDE crashes if you delete the only line. That's probably worth a future fix.)
I also moved the ^H shortcut to the correct code block (Search/Replace, rather than Search.) I guess I should not be merging two different branches of code at 2 AM.
I saw a request for ^Q by auowt. PM me on the forum or via Discord and I'll show you how to add your own hotkeys.
Added another fix. This moves the cursor to the start of the selection. Previously, if you selected lines 11-15 and then deleted them, the cursor would still be on line 15. This change moves the cursor to line 11.
added Delete Line hotkey (Control+L) added a second keybind for Search+Replace (Control+H)
These two hotkeys are common in Windows code editors (Visual Studio, Notepad++), and I find myself deleting lines a lot. Same with Search/Replace. ^H is easier to hit than Alt+F3, and it's also the standard binding in all of the editors I use regularly.