mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 22:28:24 +02:00
...
This commit is contained in:
@@ -506,12 +506,12 @@ is such a function in the Python language:
|
|||||||
g = graphemes[i]
|
g = graphemes[i]
|
||||||
if g is graphemes[-1]:
|
if g is graphemes[-1]:
|
||||||
prev_g = graphemes[i-1]
|
prev_g = graphemes[i-1]
|
||||||
yield f'\x1b[{prev_g.width}D' # move cursor back]
|
yield f'\x1b[{prev_g.width}D' # move cursor back
|
||||||
yield g.text
|
yield g.text
|
||||||
yield f'\x1b[{g.width}D' # move cursor back]
|
yield f'\x1b[{g.width}D' # move cursor back
|
||||||
yield f'\x1b[{prev_g.width}@' # insert cells]
|
yield f'\x1b[{prev_g.width}@' # insert cells
|
||||||
yield prev_g.text
|
yield prev_g.text
|
||||||
yield f'\x1b[{g.width}C' # move cursor forward]
|
yield f'\x1b[{g.width}C' # move cursor forward
|
||||||
|
|
||||||
Then, using ``wcswidth()`` the application can split long text into lines of
|
Then, using ``wcswidth()`` the application can split long text into lines of
|
||||||
width no more than the screen width and use the above function to write each
|
width no more than the screen width and use the above function to write each
|
||||||
|
|||||||
Reference in New Issue
Block a user