Did you identify the specific issues?

Yes, I noticed that when implementing the LSP plugin, see below.

I agree it's sometimes an issue and I believe I've suffered from it with e.g. CSS, bit also that unconditionally using the filetype value everywhere might cause other issues -- or maybe it wouldn't?

I think we should make sure that user-specified wordchars always contain all characters from GEANY_WORDCHARS no matter what crazy thing the users define. Apart from that it should be fine IMO except one thing - some languages allow unicode characters to be part of identifiers too and we should possibly allow them as well.

Anyway, identifying the actual problems that this causes would.be great :)

What's below are only the problematic cases - I'm skipping those that seem to be OK. The biggest offender is read_current_word() from which it propagates to other functions.

1st level - direct usage of GEANY_WORDCHARS:
https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/editor.c#L1691

2nd level - usage of read_current_word():
https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/editor.c#L1743

https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/editor.c#L1793-L1794

https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/editor.c#L2222

3rd level - usage of editor_get_word_at_pos():
https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/editor.c#L703

3rd level - usage of editor_find_current_word():
https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/editor.c#L292

https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/editor.c#L2002

https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/symbols.c#L1715

https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/keybindings.c#L1666

In addition, there's also https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/editor.c#L1752
I haven't checked the places where this function is used and why it's used instead of editor_find_current_word() and whether this is correct.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/issues/4038/2466849303@github.com>