fn highlight_one_line(&mut self, ctx: &mut PluginCtx<State>) -> bool {
        if let Some(line_num) = ctx.get_frontier() {
            //print_err!("highlighting {}", line_num);
            let (line_num, offset, state) = ctx.get_prev(line_num);
            if offset != self.offset {
                self.flush_spans(ctx);
                self.offset = offset;
                self.spans_start = offset;
            }
            let new_frontier = match ctx.get_line(line_num) {
                Ok("") => None,
                Ok(s) => {
                    let new_state = self.compute_syntax(s, state);
                    self.offset += s.len();
                    if s.as_bytes().last() == Some(&b'\n') {
                        Some((new_state, line_num + 1))
                    } else {
                        None
                    }
                }
                Err(_) => None,
            };
            let mut converged = false;
            if let Some((ref new_state, new_line_num)) = new_frontier {
                if let Some(old_state) = ctx.get(new_line_num) {
                    converged = old_state.as_ref().unwrap().0 == new_state.as_ref().unwrap().0;
                }
            }
            if !converged {
                if let Some((new_state, new_line_num)) = new_frontier {
                    ctx.set(new_line_num, new_state);
                    ctx.update_frontier(new_line_num);
                    return true;
                }
            }
            ctx.close_frontier();
        }
        false
    }
// Return true if there's any more work to be done.
Return true if there's any more work to be done.
Return true if there ' s any more work to be done .
fn highlight_one_line(&mut self, ctx: &mut PluginCtx<State>) -> bool {
        if let Some(line_num) = ctx.get_frontier() {
            //print_err!("highlighting {}", line_num);
            let (line_num, offset, state) = ctx.get_prev(line_num);
            if offset != self.offset {
                self.flush_spans(ctx);
                self.offset = offset;
                self.spans_start = offset;
            }
            let new_frontier = match ctx.get_line(line_num) {
                Ok("") => None,
                Ok(s) => {
                    let new_state = self.compute_syntax(s, state);
                    self.offset += s.len();
                    if s.as_bytes().last() == Some(&b'\n') {
                        Some((new_state, line_num + 1))
                    } else {
                        None
                    }
                }
                Err(_) => None,
            };
            let mut converged = false;
            if let Some((ref new_state, new_line_num)) = new_frontier {
                if let Some(old_state) = ctx.get(new_line_num) {
                    converged = old_state.as_ref().unwrap().0 == new_state.as_ref().unwrap().0;
                }
            }
            if !converged {
                if let Some((new_state, new_line_num)) = new_frontier {
                    ctx.set(new_line_num, new_state);
                    ctx.update_frontier(new_line_num);
                    return true;
                }
            }
            ctx.close_frontier();
        }
        false
    }
fn highlight_one_line ( & mut self , ctx : & mut PluginCtx < State > ) -> bool { if let Some ( line_num ) = ctx . get_frontier ( ) { //print_err!("highlighting {}", line_num); let ( line_num , offset , state ) = ctx . get_prev ( line_num ) ; if offset != self . offset { self . flush_spans ( ctx ) ; self . offset = offset ; self . spans_start = offset ; } let new_frontier = match ctx . get_line ( line_num ) { Ok ( " " ) => None , Ok ( s ) => { let new_state = self . compute_syntax ( s , state ) ; self . offset += s . len ( ) ; if s . as_bytes ( ) . last ( ) == Some ( & b'\n' ) { Some ( ( new_state , line_num + 1 ) ) } else { None } } Err ( _ ) => None , } ; let mut converged = false ; if let Some ( ( ref new_state , new_line_num ) ) = new_frontier { if let Some ( old_state ) = ctx . get ( new_line_num ) { converged = old_state . as_ref ( ) . unwrap ( ) . 0 == new_state . as_ref ( ) . unwrap ( ) . 0 ; } } if ! converged { if let Some ( ( new_state , new_line_num ) ) = new_frontier { ctx . set ( new_line_num , new_state ) ; ctx . update_frontier ( new_line_num ) ; return true ; } } ctx . close_frontier ( ) ; } false }
Return true if there's any more work to be done.
Return true if there ' s any more work to be done .
&mut self
ctx
&mut PluginCtx<State>