On 2022-03-02, SuperCuber wrote:
> So I'm looking through this https://github.com/vim/vim/blob/
> f6b0c79742727948edee78cb1a3a9a4e3be8b0fd/runtime/autoload/dist/ft.vim#L579 and
> I guess the b:is_fc = 1 should go somewhere there. I wonder how the 
> information
> would be passed to the function though... Adding another argument doesn't look
> like the way to go to me (backwards compat). Maybe the flag should just be set
> right in filetype.vim? Or perhaps a new function SetFileTypeShellFC could be
> created.

Notice near the top of that function this test:

    if expand("<amatch>") =~ g:ft_ignore_pat
      return
    endif

It uses <amatch>, which ":help <amatch>" explains,

    ... is replaced with the match for which this autocommand was
    executed. ...  When the match is with a file name, it is
    expanded to the full path.

So, you can match the expansion of <amatch> against the pattern of
an fc file name to determine whether to set b:is_fc.  For example,

    if expand("<amatch>") =~ '^/tmp/bash-fc[-.]\w\+$'
        b:is_fc = 1
    endif

Regards,
Gary

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220302090342.GC18373%40phoenix.

Raspunde prin e-mail lui