Fix wrap marker when continuing to a new line with a multicell command

This commit is contained in:
Kovid Goyal 2024-12-27 10:00:26 +05:30
parent 95fbc6e9ba
commit 5b0e1b5b5c
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
3 changed files with 7 additions and 7 deletions

View file

@ -9,14 +9,10 @@
#include "text-cache.h"
// TODO: Test multiple OS windows with decorations also with changing font size and test on macOS and Linux for re-alloc
// TODO: Test handling of calt ligatures with scale see is_group_calt_ligature()
// TODO: Handle selection with multicell
// TODO: URL detection with multicell
// TODO: Wrapping of multicell draw commands
// TODO: Handle rewrap and restitch of multiline chars
// TODO: Handle rewrap when a character is too wide/tall to fit on resized screen
// TODO: Implement baseline align for box drawing
typedef union CellAttrs {
struct {

View file

@ -849,8 +849,7 @@ move_cursor_past_multicell(Screen *self, index_type required_width) {
self->cursor->x++;
}
if (self->modes.mDECAWM || has_multiline_cells_in_span(cp, self->columns - required_width, required_width)) {
self->cursor->x = 0;
screen_index(self);
continue_to_next_line(self);
} else {
self->cursor->x = self->columns - required_width;
if (cp[self->cursor->x].is_multicell) nuke_multicell_char_at(self, self->cursor->x, self->cursor->y, cp[self->cursor->x].x != 0);

View file

@ -53,6 +53,7 @@ def ae(key):
ae('vertical_align')
ae('text')
ae('natural_width')
ae('next_char_was_wrapped')
if 'cursor' in assertions:
self.ae(assertions['cursor'], (s.cursor.x, s.cursor.y), msg)
@ -127,9 +128,13 @@ def comb(x, y):
# Test wrapping
s.reset()
s.draw('x' * (s.columns - 1))
multicell(s, 'a', scale=2)
ac(s.columns - 1, 0, is_multicell=False, text='', next_char_was_wrapped=True)
s.reset()
multicell(s, 'a', scale=2)
s.draw('x' * s.columns)
ac(s.cursor.x-1, s.cursor.y, is_multicell=False, text='x')
ac(s.cursor.x-1, s.cursor.y, is_multicell=False, text='x', next_char_was_wrapped=False)
ac(0, 0, is_multicell=True, text='a')
ac(0, 1, is_multicell=True, text='', y=1)