antonmedv / fx

Terminal JSON viewer & processor
https://fx.wtf
MIT License
19.08k stars 438 forks source link

Append newline to autocomplete input if it's missing (fixes #303) #304

Closed MarvinJWendt closed 7 months ago

MarvinJWendt commented 7 months ago

This fixes #303 by appending a newline to the autocomplete file input when it is missing. The fix is tested and seems to work.

MarvinJWendt commented 7 months ago

Offtopic

While browsing trough the code, I found this variable in the same file, which is instantly overwritten: image

Maybe worth to remove the first assignment.

MarvinJWendt commented 7 months ago

Test input

This file can be used to test the autocomplete: state.json

It's missing the \n at the end.

Sometimes it's hard to reproduce, as many IDEs put a \n at the end of files automatically when saving (which isn't visible, as only \n\n will create a new visual line).

antonmedv commented 7 months ago

Yes, var is not needed)