* [sup-talk] [PATCH] mode.focus not called when buffer killed
@ 2007-11-27 22:18 Grant Hollingworth
2007-11-28 17:21 ` William Morgan
0 siblings, 1 reply; 4+ messages in thread
From: Grant Hollingworth @ 2007-11-27 22:18 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [sup-talk] [PATCH] mode.focus not called when buffer killed
2007-11-27 22:18 [sup-talk] [PATCH] mode.focus not called when buffer killed Grant Hollingworth
@ 2007-11-28 17:21 ` William Morgan
2007-11-29 15:50 ` Grant Hollingworth
0 siblings, 1 reply; 4+ messages in thread
From: William Morgan @ 2007-11-28 17:21 UTC (permalink / raw)
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [sup-talk] [PATCH] mode.focus not called when buffer killed
2007-11-28 17:21 ` William Morgan
@ 2007-11-29 15:50 ` Grant Hollingworth
2007-11-29 18:18 ` William Morgan
0 siblings, 1 reply; 4+ messages in thread
From: Grant Hollingworth @ 2007-11-29 15:50 UTC (permalink / raw)
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?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [sup-talk] [PATCH] mode.focus not called when buffer killed
2007-11-29 15:50 ` Grant Hollingworth
@ 2007-11-29 18:18 ` William Morgan
0 siblings, 0 replies; 4+ messages in thread
From: William Morgan @ 2007-11-29 18:18 UTC (permalink / raw)
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-11-29 18:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-27 22:18 [sup-talk] [PATCH] mode.focus not called when buffer killed Grant Hollingworth
2007-11-28 17:21 ` William Morgan
2007-11-29 15:50 ` Grant Hollingworth
2007-11-29 18:18 ` William Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox