summaryrefslogtreecommitdiff
path: root/src/fe-text
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-10-29 19:03:19 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-10-29 19:03:19 +0000
commitae06c90be174e14c3971c934857e1487a6303d26 (patch)
tree6e2dbab6132c52c43808c4c0192b7cab18394c8f /src/fe-text
parent78064ed161f468d5c176e7307bb73f04e34f0255 (diff)
downloadirssi-ae06c90be174e14c3971c934857e1487a6303d26.zip
long word handling fixes
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@799 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text')
-rw-r--r--src/fe-text/gui-windows.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/fe-text/gui-windows.c b/src/fe-text/gui-windows.c
index f73a3b88..c4b2b8c0 100644
--- a/src/fe-text/gui-windows.c
+++ b/src/fe-text/gui-windows.c
@@ -255,7 +255,8 @@ void gui_window_newline(GUI_WINDOW_REC *gui, int visible)
}
}
-static LINE_CACHE_REC *gui_window_line_cache(GUI_WINDOW_REC *gui, LINE_REC *line)
+static LINE_CACHE_REC *gui_window_line_cache(GUI_WINDOW_REC *gui,
+ LINE_REC *line)
{
LINE_CACHE_REC *rec;
LINE_CACHE_SUB_REC *sub;
@@ -269,7 +270,7 @@ static LINE_CACHE_REC *gui_window_line_cache(GUI_WINDOW_REC *gui, LINE_REC *line
rec->last_access = time(NULL);
xpos = 0; color = 0; indent_pos = default_indent_pos;
- last_space = last_color = 0; last_space_ptr = NULL;
+ last_space = last_color = 0; last_space_ptr = NULL; sub = NULL;
rec->count = 1; lines = NULL;
for (ptr = (unsigned char *) line->text;;) {
@@ -317,6 +318,13 @@ static LINE_CACHE_REC *gui_window_line_cache(GUI_WINDOW_REC *gui, LINE_REC *line
continue;
}
+ if (xpos == COLS && sub != NULL &&
+ (last_space <= indent_pos || last_space <= 10)) {
+ /* long word, remove the indentation from this line */
+ xpos -= sub->indent;
+ sub->indent = 0;
+ }
+
if (xpos == COLS) {
xpos = indent_pos;
@@ -399,7 +407,7 @@ int gui_window_get_linecount(GUI_WINDOW_REC *gui, LINE_REC *line)
static void single_line_draw(GUI_WINDOW_REC *gui, int ypos,
LINE_CACHE_SUB_REC *rec, const char *text,
- const char *text_end, int continues)
+ const char *text_end)
{
WINDOW *cwin;
char *tmp;
@@ -418,7 +426,7 @@ static void single_line_draw(GUI_WINDOW_REC *gui, int ypos,
cwin = stdscr;
ypos += gui->parent->first_line;
#endif
- if (!continues) wmove(cwin, ypos, xpos);
+ wmove(cwin, ypos, xpos);
set_color(cwin, color);
while (text != text_end) {
@@ -499,8 +507,7 @@ int gui_window_line_draw(GUI_WINDOW_REC *gui, LINE_REC *line, int ypos, int skip
next_pos = (n+1 < cache->count) ?
cache->lines[n].start : NULL;
- single_line_draw(gui, ypos, sub, pos, next_pos,
- sub != NULL && sub->continues && n != skip);
+ single_line_draw(gui, ypos, sub, pos, next_pos);
}
#ifdef USE_CURSES_WINDOWS
@@ -558,7 +565,7 @@ void gui_window_redraw(WINDOW_REC *window)
static void gui_window_scroll_up(GUI_WINDOW_REC *gui, int lines)
{
LINE_REC *line;
- gint count, linecount;
+ int count, linecount;
if (gui->startline == NULL)
return;