YAPF clears the buffer on formatting
- 主要言語
- Vim Script
- スター
- 1.1k
- フォーク
- 102
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
**Describe the bug**
I have set yapf as my default formatter in .vimrc and whenever I save a .py file, it clears the buffer. And if I change it to black or autopep8, it doesn't.
**To Reproduce**
Minimal vimrc:
```vim
Plug 'google/vim-maktaba'
Plug 'google/vim-codefmt'
Plug 'google/vim-glaive'
call plug#end()
call glaive#Install()
augroup autoformat_settings
autocmd FileType bzl AutoFormatBuffer buildifier
autocmd FileType c,cpp,proto,javascript,arduino AutoFormatBuffer clang-format
autocmd FileType dart AutoFormatBuffer dartfmt
autocmd FileType go AutoFormatBuffer gofmt
autocmd FileType gn AutoFormatBuffer gn
autocmd FileType html,css,sass,scss,less,json AutoFormatBuffer js-beautify
autocmd FileType java AutoFormatBuffer google-java-format
autocmd FileType python AutoFormatBuffer black
autocmd FileType rust AutoFormatBuffer rustfmt
autocmd FileType vue AutoFormatBuffer prettier
augroup END
```
**OS (version)**
Windows 10
NVIM v0.4.3 and vim-plug
yapf 0.30.0
コントリビューションガイド
調査の方向性
Vim plugin で使用される AutoFormatBuffer パスから始め、提供された最小限の vimrc を使って Windows 10 上の YAPF 0.30.0 で報告を再現してください。動作を、一覧にある black および autopep8 formatter と比較してください。完了とは、Python buffer を保存したときにその内容が保持され、同時に YAPF formatting が適用されることを意味します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python, vim
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 30/100