Skip to content

Commit

Permalink
ViEditor: cleanup logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Dec 8, 2023
1 parent b7bdd62 commit 3187e91
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/edit/vi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ impl<'a> ViEditor<'a> {

/// Redo a change
pub fn redo(&mut self) {
log::info!("Redo");
log::debug!("Redo");
for action in self.commands.redo() {
undo_2_action(&mut self.editor, action);
//TODO: clear changed flag when back to last saved state?
Expand All @@ -240,7 +240,7 @@ impl<'a> ViEditor<'a> {

/// Undo a change
pub fn undo(&mut self) {
log::info!("Undo");
log::debug!("Undo");
for action in self.commands.undo() {
undo_2_action(&mut self.editor, action);
//TODO: clear changed flag when back to last saved state?
Expand Down Expand Up @@ -323,7 +323,7 @@ impl<'a> Edit for ViEditor<'a> {
}

fn action(&mut self, font_system: &mut FontSystem, action: Action) {
log::info!("Action {:?}", action);
log::debug!("Action {:?}", action);

let editor = &mut self.editor;

Expand Down Expand Up @@ -355,7 +355,7 @@ impl<'a> Edit for ViEditor<'a> {
Action::Unindent => Key::Backtab,
Action::Up => Key::Up,
_ => {
log::info!("pass through action {:?}", action);
log::debug!("Pass through action {:?}", action);
editor.action(font_system, action);
// Always finish change when passing through (TODO: group changes)
finish_change(editor, &mut self.commands, &mut self.changed);
Expand All @@ -369,10 +369,10 @@ impl<'a> Edit for ViEditor<'a> {
};

Check warning on line 369 in src/edit/vi.rs

View workflow job for this annotation

GitHub Actions / clippy

match expression looks like `matches!` macro

warning: match expression looks like `matches!` macro --> src/edit/vi.rs:366:29 | 366 | let has_selection = match editor.selection() { | _____________________________^ 367 | | Selection::None => false, 368 | | _ => true, 369 | | }; | |_________^ help: try: `!matches!(editor.selection(), Selection::None)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro = note: `#[warn(clippy::match_like_matches_macro)]` on by default

self.parser.parse(key, has_selection, |event| {
log::info!(" Event {:?}", event);
log::debug!(" Event {:?}", event);
let action = match event {
Event::AutoIndent => {
log::info!("TODO");
log::info!("TODO: AutoIndent");
return;
}
Event::Backspace => Action::Backspace,
Expand Down Expand Up @@ -532,7 +532,7 @@ impl<'a> Edit for ViEditor<'a> {
Event::ShiftLeft => Action::Unindent,
Event::ShiftRight => Action::Indent,
Event::SwapCase => {
log::info!("TODO");
log::info!("TODO: SwapCase");
return;
}
Event::Undo => {
Expand Down

0 comments on commit 3187e91

Please sign in to comment.