Fix bug in go-to-line.
Wasn't checking for maximum against the lines in the file.
This commit is contained in:
parent
27572c8838
commit
8776b96879
6
Cargo.lock
generated
6
Cargo.lock
generated
|
@ -520,13 +520,13 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-segmentation"
|
name = "unicode-segmentation"
|
||||||
version = "1.6.0"
|
version = "1.6.0"
|
||||||
source = "git+https://github.com/unicode-rs/unicode-segmentation.git#fbba2a660b38dad86eebcd7fe73138c5cbfb9469"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-segmentation"
|
name = "unicode-segmentation"
|
||||||
version = "1.6.0"
|
version = "1.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/unicode-rs/unicode-segmentation.git#fbba2a660b38dad86eebcd7fe73138c5cbfb9469"
|
||||||
checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-width"
|
name = "unicode-width"
|
||||||
|
|
|
@ -564,7 +564,10 @@ impl Editor {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let pos = self.buffer.text.line_to_char(n);
|
let pos = self
|
||||||
|
.buffer
|
||||||
|
.text
|
||||||
|
.line_to_char(n.min(self.buffer.text.len_lines()));
|
||||||
let pos = self.formatter.set_horizontal(
|
let pos = self.formatter.set_horizontal(
|
||||||
&self.buffer.text,
|
&self.buffer.text,
|
||||||
pos,
|
pos,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user