annotate-snippets-rs icon indicating copy to clipboard operation
annotate-snippets-rs copied to clipboard

feat: Add `Renderer::cut_indicator`

Open BurntSushi opened this issue 9 months ago • 2 comments

This adds a new API for overriding the use of ... to indicate a cut or trimmed line. In the case of Ruff, we didn't want to use ... since ... is valid Python code. It could be rather confusing in some cases where ... would be ambiguous between "line was cut here" and "this is what the actual line read as." I think this can happen with any indicator of course, but for Python specifically, it's pretty likely to happen with ....

The new API here is somewhat sub-optimal in that it requires a &'static str. I did this because of the constraints imposed by a Renderer's const constructor.

BurntSushi avatar Jan 09 '25 18:01 BurntSushi