From e8ea6b874607df6e4e9031092f3a240f366a0b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Thu, 28 Oct 2021 02:34:38 +0200 Subject: [PATCH] Look at Cc header as well --- lua/srht-patches/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/srht-patches/init.lua b/lua/srht-patches/init.lua index 55fbd8f..c444616 100644 --- a/lua/srht-patches/init.lua +++ b/lua/srht-patches/init.lua @@ -50,12 +50,13 @@ end -- checks if patch was sent to a specified mailing address local function check_address() - local line = vim.fn.search("^To:.*$", "nw") + local line_to = vim.fn.search("^To:.*$", "nw") + local line_cc = vim.fn.search("^Cc:.*$", "nw") for _, val in ipairs(vim.g.srht_patches_address_list) do local regex = vim.regex(val) -- match_line is zero based, while search is one based - if regex:match_line(0, line - 1) then + if regex:match_line(0, line_to - 1) or regex:match_line(0, line_cc - 1) then return true end end -- 2.44.0