Grant Hollingworth
2007-Nov-27 22:18 UTC
[sup-talk] [PATCH] mode.focus not called when buffer killed
r708 changed buffer.rb to set @focus_buf in kill_buffer. The problem with that is that focus_on (called through raise_to_front) sees that @focus_buf is set and returns without doing anything... so mode.focus is never called. Since focus_on will set @focus_buf, I changed kill_buffer back and moved the focus_on call in raise_to_front out of the conditional. I think that should still work as expected. If I added some tests, would you use them? Some assertions would really help with cases like this. -------------- next part -------------- A non-text attachment was scrubbed... Name: sup-kill-buffer-focus.diff Type: application/octet-stream Size: 678 bytes Desc: not available Url : http://rubyforge.org/pipermail/sup-talk/attachments/20071127/f9132051/attachment.obj
William Morgan
2007-Nov-28 17:21 UTC
[sup-talk] [PATCH] mode.focus not called when buffer killed
Excerpts from Grant Hollingworth''s message of Tue Nov 27 14:18:42 -0800 2007:> r708 changed buffer.rb to set @focus_buf in kill_buffer. The problem > with that is that focus_on (called through raise_to_front) sees that > @focus_buf is set and returns without doing anything... so mode.focus > is never called. Since focus_on will set @focus_buf, I changed > kill_buffer back and moved the focus_on call in raise_to_front out of > the conditional. I think that should still work as expected.Applied, thanks.> If I added some tests, would you use them? Some assertions would > really help with cases like this.Sure! -- William <wmorgan-sup at masanjin.net>
Grant Hollingworth
2007-Nov-29 15:50 UTC
[sup-talk] [PATCH] mode.focus not called when buffer killed
Excerpts from William Morgan''s message of Wed Nov 28 12:21:59 -0500 2007:> Applied, thanks.I noticed that you used ''focus_on buf'' instead of ''focus_on @buffers.last''. I assumed that if @buffers.last.force_to_top? was true, that you''d want to focus on the last buffer instead of the one just moved to @buffers[-2]. Or do you just want to make sure that the force_to_top buffer stays at the end of @buffers?
William Morgan
2007-Nov-29 18:18 UTC
[sup-talk] [PATCH] mode.focus not called when buffer killed
Excerpts from Grant Hollingworth''s message of Thu Nov 29 07:50:36 -0800 2007:> I noticed that you used ''focus_on buf'' instead of ''focus_on > @buffers.last''. I assumed that if @buffers.last.force_to_top? was > true, that you''d want to focus on the last buffer instead of the one > just moved to @buffers[-2]. Or do you just want to make sure that the > force_to_top buffer stays at the end of @buffers?Nope, you''re correct. Focus should stay on the force_to_top? buffer, regardless of whether something was deleted underneath it. I had tried a couple different variations and didn''t clean up properly. Thanks again! -- William <wmorgan-sup at masanjin.net>