mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 16:37:27 +00:00
Use buffer size in cell_as_unicode_for_fallback as well
This commit is contained in:
parent
b4b2b44c92
commit
96d231dfa5
3 changed files with 4 additions and 4 deletions
|
|
@ -505,7 +505,7 @@ create_fallback_face(PyObject UNUSED *base_face, const ListOfChars *lc, bool bol
|
|||
if (!emoji_presentation && bold) { AP(FcPatternAddInteger, FC_WEIGHT, FC_WEIGHT_BOLD, "weight"); }
|
||||
if (!emoji_presentation && italic) { AP(FcPatternAddInteger, FC_SLANT, FC_SLANT_ITALIC, "slant"); }
|
||||
if (emoji_presentation) { AP(FcPatternAddBool, FC_COLOR, true, "color"); }
|
||||
size_t num = cell_as_unicode_for_fallback(lc, char_buf);
|
||||
size_t num = cell_as_unicode_for_fallback(lc, char_buf, arraysz(char_buf));
|
||||
add_charset(pat, num);
|
||||
d = _fc_match(pat);
|
||||
face_from_descriptor:
|
||||
|
|
|
|||
|
|
@ -402,11 +402,11 @@ text_at(Line* self, Py_ssize_t xval) {
|
|||
}
|
||||
|
||||
size_t
|
||||
cell_as_unicode_for_fallback(const ListOfChars *lc, Py_UCS4 *buf) {
|
||||
cell_as_unicode_for_fallback(const ListOfChars *lc, Py_UCS4 *buf, size_t sz) {
|
||||
size_t n = 1;
|
||||
buf[0] = lc->chars[0] ? lc->chars[0] : ' ';
|
||||
if (buf[0] != '\t') {
|
||||
for (unsigned i = 1; i < lc->count; i++) {
|
||||
for (unsigned i = 1; i < lc->count && n < sz; i++) {
|
||||
if (lc->chars[i] != VS15 && lc->chars[i] != VS16) buf[n++] = lc->chars[i];
|
||||
}
|
||||
} else buf[0] = ' ';
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ index_type next_char_pos(const Line *self, index_type x, index_type num);
|
|||
index_type prev_char_pos(const Line *self, index_type x, index_type num);
|
||||
bool line_as_ansi(Line *self, ANSILineState *s, index_type start_at, index_type stop_before, char_type prefix_char, bool skip_multiline_non_zero_lines) __attribute__((nonnull));
|
||||
unsigned int line_length(Line *self);
|
||||
size_t cell_as_unicode_for_fallback(const ListOfChars *lc, Py_UCS4 *buf);
|
||||
size_t cell_as_unicode_for_fallback(const ListOfChars *lc, Py_UCS4 *buf, size_t sz);
|
||||
size_t cell_as_utf8_for_fallback(const ListOfChars *lc, char *buf);
|
||||
bool unicode_in_range(const Line *self, const index_type start, const index_type limit, const bool include_cc, const bool add_trailing_newline, const bool skip_zero_cells, bool skip_multiline_non_zero_lines, ANSIBuf*);
|
||||
PyObject* line_as_unicode(Line *, bool, ANSIBuf*);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue