poe

Уређивач .po фајлова
git clone https://git.sr.ht/~strahinja/poe
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување d6e8658a85c0c2cf7c682ffc673cdebdff0ea7b8
родитељ 5a6bc88a3587b85192090ba6525544a7e38ff041
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Mon, 29 Apr 2024 17:51:04 +0200

Optimize flags formatting; poe.1.in: Remove .sp 1 requests

Signed-off-by: Страхиња Радић <contact@strahinja.org>

Diffstat:
Mdraw.c | 6++----
Mpo.c | 2+-
Mpoe.1.in | 3---
Mutil.h | 2+-
измењених датотека: 4, додавања: 4(+), брисања: 9(-)

diff --git a/draw.c b/draw.c @@ -613,13 +613,11 @@ draw_editbox(const struct DrawState* state) int h = EDIT_HEIGHT; int maxx = state->maxx; int maxy = state->maxy; - char flags_buf[MAXFLAGSBUF + 4]; + char flags_buf[MAXFLAGSBUF]; struct PoEntry* entry = state->entries + state->msgid_number - 1; size_t dlen = 0; - STRLCPY("[ ", flags_buf, MAXFLAGSBUF + 4); - format_flags(flags_buf + 2, MAXFLAGSBUF, entry); - STRLCPY(" ]", flags_buf + 2 + MAXFLAGSBUF - 1, MAXFLAGSBUF + 4 - 2); + format_flags(flags_buf, MAXFLAGSBUF, entry); startx = w > maxx ? 0 : (maxx - w) / 2; endx = w > maxx ? maxx - 1 : startx + w; diff --git a/po.c b/po.c @@ -25,7 +25,7 @@ int print_error(const int code, const char* msg, ...); char* format_flags(char* buffer, const size_t max, const struct PoEntry* entry) { - snprintf(buffer, max, "%c%c%c%c", + snprintf(buffer, max, "[ %c%c%c%c ]", entry->flags & FL_C_FORMAT ? 'C' : ' ', entry->flags & FL_FUZZY ? 'F' : ' ', entry->msgstr_count > 1 ? 'P' : ' ', diff --git a/poe.1.in b/poe.1.in @@ -49,7 +49,6 @@ _ \f[CR]z\fR or \f[CR]C-Z\fR@Toggle fuzzy flag \f[CR]q\fR or \f[CR]C-Q\fR@Quit .TE -.sp 1 .Pp Edit dialog key bindings are as follows: .TS @@ -82,7 +81,6 @@ _ \f[CR]Right\fR@Go to next character \f[CR]Down\fR@Go to next line .TE -.sp 1 .Pp In the table above, "current msgstr" refers to the situation when there are multiple msgstrs, representing different plural forms. @@ -120,7 +118,6 @@ _ \f[CR]P\fR@Message has plural forms \f[CR]N\fR@\f[CR]no-c-format\fR flag .TE -.sp 1 . .Ss "Error checking" .Nm diff --git a/util.h b/util.h @@ -46,7 +46,7 @@ enum { #define MAXBUFLINE 4096 #define MAXCOPYBUF 8192 #define MAXDATEBUF 80 -#define MAXFLAGSBUF (4 + 1) +#define MAXFLAGSBUF (2 + 4 + 2 + 1) #define MAXMSGLINE 1024 #define MSGDELTA 1024 #define MAXPATH 1024