You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There should be a function which replaces white-space characters with an appropriate character corresponding to the draw_white_space setting. Like · for space, ↩ for return and — for tab. This is a common issue that all frontends will have to deal with so we should have a helper function in the backend, probably in backend/render as this transformation isn't useful outside of rendering. Though themes might want to style these characters differently and be able to customize which exact unicode character is displayed so we should keep that in mind.
There's also a need for some helper code which scans a string for \t and returns a RegionSet (or []Region, or whatever) indicating in Region.A the position of the \t character, and in Region.B the number of spaces that it should be replaced with. Doing it this way we can use Region.A to reference the original string data or the "symbolized" version created with the unicode replacement characters as above, and then insert the appropriate number of characters for alignment.
Code from view.Insert should be refactored out to a separate function. IIRC the termbox frontend performs this transformation manually at the moment too, but the qml frontend will need something similar as \t is hardcoded in Qt to 8 spaces and isn't configurable, if I read the source code correctly.
But even if qml supported custom tab width, if we replace \t with another unicode character we still need to pad the text with white spaces to align the text, so this functionality is still needed.
The text was updated successfully, but these errors were encountered:
There should be a function which replaces white-space characters with an appropriate character corresponding to the
draw_white_space
setting. Like · for space, ↩ for return and — for tab. This is a common issue that all frontends will have to deal with so we should have a helper function in the backend, probably inbackend/render
as this transformation isn't useful outside of rendering. Though themes might want to style these characters differently and be able to customize which exact unicode character is displayed so we should keep that in mind.There's also a need for some helper code which scans a string for
\t
and returns aRegionSet
(or[]Region
, or whatever) indicating inRegion.A
the position of the\t
character, and inRegion.B
the number of spaces that it should be replaced with. Doing it this way we can useRegion.A
to reference the original string data or the "symbolized" version created with the unicode replacement characters as above, and then insert the appropriate number of characters for alignment.Code from view.Insert should be refactored out to a separate function. IIRC the termbox frontend performs this transformation manually at the moment too, but the qml frontend will need something similar as
\t
is hardcoded in Qt to 8 spaces and isn't configurable, if I read the source code correctly.But even if qml supported custom tab width, if we replace
\t
with another unicode character we still need to pad the text with white spaces to align the text, so this functionality is still needed.The text was updated successfully, but these errors were encountered: