Show a gap between ranges of lines in search results
simonw opened this issue · 3 comments
simonw commented
https://ripgrep.datasette.io/-/ripgrep?pattern=asgi_s&literal=on&glob=datasette%2F**
This is a bit confusing. There should ideally be visual gaps in the line numbers here to make it easier to spot the different ranges:
simonw commented
Here's what the HTML looks like:
<pre><a class="line-number" href="/-/ripgrep/view/datasette/datasette/app.py#L87">87 </a><span>)
</span></pre>
<pre><a class="line-number" href="/-/ripgrep/view/datasette/datasette/app.py#L88">88 </a><span>from .utils.internal_db import init_internal_db, populate_schema_tables
</span></pre>
<pre><a class="line-number" href="/-/ripgrep/view/datasette/datasette/app.py#L200">200 </a><span>
</span></pre>
From this template:
datasette-ripgrep/datasette_ripgrep/templates/ripgrep.html
Lines 65 to 74 in 577ee2f
simonw commented
So maybe I need to detect when line of code has a line number that's more than one higher than the previous one and add an extra class, maybe <pre class="line-jump">
which can have some extra margin.
simonw commented
https://ripgrep.datasette.io/-/ripgrep?pattern=asgi_s&literal=on&glob=datasette%2F** now looks like this: