From 786f85d0f537e8f19e7c424b57513a12bfb24373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Vulquin?= Date: Fri, 26 Jul 2024 09:51:19 +0200 Subject: nvim/mdquote: fix negative start line bug Lmao oops, tfw you don't function without `dec` anymore. --- dot_config/nvim/ftplugin/markdown_quote.fnl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'dot_config/nvim/ftplugin/markdown_quote.fnl') diff --git a/dot_config/nvim/ftplugin/markdown_quote.fnl b/dot_config/nvim/ftplugin/markdown_quote.fnl index a75c966..291e58f 100644 --- a/dot_config/nvim/ftplugin/markdown_quote.fnl +++ b/dot_config/nvim/ftplugin/markdown_quote.fnl @@ -5,11 +5,12 @@ Line1 is the start of the selection, and Line2 is the end." (let [sl (or (?. opts :line1) (vim.fn.line :v)) el (or (?. opts :line2) (vim.fn.line :.)) - swap (> sl el)] + swap (> sl el) + dec #(- $ 1)] (if swap - {:line1 (- 1 el) + {:line1 (dec el) :line2 sl} - {:line1 (- 1 sl) + {:line1 (dec sl) :line2 el}))) (fn maplines [f] -- cgit v1.2.3