summaryrefslogtreecommitdiff
path: root/src/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal.h')
-rw-r--r--src/internal.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/internal.h b/src/internal.h
index dd4649c..979883e 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -335,6 +335,15 @@ static inline uint32_t term_flags_pad(const struct term *t)
return term_current_flags(t) | ((uint32_t)t->cur_link << 16);
}
+static inline struct text_pen term_text_pen(const struct term *t)
+{
+ return (struct text_pen){
+ .fg = TERM_EXPECT(t->inverse, 0) ? t->cur_bg : t->cur_fg,
+ .bg = TERM_EXPECT(t->inverse, 0) ? t->cur_fg : t->cur_bg,
+ .sl = term_flags_pad(t),
+ };
+}
+
static inline void term_tabs_clear(struct term *t)
{
memset(t->tabs, 0, (size_t)t->tabs_cap);