Preserve style after alignment
This makes wrapping text with background colour look much better.weechat-hashes
parent
99612ad8eb
commit
16737d4edc
5
buffer.c
5
buffer.c
|
@ -33,6 +33,7 @@
|
||||||
#include <sysexits.h>
|
#include <sysexits.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
|
#include <wctype.h>
|
||||||
|
|
||||||
#include "chat.h"
|
#include "chat.h"
|
||||||
|
|
||||||
|
@ -160,10 +161,10 @@ static int flow(struct Lines *hard, int cols, const struct Line *soft) {
|
||||||
if (!line->str) err(EX_OSERR, "malloc");
|
if (!line->str) err(EX_OSERR, "malloc");
|
||||||
|
|
||||||
struct Cat cat = { line->str, cap, 0 };
|
struct Cat cat = { line->str, cap, 0 };
|
||||||
|
catf(&cat, "%*s%n", align, "", &width);
|
||||||
styleCat(&cat, style);
|
styleCat(&cat, style);
|
||||||
str = &line->str[cat.len];
|
str = &line->str[cat.len];
|
||||||
catf(&cat, "%*s%n%s", align, "", &width, &wrap[n]);
|
catf(&cat, "%s", &wrap[n]);
|
||||||
str += width;
|
|
||||||
|
|
||||||
*wrap = '\0';
|
*wrap = '\0';
|
||||||
wrap = NULL;
|
wrap = NULL;
|
||||||
|
|
Loading…
Reference in New Issue