Skip to content

Moving a file with NERDTreeAutoDeleteBuffer=1 results in the file type being removed and breaks syntax highlighting #1069

Closed
@nickjj

Description

@nickjj

Self-Diagnosis

  • I have searched the issues for an answer to my question.
  • I have reviewed the NERDTree documentation. :h NERDTree
  • I have reviewed the Wiki.
  • I have searched the web for an answer to my question.

Environment (for bug reports)

  • Operating System: Ubuntu 18.04 (LTS)
  • Vim/Neovim version: VIM - Vi IMproved 8.0
  • NERDTree version, found on 1st line in NERDTree quickhelp ?: 6.3.0
  • vimrc settings
    • NERDTree variables
    let g:NERDTreeShowHidden=1
    let g:NERDTreeAutoDeleteBuffer=1
    • Other NERDTree-dependent Plugins
      • jistr/vim-nerdtree-tabs
      • ryanoasis/vim-devicons
      • tiagofumo/vim-nerdtree-syntax-highlight
      • Xuyuanp/nerdtree-git-plugin
      • [] Others (specify):
    • I've verified the issue occurs with only NERDTree installed.

Steps to Reproduce the Issue

  1. echo "## Hello" > /tmp/a.md
  2. vim /tmp/a.md
  3. Toggle NERDTree open and select the file
  4. mm to move the file
  5. Change the file name from a.md to b.md

Current Result (Include screenshots where appropriate.)

The buffer correctly switches to b.md but the file type has been removed which in turn removes the syntax highlighting.

Now we need to run either set ft=markdown or :e manually and things work again.

Expected Result

The buffer would have b.md open with the file type set to Markdown which in turn has correct syntax highlighting without having to manually do anything extra.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions