summaryrefslogtreecommitdiffstats
path: root/cmd-find-window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-03-28 16:30:05 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-03-28 16:30:05 +0000
commit6c0728fe0710c3a73ff0efbaf4e8e8281d99ecdf (patch)
treeb918fc36a5daafdd3e5223aca3a4d5227d994d3e /cmd-find-window.c
parent5872633aeff2ae60735458e3904cfe00087dc30d (diff)
Step 2 of the Grand Plan To Make UTF-8 Better.
Split grid into two arrays, one containing grid attributes/flags/colours (keeps the name grid_cell for now) and a separate with the character data (called text). The text is stored as a u_short but is treated as a uint64_t elsewhere; eventually the grid will have two arrays. I'm not happy with the naming so that might change. Still need to decide where to go from here. I'm not sure whether to combine the peek/set functions together, and also whether to continue to treat the text as a uint64_t (and convert to/from Unicode) or make it a char array (of size one when UTF-8 disabled, eight when enabled) and keep everything as UTF-8. Also since UTF-8 will eventually become an attribute of the grid itself it might be nice to move all the padding crap into grid.c.
Diffstat (limited to 'cmd-find-window.c')
-rw-r--r--cmd-find-window.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/cmd-find-window.c b/cmd-find-window.c
index cae763fe..333969c9 100644
--- a/cmd-find-window.c
+++ b/cmd-find-window.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-find-window.c,v 1.3 2009-01-19 18:23:40 nicm Exp $ */
+/* $Id: cmd-find-window.c,v 1.4 2009-03-28 16:30:05 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -163,19 +163,19 @@ cmd_find_window_callback(void *data, int idx)
char *
cmd_find_window_search(struct window_pane *wp, const char *searchstr)
{
- char *buf, *s;
- size_t off;
- const struct grid_cell *gc;
- u_int i, j, k;
- u_char data[4];
+ char *buf, *s;
+ size_t off;
+ uint64_t text;
+ u_int i, j, k;
+ u_char data[4];
buf = xmalloc(1);
for (j = 0; j < screen_size_y(&wp->base); j++) {
off = 0;
for (i = 0; i < screen_size_x(&wp->base); i++) {
- gc = grid_view_peek_cell(wp->base.grid, i, j);
- utf8_split(gc->data, data);
+ text = grid_view_peek_text(wp->base.grid, i, j);
+ utf8_split(text, data);
buf = xrealloc(buf, 1, off + 4);
for (k = 0; k < sizeof data; k++) {