tpope / vim-fireplace

fireplace.vim: Clojure REPL support
https://www.vim.org/scripts/script.php?script_id=4978
1.74k stars 139 forks source link

:silent! Require! takes my cursor to the top of the file when I'm not connected #374

Closed benknoble closed 4 years ago

benknoble commented 4 years ago

This primarily affects me when I open clojure files and don't connect to cider/nREPL—usually just a quick edit.

I have this autocommand setup for clojure files

" ~/.vim/after/ftplugin/clojure.vim

augroup CljRequire
  " can't use au! here because it would clear the group entirely
  au! * <buffer>
  au BufWritePost <buffer> silent! Require!
augroup END

It nicely :Require!s files for me when I save them (I'm thinking about taking off the bang, though, since that can be slow when requiring reloads, e.g., jetty...).

When I'm not connected, though, it has the side-effect of taking my cursor to the top of the file, which is very annoying. I can't replicate this behavior with any other :silent! command, and if I do :Require! myself (no silent), it doesn't happen.


TL;DR running :silent! Require! (manually or otherwise) when not connected takes my cursor to the top of the file. Can this get fixed?

If you need help troubleshooting (e.g., because you can't replicate this locally), let me know. I'm happy to try things out.

benknoble commented 4 years ago

Fixed indeed! Thanks.