CeleritasCelery / emacs-native-shell-complete

Completion in shell buffers using native mechanisms
GNU Lesser General Public License v3.0
98 stars 9 forks source link

Autocompletion breaks if there is a saved ansi-color fragment #1

Closed chaorace closed 4 years ago

chaorace commented 4 years ago

https://github.com/CeleritasCelery/emacs-native-shell-complete/blob/e46a936a7239621a8ff55af007a10079c4f2b817/native-complete.el#L122

native-complete-get-completions calls ansi-color-filter-apply, which will apply any ansi color sequences that were previously left unfinished (see documentation for variable ansi-color-context). The function doesn't seem to be expecting this, because it always returns nil in this situation, even when there are valid completions.

Because ansi-color-context persists until the fragment is closed, autocomplete becomes completely broken until ansi-color-context is cleared or the buffer is killed.

I was able to resolve this issue for myself by simply removing (ansi-color-filter-apply). I'm not really sure why we're even attempting to apply ansi color to autocompletion items in the first place!

chaorace commented 4 years ago

Submitted a PR with the fix I am using. I'm operating under the assumption that ansi-color-filter-apply is not actually serving any useful purpose and can be safely removed.

chaorace commented 4 years ago

Resolved in commit 5ba8bff2ee089f05cf2c2ae1a1bcf8f31807894a