sjbach / lusty

LustyExplorer / LustyJuggler for Vim
http://www.vim.org/scripts/script.php?script_id=1890
256 stars 30 forks source link

Lusty stops working when leaving its buffer with the mouse #69

Open rogutes opened 12 years ago

rogutes commented 12 years ago

I use ":set mouse=a".

  1. vim -c LustyBufferExplorer
  2. Click on the buffer I am editing.
  3. Press CTRL-W o.
  4. LustyBufferExplorer doesn't work any more.

This has accidentally happened several times and I couldn't figure out how to open Lusty without restarting vim.

sjbach commented 12 years ago

Thanks. I'd recommend not navigating away from the explorer window while it's in use. If you do navigate away, I'd recommend not using Ctrl-w o to close the explorer window; it's important to kill the explorer naturally, i.e. by going back to the window with Ctrl-w j or whatever, and then Ctrl-c.

The right thing to do is add a Vim autocmd to kill the explorer when its window is closed, but this is tricky to get right.

rogutes commented 12 years ago

Thanks for the explanation. Somewhere in the VIM User manual there is this sentence:

Frequently when you are typing, your fingers get ahead of your brain.

And this is exactly the problem: once I accidentally navigate away with the mouse, I automatically press Ctrl-w o (happened 3 times in the last month; could blame the touchpad of course). Isn't there a manual way to reopen the LustyExplorer window after such an "accident" (:unlet something)?

sjbach commented 12 years ago

Depending on your settings, you can reopen the buffer with :b, but it seems to be in an uncertain state at that point and I can't see how to make it close cleanly. It's really better to have it clean up after itself, as LustyExplorer sets some non-local options and remaps keys, so you're left with an unreliable environment. gross.

I agree that's not ideal, but I'd be more inclined to treat the cause rather than the symptoms. The plugin should close itself when its window is killed; someone just has to make it do that well. :-)