From 3ed48995e657b8ad92de1efeb091beccb300664a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Joly?= <7347374+cljoly@users.noreply.github.com> Date: Fri, 10 Dec 2021 14:22:31 +0000 Subject: [PATCH] Hide trailing white space warning for markdown (#28) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the markdown syntax, it’s actually valid to have trailing spaces (it creates a line break). Quoting https://en.wikipedia.org/wiki/Markdown > Two spaces at the end of a line > produce a line break. --- lua/hardline/parts/whitespace.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/hardline/parts/whitespace.lua b/lua/hardline/parts/whitespace.lua index ad98e16..a2a0b9d 100644 --- a/lua/hardline/parts/whitespace.lua +++ b/lua/hardline/parts/whitespace.lua @@ -19,6 +19,9 @@ local function search(prefix, pattern) end local function check_trailing() + if vim.tbl_contains({'markdown'}, bo.filetype) then + return '' + end return search('trailing', [[\s$]]) end