FormatCode adds line filled with spaces when run on .cc file
まだ誰も着手していません。
評価
調査の方向性
init.vim の設定、base/run_loop.cc のような .cc ファイル、および :FormatCode コマンドを使って問題を再現し、clang-format -i を直接実行した場合の動作と比較します。:FormatCode のエントリポイントを追跡し、フォーマットを繰り返しても空白だけで構成された末尾の行が追加または削除されなくなっていることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Description
Running :FormatCode on a cpp source (not header) file causes a trailing line filled with whitespaces to appear at the end of the document.
Running :FormatCode again and again removes and re-adds and removes and ... this line.
Steps to reproduce
- Use this init.vim file:
call plug#begin('~/.local/share/nvim/plugged-minimal')
Plug 'google/vim-maktaba' " Needed for vim-codefmt
Plug 'google/vim-glaive' " Needed for vim-codefmt
Plug 'google/vim-codefmt' " Code formatting
call plug#end()
-
Open any .cc file (for example I use
base/run_loop.ccfrom the chromium project -
Run
:FormatCode. Observe line with trailing whitespaces at the end of the file -
Run
:FormatCode. Observe line with trailing whitespaces at the end of the file is gone. -
Repeat
My Setup
- 'vim-codefmt' is up-to-date (I ran
:PlugUpdate)
─❯ nvim --version
NVIM v0.7.2
╰─❯ clang-format --version
clang-format version google3-trunk (30af2fb33ed2f610abfa50e53df9712887b2bd25)
Gif of the bug
Other things I tried
- Manually running
clang-format -i base/run_loop.ccfrom the command line does not introduce these whitespaces, which is why I opened the bug againstvim-codefmtand notclang-format.
Please let me know if you need any more information.
Thanks!
- 主要言語
- Vim Script
- スター
- 1.1k
- フォーク
- 102
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/vim-codefmt のほかの issue
-
Write a codefmt FAQオープンenhancement
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
google/vim-codefmt#53 ·
-
Add meson formatオープンnew formatter
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
google/vim-codefmt#243 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
google/vim-codefmt#240 · コメント 1 件 ·
-
Add `:CodefmtInfo` command to report diagnostics to help users check config / diagnose problemsオープンenhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
google/vim-codefmt#234 · コメント 2 件 ·
-
難易度 1/5 1〜3時間 初心者へのやさしさ 45/100
google/vim-codefmt#222 · コメント 3 件 ·
google/vim-codefmt の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
prime-radiant-inc/evener#3873 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
micromatch/picomatch#223 ·
メンテナーはふだん 11 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mksglu/context-mode#1268 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
[bug] Setup fails with "Cannot find matching keyid" when an older Node's corepack is on PATH対応中かも @EyalPoly が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信