sjbach / lusty

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

Implement unload buffer #100

Closed alovak closed 10 years ago

alovak commented 10 years ago

It took 2 years to update my PR :) BTW I have implemented nice feature. When you delete buffer then cursor stays at the same position. I'm not clearly understand all functions... so there are can be some issues with this. Would be great if someone can test it :)

sjbach commented 10 years ago

Thanks for the patch. :-) No worries about the delay. I ran into an issue: the <C-d> binding is specified on Explorer base class, but the functionality only applies to the buffer explorer. If I type <C-d> in the filesystem explorer, I get an error:

undefined methodunload_buffer' for #<LustyE::FilesystemExplorer:0x00000002985d 80> (eval):664:in unload_selected_buffer' (eval):583:inkey_pressed' (eval):875:in key_pressed' (eval):1:inblock in

' (eval):257:in profile' (eval):1:in
'`

There is an easy fix. The <C-d> binding and the unload_buffer and unload_selected_buffer functions should be specified in buffer-explorer.rb. The BufferExplorer class needs to implement the key_pressed function to include <C-d>, overriding the key_pressed function in the Explorer class. (You can take a look at filesystem-explorer.rb, which already does this, for a reference.)

alovak commented 10 years ago

@sjbach is it better now?

sjbach commented 10 years ago

Merged. Thanks for the patch. :-)

alovak commented 10 years ago

@sjbach thanks for great plugin!!!