Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete unknown value in set filetype ... #3214

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

dmaluka
Copy link
Collaborator

@dmaluka dmaluka commented Mar 24, 2024

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.

`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.
Copy link
Contributor

@Andriamanitra Andriamanitra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change, works as expected.

and executing set filetype unknown does what is expected: it forces filetype autodetection

That's definitely not what I thought it would do, but that's beside the point 😆

@dmaluka
Copy link
Collaborator Author

dmaluka commented Mar 25, 2024

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.

It is also a documented special value of the `filetype` option.
@dmaluka
Copy link
Collaborator Author

dmaluka commented Mar 25, 2024

...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 d64c944 to autocomplete it as well, and pushed #3216 to fix its behavior.

@dmaluka dmaluka merged commit d96f060 into zyedidia:master Mar 25, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants