giuspen / cherrytree

cherrytree
https://www.giuspen.net/cherrytree/
Other
3.29k stars 457 forks source link

Mouse double click does not select leading and trailing slashes #2481

Open 4njul1 opened 2 months ago

4njul1 commented 2 months ago

Version, Operative system CherryTree v1.1.2 on Ubuntu v22.04.4

Describe the bug When I select text with leading and trailing slashes with a mouse double click the first and last slash are not selected. For example a double mouse click on /foo/bar/ will only select foo/bar.

Thank you for your work on this great software, I use it daily!

gitvectors commented 2 months ago

On Ubuntu 22.04 I use mouse triple click in CT 1.1.0.

4njul1 commented 2 months ago

Triple click selects the entire line for me. If I for example want to change the path in a command, I have trouble selecting it with mouse clicks.

giuspen commented 2 months ago

I would have advised to try and configure in the preferences dialog which characters are included with the double click; the fact though that the middle slash is included and the others are not doesn't seem right, I'll have a look

giuspen commented 2 months ago

I had a look, the non alphanumeric characters are stripped on purpose from the beginning/end. We have to consider for example the case of having the dot configured for selection, when you double click on "one.two." you likely don't want the trailing dot selected. One solution is to hardcode a list of characters that we don't want to strip from the beginning/end, another is to hardcode the only characters that we want to strip from the beginning/end, the third possibility is to allow configurability of not only one list of characters but two. Comments welcome.

4njul1 commented 2 months ago

Thanks for having a look into it! I see that in some cases it would make sense to strip these characters from the beginning or end of string. I think a configurable list would be great! I often select absolute paths where it would be nice to have the leading slash included.