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

filetype not detected in v0.46.0-20240102.233758 #1045

Open
songcai opened this issue Jan 5, 2024 · 12 comments
Open

filetype not detected in v0.46.0-20240102.233758 #1045

songcai opened this issue Jan 5, 2024 · 12 comments

Comments

@songcai
Copy link

songcai commented Jan 5, 2024

Since v0.46.0-20240102.233758, VimR has problem detecting filetypes. After opening a new VimR process, when I open the first file, the filetype is properly detected and syntax highlighting works properly. However, when I open any other file after the first one, the filetype is not detected. If I use ":set filetype" in VimR, I get "filetype=". As a consequence, syntax highlighting does not work at all.

I have never had such a problem in earlier versions.

@mgrubb
Copy link

mgrubb commented Jan 9, 2024

I'm having the reverse of this problem. When I open one file the file detection isn't triggering, but if I open subsequent files in the same window, they all detect properly. (same version as reported above) on macOS 13.6.3 22G436 x86_64.

@georgeharker
Copy link
Collaborator

I'm sorry, I can't repro this.

@songcai
Copy link
Author

songcai commented Jan 12, 2024

I unloaded all plugins and removed all personal settings, but still have the problem. The following is a minimal example:
(1) Make sure that there is nothing in $HOME/.config/nvim/init.vim file (i.e., make it an empty file). This way, I know that nothing outside VimR itself is having an effect.
(2) make a "test.md" file with the following single line as content, and save:
* Some text
(3) Quit VimR 0.46.0 completely if you have it open. Then double click test.md to open it using VimR 0.46.0. You should be able to see colors for the HTML code part. And if you use ":set filetype", you should see "filetype=markdown".
(4) Close the file but do not quit VimR 0.46.0. Then open the same file again using VimR 0.46.0. This time I cannot see any color, and if I use ":set filetype", I get "filetype=" without "markdown".

I tested on a Macbook Pro and a Macbook Air, both with Intel CPU and running Sonoma 14.2.1. On both computers, I get the same result. I have the same problem on the nightly build, but I do not have this problem in VimR 0.45.5. I saw "Improve rendering performance slightly" in the release note of 0.46.0 and I wonder if this note is related to the problem.

@georgeharker
Copy link
Collaborator

Are there any messages (:messages) sometimes issues with startup files don't show obviously

@songcai
Copy link
Author

songcai commented Jan 12, 2024

There are no messages.

@songcai
Copy link
Author

songcai commented Jan 12, 2024

I just realize that the content of the "test.md" file in (2) of my minimal example is not showing correctly because it has HTML code. I am attaching the file:
test.md

@carlmueller
Copy link

This bug appears to be fixed in Version 0.46.1 (20240114.181346).

@songcai
Copy link
Author

songcai commented Jan 22, 2024

The bug remains in Version 0.46.1 (20240114.181346) for me.

@rainux
Copy link
Contributor

rainux commented Feb 19, 2024

I did a completely clean install of VimR (AppCleaner automatically remove the preferences .plist file and state folder of VimR), move away ~/.config/nvim, ~/.local/share/nvim, ~/.local/state/nvim, the problem still persist.

It is not always can't detect filetype, it comes randomly and make debug a bit harder.

@mageekguy
Copy link

mageekguy commented Apr 3, 2024

Hi everyone!
I have exactly the same problem: Filetype is set to empty string so there is no syntax highlighting (I'm using 0.46.1).

@mageekguy
Copy link

Hi!

Maybe related to neovim/neovim#19216.
FYI, set g:do_legacy_filetype=1 in my init.vim seems to have fixed the problem.

@carlmueller
Copy link

After adding g:do_legacy_filetype=1 to init.vim and starting vimr, I get the message Pattern not found: do_legacy_filetype=1 and it doesn't fix the problem for me.

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

No branches or pull requests

6 participants