peitalin / vim-jsx-typescript

React JSX syntax highlighting for vim and Typescript
The Unlicense
305 stars 29 forks source link

File truncation after vim-prettier reformating when foldmethod=syntax #20

Open esanzgar opened 4 years ago

esanzgar commented 4 years ago

I have three plugins installed using Vundle.

This is my .vimrc:

set nocompatible
filetype off
set shell=/bin/bash

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'gmarik/Vundle.vim'

Plugin 'leafgarland/typescript-vim'        " syntax, indenting and compiler for ts
Plugin 'peitalin/vim-jsx-typescript'       " syntax highlight for TSX files
Plugin 'prettier/vim-prettier'             " alternative to jsbeautify

call vundle#end()

filetype plugin indent on

" Make vim recognize syntax
syntax on
set foldmethod=syntax

noremap <C-f> :Prettier<CR>

When I format a .tsx file with vim-prettier the file gets truncated. This only happens if set foldmethod=syntax.

This is caused by a weird interaction between the three plugins.

Do you have any hints for me?

truncated_file