Search code examples
filepathuser-experiencekomodoedittabbedname-collision

Show file path in the tab when there are several files with the same name


Please take a look at the screenshot:

enter image description here

As you can see there are 3 tabs with 3 different "index.xml" files opened. I've been looking for an option to show something like "folder/file.extension" in the tabs name to be able to differentiate the files, but I can't find anything.

Using "Go to file" is not very helpful either, because the name of the path for all the files is so long that I can't see the folder containing the files.

Any ideas?

Cheers

UPDATE:

It's possible to increase the 'Go to file' panel width using the mouse and Komodo will remember the size in the future. That helps!


Solution

  • We added the OpenFiles pane specifically for this purpose, please check out View > Tabs & Sidebars > Open Files.

    This is what my pane looks like with several files with the same name open:

    Open Files Pane

    Additionally you can specify your own patterns, currently this is done programmatically via a macro but in the future you will be able to do this through the UI.

    For example, I use the following macro for Komodo development:

    ko.openfiles.groupers.byPattern.patterns = [
        {
            name:       'Plat - %match% - config',
            pattern:    /\/skin\/plat\/([a-z0-9_-]*)\/_config\//i
        },
        {
            name:       'Plat - %match%',
            pattern:    /\/skin\/plat\/([a-z0-9_-]*)\//i
        },
        {
            name:       'Module - %match% - skin config',
            pattern:    /\/(?:module|modules)\/([a-z0-9_-]*)\/skin\/_config\//i
        },
        {
            name:       'Module - %match%',
            pattern:    /\/(?:module|modules)\/([a-z0-9_-]*)\//i
        },
        {
            name:       'Skin - %match% - config',
            pattern:    /\/chrome\/skins\/([a-z0-9_-]*)\/_config\//i
        },
        {
            name:       'Skin - %match%',
            pattern:    /\/chrome\/skins\/([a-z0-9_-]*)\//i
        },
        {
            name:       'Iconset - %match%',
            pattern:    /\/chrome\/iconsets\/([a-z0-9_-]*)\//i
        },
        {
            name:       'Component - %match%',
            pattern:    /\/(?:component|components)\/([a-z0-9_-]*)/i
        },
        {
            name:       'Locale',
            pattern:    /\/locale(?:\/|$)/i
        },
        {
            name:       'Skin',
            pattern:    /\/skin(?:\/|$)/i
        },
        {
            name:       'Module',
            pattern:    /\/(?:module|modules)(?:\/|$)/i
        },
        {
            name:       'Component',
            pattern:    /\/(?:component|components)(?:\/|$)/i
        },
    ];
    
    ko.openfiles.reload(true);
    

    You can read up on macro's here: http://docs.activestate.com/komodo/8.5/macros.html#macros_writing

    Using the above macro I need to make sure I have the "Group By Pattern" option selected, then I just run the macro and the same files you see in my above screenshot will be grouped according to the patterns I specified:

    openfiles pane with patterns

    Note that this requires the latest version of Komodo (8.5).

    Also note that if you use the Open Files pane you may find that you do not need the regular tabs anymore, you can disable these under "View > View Editor Tabs".

    Hope that helps, good luck!