pub fn filter(&mut self, input: &str) -> Option<ListStore> {
        self.current_completer_mut()
            .map(|completer| {
                // Multiply by 2 because each column has a foreground column.
                let columns = vec![Type::String; completer.column_count() * 2];
                let model = ListStore::new(&columns);

                // Remove the command to only send the value to the completer.
                let key =
                    if !completer.have_command() {
                        input
                    }
                    else if let Some(index) = input.find(' ') {
                        input[index + 1 ..].trim_start()
                    }
                    else {
                        input
                    };

                for &CompletionResult { ref columns } in &completer.completions(key) {
                    let row = model.insert(-1);
                    let start_column = columns.len();
                    for (index, cell) in columns.iter().enumerate() {
                        model.set_value(&row, index as u32, &cell.value.to_value());
                        if let Some(ref foreground) = cell.foreground {
                            model.set_value(&row, (index + start_column) as u32, &foreground.to_value());
                        }
                    }
                }
                model
            })
    }
/// Filter the rows from the input.
Filter the rows from the input.
Filter the rows from the input .
pub fn filter(&mut self, input: &str) -> Option<ListStore> {
        self.current_completer_mut()
            .map(|completer| {
                // Multiply by 2 because each column has a foreground column.
                let columns = vec![Type::String; completer.column_count() * 2];
                let model = ListStore::new(&columns);
                // Remove the command to only send the value to the completer.
                let key =
                    if !completer.have_command() {
                        input
                    }
                    else if let Some(index) = input.find(' ') {
                        input[index + 1 ..].trim_start()
                    }
                    else {
                        input
                    };
                for &CompletionResult { ref columns } in &completer.completions(key) {
                    let row = model.insert(-1);
                    let start_column = columns.len();
                    for (index, cell) in columns.iter().enumerate() {
                        model.set_value(&row, index as u32, &cell.value.to_value());
                        if let Some(ref foreground) = cell.foreground {
                            model.set_value(&row, (index + start_column) as u32, &foreground.to_value());
                        }
                    }
                }
                model
            })
    }
pub fn filter ( & mut self , input : & str ) -> Option < ListStore > { self . current_completer_mut ( ) . map ( | completer | { // Multiply by 2 because each column has a foreground column. let columns = vec ! [ Type String completer column_count ( ) 2 ] ; let model = ListStore :: new ( & columns ) ; // Remove the command to only send the value to the completer. let key = if ! completer . have_command ( ) { input } else if let Some ( index ) = input . find ( ' ' ) { input [ index + 1 .. ] . trim_start ( ) } else { input } ; for & CompletionResult { ref columns } in & completer . completions ( key ) { let row = model . insert ( - 1 ) ; let start_column = columns . len ( ) ; for ( index , cell ) in columns . iter ( ) . enumerate ( ) { model . set_value ( & row , index as u32 , & cell . value . to_value ( ) ) ; if let Some ( ref foreground ) = cell . foreground { model . set_value ( & row , ( index + start_column ) as u32 , & foreground . to_value ( ) ) ; } } } model } ) }
Filter the rows from the input.
Filter the rows from the input .
&mut self
input
&str