Skip to content

[Windows] Node path could have different case if the initial directory is entered in all lower case #1241

Closed
@char101

Description

@char101

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.

Steps to Reproduce the Issue

  1. Edit a directory using lower case drive name (e.g. tab edit c:\dir)
  2. Try to open a file or directory two level below the initial directory

Current Result (Include screenshots where appropriate.)

Some file and/or directory cannot be opened depending on whether the node path is stored with lower case drive name or upper case drive name.

Expected Result

File and or directory can be opened.

The Cause

  • The initial glob of path names uses the directory name as entered by the user (c:\dir), this results in path names starting with lower case drive name (or whatever case the user entered since path names are case insensitive on Windows)
  • The glob for file names under the subdirectories of the initial directory is done using relative path to cwd (which have been set to c:\dir, but getcwd() return its properly cased name C:\dir), thus when joined it results in different case C:\dir\file
  • This causes mismatch between the stored path names inside the tree nodes.

This is one example if I put call confirm('skipped '.a:path.str().' | '.self.path.str()) in tree_dir_node.vim#L125.

2021-04-25 15_56_34-Window

Although a:path should be under self.path, it is skipped because the drive name cases are different. NERDTree was opened by running tabed e:\projects\pip.

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