Skip to content

Commit

Permalink
Keybindings and clippy warnings removal
Browse files Browse the repository at this point in the history
  • Loading branch information
dariooddenino committed Oct 17, 2022
1 parent 12a694a commit 83d4110
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
5 changes: 2 additions & 3 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2856,7 +2856,7 @@ pub fn get_next_diag_pos(
.find(|diag| diag.range.start < cursor_pos),
};

return diag.map(|d| d.range.start);
diag.map(|d| d.range.start)
}

/// Finds the next/previous document with diagnostics in it.
Expand All @@ -2876,8 +2876,7 @@ pub fn get_next_diag_doc(
iter.next().or_else(|| {
editor_diagnostics
.iter()
.filter(|(_, diags)| !diags.is_empty())
.next()
.find(|(_, diags)| !diags.is_empty())
})
}
Direction::Backward => {
Expand Down
12 changes: 6 additions & 6 deletions helix-term/src/commands/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ pub fn goto_first_diag_workspace(cx: &mut Context) {
};
goto_pos(editor, pos);
}
None => return,
None => (),
}
}

Expand All @@ -462,7 +462,7 @@ pub fn goto_last_diag_workspace(cx: &mut Context) {
};
goto_pos(editor, pos);
}
None => return,
None => (),
}
}

Expand All @@ -488,10 +488,10 @@ pub fn goto_next_diag_workspace(cx: &mut Context) {
let pos = diag.range.start;
goto_pos(editor, pos)
}
None => return,
None => (),
}
}
None => return,
None => (),
}
}
}
Expand Down Expand Up @@ -519,10 +519,10 @@ pub fn goto_prev_diag_workspace(cx: &mut Context) {
let pos = diag.range.start;
goto_pos(editor, pos)
}
None => return,
None => (),
}
}
None => return,
None => (),
}
}
}
Expand Down
12 changes: 8 additions & 4 deletions helix-term/src/keymap/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,28 +100,32 @@ pub fn default() -> HashMap<Mode, Keymap> {
"[" => { "Left bracket"
"d" => goto_prev_diag,
"D" => goto_first_diag,
"w" => goto_prev_diag_workspace,
"W" => goto_first_diag_workspace,
"f" => goto_prev_function,
"c" => goto_prev_class,
"a" => goto_prev_parameter,
"o" => goto_prev_comment,
"t" => goto_prev_test,
"p" => goto_prev_paragraph,
"space" => add_newline_above,
"[" => { "Workspace"
"d" => goto_prev_diag_workspace,
"D" => goto_first_diag_workspace,
},
},
"]" => { "Right bracket"
"d" => goto_next_diag,
"D" => goto_last_diag,
"w" => goto_next_diag_workspace,
"W" => goto_last_diag_workspace,
"f" => goto_next_function,
"c" => goto_next_class,
"a" => goto_next_parameter,
"o" => goto_next_comment,
"t" => goto_next_test,
"p" => goto_next_paragraph,
"space" => add_newline_below,
"]" => { "Workspace"
"d" => goto_next_diag_workspace,
"D" => goto_last_diag_workspace,
},
},

"/" => search,
Expand Down

0 comments on commit 83d4110

Please sign in to comment.