Closed ianliu closed 5 years ago
I'm sure there are other cases, but it looks like for this particular case, setting the typeScriptBraces
highlight group in a colorscheme causes this bug (but not after initialization - likely an issue with execution order). I've pushed up a branch 102-workaround
that comments out this line. If you're having this issue and it lasts much longer while I look more into this, please check to see if it resolves indentation issues.
@rbong yes, I can confirm the workaround works. Why does xterm-256color
matter here?
The fix turns out to be simple from our side... the highlight groups are formatted in the fashion typescriptGroup
, not typeScriptGroup
. I've changed this on master and the issue seems to go away.
For some reason, using the latter breaks indentation. I am sure there is a bug somewhere in the typescript plugin or Vim, so I am keeping this open for now until I can pin down an issue and submit it or determine if it's intended behaviour just so I can keep us from breaking other plugins in the same way.
I have no idea why xterm-256color
matters here, it's a very odd issue. Overwriting a highlight group should not impact indentation AFAIK and I can't find any references to typescriptBraces
, TERM
, or xterm
that seem to matter in the typescript plugin.
Problem is this line in vim-jsx-pretty, it is case sensitive. Going to submit a PR.
That should tie up any lose ends from our side.
Preparation
Make sure you are using a
xterm-256color
compatible terminal, such as gnome-terminal.Copy the following to a Dockerfile and execute
docker build -t gruvbox-bug .
docker run --rm -ti gruvbox-bug
, you are going to log into a shell.Tests with
colorscheme gruvbox
The
.vim/vimrc
already has thecolorscheme gruvbox
set. Now execute the following tests:Execute
TERM=xterm-256color vim test.tsx
and issue the=G
command to reindent the file. The file should be wrongly indented.Execute
TERM=xterm vim test.tsx
and issue the=G
command to reindent the file. The file should be correctly indented.Tests without
colorscheme gruvbox
Comment out the line setting the colorscheme in
.vim/vimrc
and rerun the two previous tests, and you will see that, no matter theTERM
variable, it will work.