The URL hash (fragment) describes the selected lines. Examples:
| hash | description |
|---|---|
#L10 |
single line |
#L10,15,20 |
multiple lines |
#L10-15 |
span of lines |
#L10-15,20-25 |
multiple spans |
#L10,15-20,30 |
combination of above |
What happens when a line number is clicked?
Selection is cleared and the clicked line is selected.
The clicked line is remembered as last-clicked, used when selecting spans.
The line is added to current selection.
Examples:
| Current selection | Line clicked | New selection |
|---|---|---|
10 |
#L10 |
|
#L10 |
20 |
#L10,20 |
#L10-20 |
30 |
#L10-20,30 |
If last-clicked line exists, the span between last-clicked and the clicked line is added to the selection.
| Current selection | Last clicked | Line clicked | New selection |
|---|---|---|---|
10 |
20 |
#L10-20 |
|
#L10 |
15 |
20 |
#L10,15-20 |
Questions:
- what if
last-clickedis empty?