fix highlight url hash ordering
This commit is contained in:
@@ -112,8 +112,9 @@ function useSelectedLine() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selected[0] !== -1) {
|
if (selected[0] !== -1) {
|
||||||
if (selected[1] !== -1) {
|
if (selected[1] !== -1) {
|
||||||
const [s, e] = selected.sort();
|
const start = Math.min(...selected);
|
||||||
window.location.hash = `#L${s}-${e}`;
|
const end = Math.max(...selected);
|
||||||
|
window.location.hash = `#L${start}-${end}`;
|
||||||
} else {
|
} else {
|
||||||
window.location.hash = `#L${selected[0]}`;
|
window.location.hash = `#L${selected[0]}`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user