Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Rules defined for filenames with a leading . are not loaded #40

Open
iamFIREcracker opened this issue Jan 13, 2019 · 1 comment
Open

Comments

@iamFIREcracker
Copy link

Rules defined for filenames with a leading . are not loaded up by the plugin.

My .editorconfig:

[*]
indent_size = 2
tab_width = 2

[.vimrc]
indent_size = 4
tab_width = 4

When I edit my .vimrc file, and run verbose set shiftwidth I get the following:

  shiftwidth=2
        Last set from ~/my-env/dotfiles/.vim/pack/bundle/start/vim-editorconfig/autoload/editorconfig/indent_size.vim line 16

With the following .editorconfig instead (no more .):

[*]
indent_size = 2
tab_width = 2

[vimrc]
indent_size = 4
tab_width = 4

settings are loaded up just fine:

  shiftwidth=4
        Last set from ~/my-env/dotfiles/.vim/pack/bundle/start/vim-editorconfig/autoload/editorconfig/indent_size.vim line 16

Is this expected?

@arp242
Copy link

arp242 commented Mar 12, 2019

This is a problem with more than just .vimrc; e.g. something like %file also won't work.

The root cause is that in s:filter_matched() the regexp '.vimrc' =~ '\<\.vimrc$' gets run. Since . is not considered to be the "first char of a word" the match fails.

I think the \< is there to make sure that a path of foo/bar/foo.vim will match just against foo.vim? In that case, something like [^/] should also work.

I'm not sure what the purpose of the \< is in this case? Removing it seems to fix it, but I presume it wasn't added for the fun of it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants