mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.97k stars 714 forks source link

[BUG] replace-ranges with tab is not displayed correctly #4855

Open silversquirl opened 1 year ago

silversquirl commented 1 year ago

Version of Kakoune

Kakoune v2022.10.31

Reproducer

:decl range-specs test
:set window test %val{timestamp} '1.1,1.1|<c-v><tab>a'
:addhl window/ replace-ranges test

Outcome

The replacement is displayed as a , with a space character where the tab should be.

Expectations

The tab character should be displayed based on the configured tabstop. It would also be nice if relevant show-whitespaces highlighters and similar affected the replaced content.

Additional information

No response

silversquirl commented 1 year ago

This seems to affect markup strings more generally, and applies to other types of whitespace too:

:echo -markup '<c-v><tab>a'
:echo -markup '<c-v><ret>a'

Using {\}<c-v><tab>a gets it to print in the same way as a regular echo, but it prints that way in replace-ranges too, which means it still doesn't print as it should. This also applies to newlines as well as tabs.