Alexey-T / CudaText

Cross-platform text editor, written in Free Pascal
Mozilla Public License 2.0
2.39k stars 166 forks source link

Sometimes, multi-line inputs (`+`) is suddenly enabled in find bar #5532

Closed pintassilgo closed 1 month ago

pintassilgo commented 1 month ago

I've had this issue for a long time. Sometimes I get annoyed because multi-line inputs (button +) is suddenly enabled for me. I never used that option and I'm sure I didn't pressed Ctrl+Alt+M. Remembering I use "find_ctrl_enter": false,.

Unfortunately, still today I don't know reliable steps to reproduce, I don't know yet what exactly is causing this.

Who knows, maybe with this description you're able to find the issue in code...

If not, when I understand what is happening I will comment here.

(By the way, i believe "multi-line input" would fit better than "multi-line inputs". There's only one find bar input.)

Alexey-T commented 1 month ago

i believe "multi-line input" would fit better

fixed.

Alexey-T commented 1 month ago

I added more checks for "find_ctrl_enter" so it's maybe fixed.

pintassilgo commented 1 month ago

Thanks. Just saying I don't press Ctrl+Enter when this happens. I only pressed Ctrl+F, and for some reason Cuda enables +, enlarging find input to multiline.

Alexey-T commented 1 month ago

beta updated. my guess: now you cannot repro this bug, as you have "find_ctrl_enter": false. you can repro this only when "find_ctrl_enter" is true.

Alexey-T commented 1 month ago

inputS is for 2 inputs: find / replace-with. but changed.

pintassilgo commented 1 month ago

Thanks. I don't know how to easily reproduce this issue, so I'll close supposing as fixed. If someday it happens again, I'll reopen.

pintassilgo commented 1 month ago

It just happened again, unfortunately it isn't fixed.

I don't have STR yet, but it's usually something like this: I switch to Cuda window, I click to a different tab, I press Ctrl+F to paste something and suddenly + is enabled with large find input...

Alexey-T commented 1 month ago

Find dlg turns on '+' if "find_suggest_sel":true and you call Find dlg for multiline sel. is it the case?

pintassilgo commented 1 month ago

It might be. I'll need to disable this option if there's no way to not enable multiline automatically.

Anyway, I suggest at least one thing:

Most of the time I need to copy and paste an entire line. To do that without needing to press Enter, I place the caret at the end of the line and press Shift+up, so that I copy the line break + the line below, aka \nlinecontent.

This find_suggest_sel option must trim linebreaks at the edges of the selection.

So if I copy a line starting from the end of the line above, it SHOULDN'T enable multiline, because the selected content is a single line.

In other words, when visible selection is a single line find_suggest_sel shouldn't enable multiline.

Alexey-T commented 1 month ago

Very easy to do, so done.

pintassilgo commented 1 month ago

Thanks. I disabled find_suggest_sel, let's see if this was the issue.