Closed nidzola closed 4 years ago
Does it happen when you use pangloss/vim-javascript
directly instead of vim-polyglot?
I've tested it and it seems to work properly for my installation. Please check if some other plugin is not interfering
Just wanted to say i came across the same issue with typescript files and neovim.
Removing vim-polyglot solved it.
if isdirectory('/usr/local/opt/fzf')
Plug '/usr/local/opt/fzf' | Plug 'junegunn/fzf.vim'
else
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
endif
let g:make = 'gmake'
if exists('make')
let g:make = 'make'
endif
Plug 'Shougo/vimproc.vim', {'do': g:make}
"" Vim-Session
Plug 'xolox/vim-misc'
Plug 'xolox/vim-session'
"" random
Plug 'easymotion/vim-easymotion'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-sensible'
Plug 'Raimondi/delimitMate'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-commentary'
Plug 'vim-scripts/grep.vim'
Plug 'scrooloose/nerdtree'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'Yggdroot/indentLine'
Plug 'itchyny/lightline.vim'
Plug 'editorconfig/editorconfig-vim'
Plug 'chrisbra/colorizer'
Plug 'prettier/vim-prettier', { 'do': 'npm install' }
Plug 'christoomey/vim-tmux-navigator'
Plug 'bling/vim-bufferline'
Plug 'whiteinge/diffconflicts'
Plug 'itchyny/vim-parenmatch'
"" Text objs
Plug 'kana/vim-textobj-user'
Plug 'kana/vim-textobj-entire'
Plug 'kana/vim-textobj-function'
" colorscheme
Plug 'dracula/vim', { 'as': 'dracula' }
"" LANGUAGE SUPPORT
Plug 'HerringtonDarkholme/yats.vim'
Plug 'burnettk/vim-angular'
Plug 'posva/vim-vue'
Plug 'w0rp/ale'
Plug 'Valloric/MatchTagAlways'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & npm install' }
Plug 'mzlogin/vim-markdown-toc'
Has there been any investigation into this issue? I am experiencing this with typescript files in neovim as well. The resolution is to remove polyglot.
Turning off jsx solved this issue in javascript for me.
let g:polyglot_disabled = ['jsx']
This was helpful in diagnosing the issue:
https://stackoverflow.com/a/18670672
running:
:verbose set indentexpr?
resulted in:
indentexpr=GetJsxIndent()
Last set from ~/.vim/bundle/vim-polyglot/after/indent/javascript.vim line 23
I believe this this fixed now, could you confirm?
after running :PluginUpdate
(vundle) and uncommenting the above polyglot-disabled
line, this is still an issue for me.
Could you post your .vimrc?
When I get a chance I'll check this on my personal computer as well. There may be something specific to my setup at work that is not playing nice with polyglot.
Indentation works fine on my setup at home after the update. I'll look into what the issue could still be at work. Thanks for looking into this.
I also had this issue with typescript. I figured out that removing Plug 'styled-components/vim-styled-components', { 'branch': 'main' }
made it work properly again.
And after some playing around, I figured out that loading styled-components
before polyglot
also worked.
I also had this issue with typescript. I figured out that removing
Plug 'styled-components/vim-styled-components', { 'branch': 'main' }
made it work properly again. And after some playing around, I figured out that loadingstyled-components
beforepolyglot
also worked.
This worked for me. Thanks for looking into this @sheerun!
This was @Nohac not me :)
I'm experiencing an issue for Typescript with JSX markup (.tsx
file types). I am using latest version of vim-polyglot via janus. I also have vim-styled-components installed via Janus customizations, which means it's loaded after vim-polyglot. Removing styled-components does not seem to change my indenting of JSX markup.
Without vim-styled-components when I run verbose set indentexpr?
I see:
indentexpr=GetTypescriptIndent()
Last set from ~/.vim/janus/vim/langs/vim-polyglot/indent/typescript.vim
With vim-styled-components, I see:
indentexpr=GetStyledIndent()
Last set from ~/.janus/vim-styled-components/after/indent/javascript.vim
But again, with or without vim-styled-components, I do not see any changes in indenting of the JSX markup in my tsx files.
well, it's clear that this is a bug in vim-styled-components. it seems it messes up tsx / jsx indentation, that's why it only works if it's loaded first (vim-polyglot overrides indentation to correct value). I cannot do much about it, so I'm closing it. I suggest contributing to vim-styled-components or opening issue there if it bothers someone
If someone sees some other javascript indentation issue, please open another issue, this thread is too long already and lists multiple indentation issues instead of one
Does this bug happen when you install plugin without vim-polyglot? No Describe the bug: When I add
vim-polyglot
plugin, the indentation for javascript blocks stops to work. To Reproduce:desired behaviour:
actual behavour:
part of my
~/.vimrc
with plugins and stuff related with indent etc.:Edit: Apparently this issue only exists in Vim 8.1, switching to Neovim resolves the problem.