diff options
| author | Mike Vink <ivi@vinkies.net> | 2024-01-16 15:31:47 +0100 |
|---|---|---|
| committer | Mike Vink <ivi@vinkies.net> | 2024-01-16 15:31:47 +0100 |
| commit | 8b0128478c25fce085ed2e1fca7dc354c4300e6c (patch) | |
| tree | 4caefb807438d768c1fbb9d913633f6e07ebaf49 | |
| parent | ec5a543f7a684e23d2b5525deb43e6ea94186ecc (diff) | |
fix qf cbot hook
| -rw-r--r-- | mut/neovim/fnl/conf/init.fnl | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/mut/neovim/fnl/conf/init.fnl b/mut/neovim/fnl/conf/init.fnl index 08a6eb8..53b686f 100644 --- a/mut/neovim/fnl/conf/init.fnl +++ b/mut/neovim/fnl/conf/init.fnl @@ -81,6 +81,11 @@ (s "%c+%[[0-9:;<=>?]*[!\"#$%%&'()*+,-./]*[@A-Z%[%]^_`a-z{|}~]*;?[A-Z]?"))) (vim.schedule #(do + (local is-qf (= (vim.opt_local.buftype:get) "quickfix")) + (local is-at-last-line (let [[row col] (vim.api.nvim_win_get_cursor 0) + last-line (vim.api.nvim_buf_line_count 0)] + (do + (= row last-line)))) (vim.fn.setqflist [] :a {: id : title @@ -89,11 +94,6 @@ (do (if (not= l "") (prettify l))))}) - (local is-qf (= (vim.opt_local.buftype:get) "quickfix")) - (local is-at-last-line (let [[row col] (vim.api.nvim_win_get_cursor 0) - last-line (vim.api.nvim_buf_line_count 0)] - (do - (= row last-line)))) (if (or (not is-qf) (and is-at-last-line is-qf)) @@ -151,8 +151,10 @@ :Stop (fn [] (if (not= nil last_job_state) - (last_job_state:kill)) - (vim.notify "stopped job")) + (do + (last_job_state:kill) + (vim.notify "killed job")) + (vim.notify "nothing to do"))) {:bang true}) (vim.api.nvim_create_user_command :Args |
