Skip to content

Commit

Permalink
Fix wrap marker when continuing to a new line with a multicell command
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Dec 27, 2024
1 parent d6d7906 commit 7400c10
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 0 additions & 4 deletions kitty/line.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions kitty/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 6 additions & 1 deletion kitty_tests/multicell.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 7400c10

Please sign in to comment.