zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
24.4k stars 1.16k forks source link

Autocomplete `unknown` value in `set filetype ...` #3214

Closed dmaluka closed 3 months ago

dmaluka commented 3 months ago

unknown is a valid value for the filetype option (and executing set filetype unknown does what is expected: it forces filetype autodetection). So let's add unknown to the autocomplete suggestions for filetype, along with actual filetypes.

dmaluka commented 3 months ago

Help says:

* `filetype`: sets the filetype for the current buffer. Set this option to
   `off` to completely disable filetype detection.

    default value: `unknown`. This will be automatically overridden depending
    on the file you open.

So, it does not explicitly say that unknown gets automatically overridden even when setting it manually with set filetype unknown, but one could guess so. :)

...Hmm, the off value is also documented. And unlike unknown, it doesn't work quite as expected: the filetype does change to off, but the syntax highlighting does not disappear.

dmaluka commented 3 months ago

...Hmm, the off value is also documented. And unlike unknown, it doesn't work quite as expected: the filetype does change to off, but the syntax highlighting does not disappear.

Pushed https://github.com/zyedidia/micro/pull/3214/commits/d64c9443f5f7f94133297b3a34ee0e9a892f1ec8 to autocomplete it as well, and pushed https://github.com/zyedidia/micro/pull/3216 to fix its behavior.