vigna / ne

ne, the nice editor
http://ne.di.unimi.it/
GNU General Public License v3.0
473 stars 33 forks source link

Autocomplete with empty prefix causes ne to hang (macos) #88

Closed soveran closed 2 years ago

soveran commented 2 years ago

When trying to autocomplete with an empty prefix, ne stops responding. I added a guard to actions.c in case AUTOCOMPLETE_A so that it returns if strlen(p) is zero and it works as I want it to, but maybe you prefer some other fix.

vigna commented 2 years ago

Oh wow. I'm stunned we never hit this before. Can you suggest a replication path? With 3.3.1 I'm trying to make it hang but I'm unable to do it.

soveran commented 2 years ago

I will share a file tonight, along with the steps to reproduce it. Thanks!

soveran commented 2 years ago

OK, there are two factors: autocomplete has to be executed without a prefix and the file must contain some unicode character. For example:

foo ≠ bar
_

(Where _ represents the cursor)

If I then try to autocomplete, the program hangs. My workaround of not allowing autocomplete with an empty prefix did not address the real issue.

vigna commented 2 years ago

OK, there must be something weird happening with UTF-8 encoding...

utoddl commented 2 years ago

89 should address this issue.

soveran commented 2 years ago

I've just tested it and it looks like it is solved 👏