From 282a794febc4cb9f83ba569aab747ce7d2822549 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 22 Jan 2026 13:36:38 +0800 Subject: [PATCH] vim-patch:41adebe: check.vim: detect trailing whitespace https://github.com/vim/vim/commit/41adebe5727fd82347ab8d0c26713f5714616b48 Co-authored-by: Christian Brabandt --- src/nvim/po/check.vim | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/nvim/po/check.vim b/src/nvim/po/check.vim index 9ee45fb78d..5ce0bbf1dd 100644 --- a/src/nvim/po/check.vim +++ b/src/nvim/po/check.vim @@ -4,6 +4,8 @@ " - All %...s items in "msgid" are identical to the ones in "msgstr". " - An error or warning code in "msgid" matches the one in "msgstr". +" Last Update: 2025 Jul 10 + if 1 " Only execute this if the eval feature is available. " using line continuation @@ -210,19 +212,19 @@ let cte = search('^"Content-Transfer-Encoding:\s\+8-bit', 'n') let ctc = search('^"Content-Type:.*;\s\+\80v', 'n') if overlong > 0 - echomsg "Lines should be wrapped at 80 columns" + echomsg "Warn: Lines should be wrapped at 80 columns" + " TODO: make this an error + " if error == 0 + " let error = overlong + " endif +endif + +" Check that there is no trailing whitespace +let overlong = search('\s\+$', 'n') +if overlong > 0 + echomsg $"Warn: Trailing whitespace at line: {overlong}" " TODO: make this an error " if error == 0 " let error = overlong