Little issue with Search and context menu on the result on different paths

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
jonathanpoulin
Junior Member
Junior Member
Posts: 28
Joined: 2020-12-19, 12:09 UTC
Location: Saint-Marc-des-Carrières, QC Canada
Contact:

Little issue with Search and context menu on the result on different paths

Post by *jonathanpoulin »

Hi,

I found that after a Search (with Alt + F7), if I open the result with the button "Feed to listbox" and then select at least 2 files that aren't from the same directory, the contextual-menu doesn't show up Notepad++. I did the test using File Explorer and there it works as expected, Notepad++ is on the menu. Is it a Total Commander bug or I'm doing something wrong?

This is useful for me by example when I want to open all .csproj files (C# project files) for edition in a directory structure to do some operation on them.

The workaround right now is to drag and drop the files onto the Notepad++ instance.

By the way, with the selection, if I hit F4, it opens only the file under the cursor (not necessarily one of the selected files). Is there a hotkey to open all the selected files?

Thanks
Jonathan
Thanks,
Jonathan Poulin
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Little issue with Search

Post by *ghisler(Author) »

When you select more than one file in "Feed to listbox", TC has to pass full path lists to the context menu function, because the files could be from different drives and/or directories. Not all shell extensions are able to handle full paths. I guess that the Explorer somehow tries to find a common base directory when multiple files are selected.
Author of Total Commander
https://www.ghisler.com
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: Little issue with Search

Post by *sqa_wizard »

Not all shell extensions are able to handle full paths.
This was my first guess too, but it is more strange.
I did some tests and found different behaviour:

All done on multiple files selected in "Feed to listbox" (note: current dir is d:\sub1)
1. d:\sub1\file.txt
2. d:\sub1\sub2\file.txt
=> "Open with Notepad++" is available at context menu for both files

Just changed sorting order of file name

1. d:\sub1\sub2\file.txt
2. d:\sub1\file.txt
=> "Open with Notepad++" is missing at context menu for both files.
#5767 Personal license
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Little issue with Search

Post by *Usher »

It seems that there are two different context menus in use:
1. Context menu for files is shown when selected files are in the same directory or the first selected file is in the current directory the highest level directory in search results.
2. Context menu for directories is shown for other cases, when:
  • the first item on the list of selected files isn't in the current directory the highest level directory in search results;
  • and selected files are located in more than one directory.
Edit: Fixed ambiguous wording.
Last edited by Usher on 2021-01-24, 19:37 UTC, edited 1 time in total.
Andrzej P. Wozniak
Polish subforum moderator
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Little issue with Search

Post by *gdpr deleted 6 »

2Usher
i am afraid your conclusion wrt to selected files being or not being in the current directory or in more than one directory is not correct.

If you create the following directory tree with txt files:

Code: Select all

X:\1\2\a.txt  <--- with smallest file size
X:\1\2\3\c.txt   <--- with largest file size
X:\1\2\3\4\b.txt <--- with "middle" file size
and then making X:\1 your current working directory when searching for *.txt files, the file context menu with Notepad++ can still be shown, despite none of the found and selected files being in X:\1.

Based on my example, if you make the file panel with the found files look like this, with the files ordered by size ascending:

Code: Select all

X:\1\2\a.txt
X:\1\2\3\4\b.txt
X:\1\2\3\c.txt
and selecting them will show the file context menu. Note that both the second and third item are in sub-diretories with respect to the first item, whereas the third item is not a in a sub-directory with respect to the second item.

If you only select the last two items (b.txt and c.txt), you'll notice that a different context menu (i guess the directory context menu) appears.

This makes me think that there is some processing of the selected file paths, checking if all selected file paths are in the same or sub directory with respect to the first item in the selection, regardless of the directory (or directories) the search was started in. Don't ask me if there is a meaningful reason behind this behavior, though...


And just to make sure, if you use descending size ordering:

Code: Select all

X:\1\2\3\c.txt
X:\1\2\3\4\b.txt
X:\1\2\a.txt
and select all, the different context menu (the directory context menu, i guess) is shown.
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Little issue with Search

Post by *Usher »

2elgonzo
Use "the highest level directory in search results" instead of "the current directory". See my edit. I won't investigate this issue in the nearest future…
Andrzej P. Wozniak
Polish subforum moderator
Post Reply