summaryrefslogtreecommitdiffstats
path: root/window.c
diff options
context:
space:
mode:
authornicm <nicm>2017-01-12 10:15:55 +0000
committernicm <nicm>2017-01-12 10:15:55 +0000
commitdad3090d3201bd8272cb762beea8ef3aa8ce9673 (patch)
tree7eabaa5e21dba83f468d7bd93a90c5cfa1399700 /window.c
parent9b6aeacdc0118d97c35e822c958e925f12b513ed (diff)
Put all palette functions together in the file.
Diffstat (limited to 'window.c')
-rw-r--r--window.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/window.c b/window.c
index 454b5a45..3bf05bd6 100644
--- a/window.c
+++ b/window.c
@@ -1133,6 +1133,26 @@ window_pane_reset_palette(struct window_pane *wp)
wp->flags |= PANE_REDRAW;
}
+int
+window_pane_get_palette(const struct window_pane *wp, int c)
+{
+ int new;
+
+ if (wp == NULL || wp->palette == NULL)
+ return (-1);
+
+ new = -1;
+ if (c < 8)
+ new = wp->palette[c];
+ else if (c >= 90 && c <= 97)
+ new = wp->palette[8 + c - 90];
+ else if (c & COLOUR_FLAG_256)
+ new = wp->palette[c & ~COLOUR_FLAG_256];
+ if (new == 0)
+ return (-1);
+ return (new);
+}
+
static void
window_pane_mode_timer(__unused int fd, __unused short events, void *arg)
{
@@ -1517,23 +1537,3 @@ winlink_shuffle_up(struct session *s, struct winlink *wl)
return (idx);
}
-
-int
-window_pane_get_palette(const struct window_pane *wp, int c)
-{
- int new;
-
- if (wp == NULL || wp->palette == NULL)
- return (-1);
-
- new = -1;
- if (c < 8)
- new = wp->palette[c];
- else if (c >= 90 && c <= 97)
- new = wp->palette[8 + c - 90];
- else if (c & COLOUR_FLAG_256)
- new = wp->palette[c & ~COLOUR_FLAG_256];
- if (new == 0)
- return (-1);
- return (new);
-}