goto_diag: avoid wraparound by default (#12704)
This commit is contained in:
parent
fec5101a41
commit
0c8f0c0334
1 changed files with 2 additions and 4 deletions
|
@ -3824,8 +3824,7 @@ fn goto_next_diag(cx: &mut Context) {
|
|||
let diag = doc
|
||||
.diagnostics()
|
||||
.iter()
|
||||
.find(|diag| diag.range.start > cursor_pos)
|
||||
.or_else(|| doc.diagnostics().first());
|
||||
.find(|diag| diag.range.start > cursor_pos);
|
||||
|
||||
let selection = match diag {
|
||||
Some(diag) => Selection::single(diag.range.start, diag.range.end),
|
||||
|
@ -3852,8 +3851,7 @@ fn goto_prev_diag(cx: &mut Context) {
|
|||
.diagnostics()
|
||||
.iter()
|
||||
.rev()
|
||||
.find(|diag| diag.range.start < cursor_pos)
|
||||
.or_else(|| doc.diagnostics().last());
|
||||
.find(|diag| diag.range.start < cursor_pos);
|
||||
|
||||
let selection = match diag {
|
||||
// NOTE: the selection is reversed because we're jumping to the
|
||||
|
|
Loading…
Add table
Reference in a new issue