question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Neovim loses filetype when file is closed then reopened

See original GitHub issue

Basically, when you close then reopen a file, filetype is not set. I have only tried this on WSL.

Reproduction steps:

  1. Set up environment:
mkdir test
cd test
touch foo.py
code .
  1. Click on foo.py in the project tree to open the file
  2. Run set ft? and observe output filetype=python
  3. Close the current tab you’re using to view foo.py
  4. Click on foo.py in the project tree to open the file again
  5. Run set ft? and observe output filetype=

Expected behavior: set ft? still outputs filetype=python after closing and reopening the file.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jrpearcommented, Jan 4, 2021

Oh I wasn’t aware. Fixed on my machine!

0reactions
asvetliakovcommented, Jan 4, 2021

@jpear1 you don’t need to install from source. 0.0.76 is the latest master

Read more comments on GitHub >

github_iconTop Results From Across the Web

Focused buffer randomly loses syntax highlighting #17237
Randomly, when I switch OS focus to NeoVim/Tmux/Alacritty, the current buffer (only) has lost syntax highlighting. It's is infrequent. Maybe 4 ...
Read more >
How to revert to "close file when buffer closes" behavior in ...
The "old" Vim behavior was to close the file when all associated buffers are closed. With the newest version of Neovim, it appears...
Read more >
If I accidentally closed a buffer in Vim, how can I reopen it ...
I'm assuming you meant setting stuff like the number of lines or the syntax colouring etc. Go to your command shell and type:...
Read more >
How to reopen last closed tab? : r/neovim - Reddit
The file is still loaded as a buffer in vim when its window is closed, so I never lose any unsaved work.
Read more >
In neovim, how do I get a file to open at the same line number I ...
Show activity on this post. This code is valid in vim. It is the syntax of vimscript. It can also work in neovim's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found