mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-14 20:44:32 +02:00
Image placement using Unicode placeholders
This commit introduces the Unicode placeholder image placement method. In particular: - Virtual placements can be created by passing `U=1` in a put command. - Images with virtual placements can be displayed using the placeholder character `U+10EEEE` with diacritics indicating rows and columns. - The image ID is indicated by the foreground color of the placeholder. Additionally, the most significant byte of the ID can be specified via the third diacritic. - Underline color can be optionally used to specify the placement ID. - A bug was fixed, which caused incomplete image removal when it was overwritten by another image with the same ID.
This commit is contained in:
@@ -81,6 +81,9 @@ typedef struct ImageAnchorPosition {
|
||||
#define DECORATION_FG_CODE 58
|
||||
#define CHAR_IS_BLANK(ch) ((ch) == 32 || (ch) == 0)
|
||||
|
||||
// PUA character used as an image placeholder.
|
||||
#define IMAGE_PLACEHOLDER_CHAR 0x10EEEE
|
||||
|
||||
#define FG 1
|
||||
#define BG 2
|
||||
|
||||
@@ -192,6 +195,7 @@ typedef union LineAttrs {
|
||||
struct {
|
||||
uint8_t is_continued : 1;
|
||||
uint8_t has_dirty_text : 1;
|
||||
uint8_t has_image_placeholders : 1;
|
||||
PromptKind prompt_kind : 2;
|
||||
};
|
||||
uint8_t val;
|
||||
|
||||
Reference in New Issue
Block a user