/// Hide the previous buffer when switching to another buffer
Hide the previous buffer when switching to another buffer
Hide the previous buffer when switching to another buffer
fn callback(
        &mut self,
        weechat: &Weechat,
        _signal_name: &str,
        _data: Option<SignalData<'_>>,
    ) -> ReturnCode {
        let current_buffer = weechat.current_buffer();
        let previous_buffer = self
            .inner
            .current_buffer
            .replace(Cow::from(String::from(current_buffer.full_name()))); // ¯\_(ツ)_/¯
        if previous_buffer.eq(&current_buffer.full_name()) {
            return ReturnCode::Ok;
        }
        if let Some(buffer) = weechat.buffer_search("==", &previous_buffer) {
            if self.buffer_is_hidable(weechat, &buffer) {
                buffer.set_hidden();
            }
        }
        current_buffer.set_unhidden();
        ReturnCode::Ok
    }
fn callback ( & mut self , weechat : & Weechat , _signal_name : & str , _data : Option < SignalData < ' _ > > , ) -> ReturnCode { let current_buffer = weechat . current_buffer ( ) ; let previous_buffer = self . inner . current_buffer . replace ( Cow :: from ( String :: from ( current_buffer . full_name ( ) ) ) ) ; // ¯\_(ツ)_/¯ if previous_buffer . eq ( & current_buffer . full_name ( ) ) { return ReturnCode :: Ok ; } if let Some ( buffer ) = weechat . buffer_search ( " " , & previous_buffer ) { if self . buffer_is_hidable ( weechat , & buffer ) { buffer . set_hidden ( ) ; } } current_buffer . set_unhidden ( ) ; ReturnCode :: Ok }
Hide the previous buffer when switching to another buffer
Hide the previous buffer when switching to another buffer
&mut self
weechat
&Weechat
_signal_name
&str
_data
Option<SignalData<'_>>