Skip to content

Commit

Permalink
removed some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fdncred committed Apr 20, 2023
1 parent 967eebc commit e904952
Showing 1 changed file with 0 additions and 67 deletions.
67 changes: 0 additions & 67 deletions crates/nu-command/src/filters/find.rs
Expand Up @@ -338,73 +338,6 @@ fn highlight_terms_in_record_with_search_columns(
}
}

// fn highlight_terms_in_record_in_columns(
// search_cols: &[String],
// cols: &mut [String],
// vals: &mut Vec<Value>,
// span: &mut Span,
// config: &Config,
// terms: &[Value],
// string_style: Style,
// ls_colors: &LsColors,
// ) -> Value {
// let mut output = vec![];
// for val in vals {
// let val_str = val.into_string("", config);
// let lower_val = val.into_string("", config).to_lowercase();
// let mut term_added_to_output = false;
// for term in terms {
// let term_str = term.into_string("", config);
// let lower_term = term.into_string("", config).to_lowercase();
// if lower_val.contains(&lower_term) {
// if config.use_ls_colors {
// // Get the original LS_COLORS color
// let style = ls_colors.style_for_path(val_str.clone());
// let ansi_style = style
// .map(LsColors_Style::to_nu_ansi_term_style)
// .unwrap_or_default();
//
// let ls_colored_val = ansi_style.paint(&val_str).to_string();
//
// let ansi_term_style = style
// .map(to_nu_ansi_term_style)
// .unwrap_or_else(|| string_style);
//
// let hi =
// match highlight_search_string(&ls_colored_val, &term_str, &ansi_term_style)
// {
// Ok(hi) => hi,
// Err(_) => string_style.paint(term_str.to_string()).to_string(),
// };
// output.push(Value::String {
// val: hi,
// span: *span,
// });
// term_added_to_output = true;
// } else {
// // No LS_COLORS support, so just use the original value
// let hi = match highlight_search_string(&val_str, &term_str, &string_style) {
// Ok(hi) => hi,
// Err(_) => string_style.paint(term_str.to_string()).to_string(),
// };
// output.push(Value::String {
// val: hi,
// span: *span,
// });
// }
// }
// }
// if !term_added_to_output {
// output.push(val.clone());
// }
// }
// Value::Record {
// cols: cols.to_vec(),
// vals: output,
// span: *span,
// }
// }

fn find_with_rest_and_highlight(
engine_state: &EngineState,
stack: &mut Stack,
Expand Down

0 comments on commit e904952

Please sign in to comment.