Fix a cursor position issue when searching forward
All checks were successful
timw4mail/scroll/pipeline/head This commit looks good
All checks were successful
timw4mail/scroll/pipeline/head This commit looks good
This commit is contained in:
parent
2c21bf0c9b
commit
21ff71cc94
@ -82,12 +82,17 @@ export class Document {
|
|||||||
|
|
||||||
for (let y = start; y < end; y++) {
|
for (let y = start; y < end; y++) {
|
||||||
if (this.row(position.y).isNone()) {
|
if (this.row(position.y).isNone()) {
|
||||||
|
logWarning('Invalid Search location', {
|
||||||
|
position,
|
||||||
|
document: this,
|
||||||
|
});
|
||||||
|
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
const maybeMatch = this.#rows[y].find(q, position.x, direction);
|
const maybeMatch = this.#rows[y].find(q, position.x, direction);
|
||||||
if (maybeMatch.isSome()) {
|
if (maybeMatch.isSome()) {
|
||||||
position.x = maybeMatch.unwrap();
|
position.x = this.#rows[y].rxToCx(maybeMatch.unwrap());
|
||||||
return Some(position);
|
return Some(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user