-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
NERDTreeFind: Exception not caught: NERDTree.InvalidArgumentsError: <file> should be under <path> #1344
Comments
…alidArgumentsError: <file> should be under <path>
…alidArgumentsError: <file> should be under <path>
@dangibson |
I fixed the issue I had and it's been working fine for me. I didn't think I closed it. |
Oh, I don't know why I thought it was closed, what do you think about using the same flag in your PR? do you think it's a good idea? |
I would probably default to assuming it is case insensitive instead of sensitive. While that is technically wrong for linux, it's unlikely people would have a file or folder called "abc" and another called "Abc" in the same folder. Although the end result is the same, the difference is that on Windows you wouldn't have to set the flag manually, and on linux you probably wouldn't need to change it so it would be a slightly better out of the box experience. If you have a pull request that resolves the issue then I'm happy to scrap mine - no credit needed. I resolved the issue for me and submitted a PR but nothing happened with it and I don't really have an interest in working further on it. |
I've set it to Case sensitive by default to make it backward compatible, this way we don't break anything for users who are used to this behavior and may have put their workspace(although stupid) around this thing. if nerdtree#runningWindows()
let g:NERDTreeCaseInsensitiveFS = 1
elseif has('gui_mac') || has('gui_macvim') || has('mac') || has('osx')
let g:NERDTreeCaseInsensitiveFS = 1
else
let g:NERDTreeCaseInsensitiveFS = 0
endif If we assume case sensitivity wrong in critical places it can cause files to be overwritten which is not a good thing to happen, Let me know what you think about it. |
I think on Windows / mac it should default to insensitive without the user needing to explicitly set it since that is what the users would reasonably expect to happen. If it defaults to sensitive then they would consider it a bug and spend time searching for the solution. |
I don't have a strong take on whether or not this flag should be on by default or not, But I think you agree with the fact that this flag is needed in the first place, Right? |
The flag is a good idea - testing a flag is easier than testing is windows or is osx or is mac or is macvim etc |
Windows, NERDTree 6.10.16
Open a folder in NERDTree, c:\dev. This has a sub folder called Project - ie c:\dev\Project.
Open a file in vim, c:\dev\project\file.txt
Note the path is called "c:\dev\Project" while the file is opened as "c:\dev\project\file.txt" - casing is the issue here.
Run command NERDTreeFind
You get an error:
Error detected while processing function 28_findAndRevealPath[47]....
E605: Exception not caught: NERDTree.InvalidArgumentsError: c:\dev\project\file.txt should be under c:\dev\Project
I'll submit a pull request to fix this.
The text was updated successfully, but these errors were encountered: