Find in File use entered path (case insensitive)
-
I try it in Version 8.2:
If I enter a directory manually with “Browse in files” without paying attention to the effective capitalization, I can open a found file with a double-click. The file will be opened under my entered path. The path I entered will be used instead of the case-sensitive effective path. Basically no problem, but for example the NppFTP plugin cannot save the file on my FTP-Server because the incorrect upper and lower case letters. Therefore, when opening a file, it should not use my entered path, but the effective path of the file.
The effective existing path ist C:\Users\marti\test. C:\Users\marti\TEST doesn’t exist.
-
@martin-oberhänsli said in Find in File use entered path (case insensitive):
The path I entered will be used instead of the case-sensitive effective path.
I see that you have Follow current doc. ticked:
With that ticked, when you are editing (in the active editing pane’s tab) and you initiate Find in Files (with Ctrl+Shift+f, say), then the Directory box contents get overwritten with that path of the active file.
But… sometimes one leaves the Find in Files window open and works with several tabs in different paths. In that case, to refresh the Directory box, untick Follow current doc. and then re-tick it. The currently active file’s path will then be put there.
Unless there’s more to the problem, I’d think that would solve it.
-
@martin-oberhänsli said in Find in File use entered path (case insensitive):
The effective existing path ist C:\Users\marti\test. C:\Users\marti\TEST doesn’t exist.
Windows is case-insensitive with regard to filenames. Windows will display the name as whatever case you happened to use when you initially saved it, but will allow accessing the file when typed as any case. Notepad++ isn’t part of that equation at all. Thus, if you are typing the filename rather than selecting with file-selector tools, the onus is on you, the one typing, to type the name “properly”, and the Windows OS provides no protection. Notepad++ is just letting Windows OS be Windows OS.
It looks like while I was answering, Alan gave a suggestion which will help you work around this limitation in your operating system – so Notepad++'s pretty awesome, to be able to help you overcome design decisions in the OS. WooHoo!
-
My use case is that I never type INTO the Directory box. I always have Follow current doc. ticked for automatic entry, and for any other use I’m pasting data into the Directory box that was copied from another source.
The moral of that story is that you really can’t get a path wrong with those methods.
-
@alan-kilborn said in Find in File use entered path (case insensitive):
With that ticked, when you are editing (in the active editing pane’s tab) and you initiate Find in Files (with Ctrl+Shift+f, say), then the Directory box contents get overwritten with that path of the active file.
But… sometimes one leaves the Find in Files window open and works with several tabs in different paths. In that case, to refresh the Directory box, untick Follow current doc. and then re-tick it. The currently active file’s path will then be put there.
Unless there’s more to the problem, I’d think that would solve it.I only discovered the “error” because, exceptionally, I wrote in the field myself. I believe that a file should be opened with the real path and not with a path I typed. That a file is found despite my “wrong path” is actually nice.
-
I’m not sure at all what you mean here.
@martin-oberhänsli said :
I believe that a file should be opened with the real path and not with a path I typed.
I don’t know that this makes sense.
What you type is what is opened as a directory…or it tries to.
If it is a non-existent path it will do nothing more.That a file is found despite my “wrong path” is actually nice.
Not sure how this could even happen.
-
Note that you have a tricky requirement. You say “I may be using wrong case, fix it for me.”
But, if you are looking for Files/sample/foo.c, a Linux file system may have all of these:
Files/SAMPLE/FOO.c
fILES/sample/foo.c
files/sample/foo.cWhich of them do you want to open/overwrite?
You could want Notepad++ to carefully check along the entire path that there are no-case duplicate, but that is a very tricky thing to do. And since you claim your problem is with NppFTP (which I never used) I am not even sure if it is possible.
The thing that Notepad++ may be able to do is to add case-sensitive path option for find in files. Validate the directory you entered is a case match for an actual directory and FAIL if it is not. Allowing you to fix the problem earlier rather than later.
That way trying to search in Files/SAMPLE when there is only files/sample in the file system will fail. It is still a tricky feature because Notepad++ will need to open directory by directory and do a case sensitive compare against folders that Windows will find regardless of case.
If you want it open a feature request on github.For now, just be careful with your cases.
-
@gstavi said in Find in File use entered path (case insensitive):
For now, just be careful with your cases.
or @Martin-Oberhänsli should stop manually typing the path, and just use “follow current directory” (as @Alan-Kilborn already suggested) or the
...
directory chooser or RightClick > Current Dir Path to Clipboard then paste the path into the Directory field – any of which would always get the right case for the directory. -
@PeterJones
Follow current directory is part of “be careful with your cases”. It seems to work, probably since Windows open file dialog fixes it. Not sure exactly what will happen over SAMBA share if there are actually case conflicts.RightClick > Current Dir Path to Clipboard - doesn’t work. If a file was opened as described, from Find-in-Files with bad path case, Notepad++ just copies the wrong-case path it registered for the file.