Closed keith closed 1 month ago
With this .editorconfig file:
.editorconfig file
[*] indent_size = 2 [*.{py,js}] indent_size = 4
When I edit foo.py, shiftwidth is set to 2 instead of 4. I verified that adding [*.py] instead works correctly.
foo.py
shiftwidth
2
4
[*.py]
I bisected and this was broken by https://github.com/tpope/vim-sleuth/commit/cd9d382e33bb817abe7f10cdc3a606bf1d491d75
I added some logging here: https://github.com/tpope/vim-sleuth/blob/cd9d382e33bb817abe7f10cdc3a606bf1d491d75/plugin/sleuth.vim#L263 like this:
echom "pattern " . pattern echom "translated: " . s:FnmatchTranslate(pattern)
and found that in the [*.py] case you get:
pattern /**/*.py translated: /.*\.py
But in the [*.{py,js}] case you get:
[*.{py,js}]
pattern /**/*.{py,js} translated: /.*\.\%(\|\|\|\|\|\|\|\)
I've submitted an attempted fix for this https://github.com/tpope/vim-sleuth/pull/97 but it's very possible I'm missing some edge cases in the regex
Thanks!
With this
.editorconfig file
:When I edit
foo.py
,shiftwidth
is set to2
instead of4
. I verified that adding[*.py]
instead works correctly.I bisected and this was broken by https://github.com/tpope/vim-sleuth/commit/cd9d382e33bb817abe7f10cdc3a606bf1d491d75
I added some logging here: https://github.com/tpope/vim-sleuth/blob/cd9d382e33bb817abe7f10cdc3a606bf1d491d75/plugin/sleuth.vim#L263 like this:
and found that in the
[*.py]
case you get:But in the
[*.{py,js}]
case you get: