Page 1 of 1

[Closed] Custom file associations: The ones at the bottom should override the ones at the top, not vice versa

Posted: 15 Aug 2022 15:46
by John_C
I would call it not a "wish" but a small UI fix.

Currently, when you open the Customize File Associations window (Ctrl+F9), custom file associations at the top of the list override custom file associations that are below them.

Code: Select all

So, if you consider .html files as "text" ones,
but you want to open them by default in Edge and not in Vim,
you will have:

html>%ProgramFiles%\Microsoft\Edge\Application\msedge.exe
{:Text}>C:\prgfiles\vim\vim90\gvim.exe
I would say this order doesn't make sense and it should be the opposite: custom file associations at the bottom of the list should override custom file associations that are above them.

Code: Select all

So, if you consider .html files as "text" ones,
but you want to open them by default in Edge and not in Vim,
you will need:

{:Text}>C:\prgfiles\vim\vim90\gvim.exe
html>%ProgramFiles%\Microsoft\Edge\Application\msedge.exe

Re: Custom file associations: The ones at the bottom of the list should override the ones above them, not other way arou

Posted: 15 Aug 2022 16:11
by highend
It's a first come, first serve.

Just use an entry for for the open with menu or a script that does what you want here

Code: Select all

    $modKey = <get shift>; // 0 = No keys held, 1 = Shift, 2 = Ctrl, 3 = Ctrl + Shift, 4 = Alt, 5 = Shift + Alt, 6 = Ctrl + Alt, 7 = Ctrl + Shift + Alt
    if ($modKey == 1) {
        run lax("%ProgramFiles%\Microsoft\Edge\Application\msedge.exe" "<pfaitem>");
    } else {
        run lax("C:\prgfiles\vim\vim90\gvim.exe" "<pfaitem>");
    }

Re: Custom file associations: The ones at the bottom of the list should override the ones above them, not other way arou

Posted: 15 Aug 2022 16:36
by John_C
This is a useful snippet, thanks. But what I'm talking about is simply that the current order looks unnatural. Of course, we can find some metaphors (like "first come, first serve"), but they won't fix its unnaturalness.

Why not from top to bottom? This is how we read books and this is, fwiw, how we redefine variables in code.

update:

I have just discovered that the same logic is used for age circles:

Code: Select all

<=  5 n >ff0000
<=  5 n >000000
the circle will be red, not black
So it seems it is by intent, though I completely disagree with this design decision ...