Skip to content

Commit

Permalink
FauxFauxgh-42: Fix for wide (two-cell) characters messing up the URL …
Browse files Browse the repository at this point in the history
…detection boxes.
  • Loading branch information
twpol committed Aug 23, 2012
1 parent 625d9b7 commit fb9d2a8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion terminal.c
Expand Up @@ -4715,7 +4715,7 @@ static void do_paint(Terminal *term, Context ctx, int may_optimise)
termline *lp = lineptr(term->disptop + i);

for (j = 0; j < term->cols; j++) {
urlhack_putchar((char)(lp->chars[j].chr & CHAR_MASK));
urlhack_putchar((char)(lp->chars[j].chr & CHAR_MASK), j < term->cols-1 && lp->chars[j+1].chr == UCSWIDE ? 1 : 0);
}

unlineptr(lp);
Expand Down
4 changes: 2 additions & 2 deletions urlhack.cpp
Expand Up @@ -111,9 +111,9 @@ void urlhack_reset()



void urlhack_putchar(char ch)
void urlhack_putchar(char ch, int wide)
{
char r00fles[2] = { ch, 0 };
char r00fles[3] = { ch, wide ? ch : 0, 0 };
text_mass.append(r00fles);
}

Expand Down
2 changes: 1 addition & 1 deletion windows/urlhack.h
Expand Up @@ -19,7 +19,7 @@ extern int urlhack_mouse_old_x, urlhack_mouse_old_y, urlhack_current_region;

void urlhack_reset();
void urlhack_go_find_me_some_hyperlinks(int screen_width);
void urlhack_putchar(char ch);
void urlhack_putchar(char ch, int width);
text_region urlhack_get_link_region(int index);

void urlhack_clear_link_regions();
Expand Down

0 comments on commit fb9d2a8

Please sign in to comment.