mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-30 12:07:40 +00:00
Fix invalid line number computation when clicking on something else than a line number
This commit is contained in:
parent
5c780b98d1
commit
f3eae89b33
@ -205,6 +205,10 @@ const handleSourceHighlight = (function() {
|
|||||||
|
|
||||||
return ev => {
|
return ev => {
|
||||||
let cur_line_id = parseInt(ev.target.id, 10);
|
let cur_line_id = parseInt(ev.target.id, 10);
|
||||||
|
// It can happen when clicking not on a line number span.
|
||||||
|
if (isNaN(cur_line_id)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
|
||||||
if (ev.shiftKey && prev_line_id) {
|
if (ev.shiftKey && prev_line_id) {
|
||||||
|
Loading…
Reference in New Issue
Block a user