From 4fcd7d42727e1020abc4543829db31d38db271a0 Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Thu, 12 Oct 2023 20:11:07 +0000 Subject: fixup --- mut/neovim/fnl/conf/init.fnl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'mut') diff --git a/mut/neovim/fnl/conf/init.fnl b/mut/neovim/fnl/conf/init.fnl index e3b56d5..3551c3a 100644 --- a/mut/neovim/fnl/conf/init.fnl +++ b/mut/neovim/fnl/conf/init.fnl @@ -79,8 +79,17 @@ (local lines (icollect [_ l (ipairs lines)] (if (not= l "") (prettify l)))) + (local is-at-last-line (let [[n lnum & rest] (vim.fn.getcurpos) + last-line (vim.api.nvim_buf_line_count 0)] + (do + (= lnum last-line)))) (vim.fn.setqflist [] :a {: id : title : lines}) - (vim.cmd ":cbottom")))) + (local is-qf? (= (vim.opt_local.buftype:get) "quickfix")) + (P [(not is-qf?) is-at-last-line]) + (if (or + (not is-qf?) + (and is-at-last-line is-qf?)) + (vim.cmd ":cbottom"))))) (var last_job nil) (local job -- cgit v1.2.3