mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 14:58:18 +00:00
Use portable format specifiers: Improve arguments formatting.
At some places, printf-like function's arguments styling could be improved to enhance readability.
This commit is contained in:

committed by
Thiago de Arruda

parent
e194324885
commit
4d0dd14189
@@ -2179,8 +2179,9 @@ void buflist_list(exarg_T *eap)
|
|||||||
IObuff[len++] = ' ';
|
IObuff[len++] = ' ';
|
||||||
} while (--i > 0 && len < IOSIZE - 18);
|
} while (--i > 0 && len < IOSIZE - 18);
|
||||||
vim_snprintf((char *)IObuff + len, (size_t)(IOSIZE - len),
|
vim_snprintf((char *)IObuff + len, (size_t)(IOSIZE - len),
|
||||||
_("line %" PRId64), buf == curbuf ? (int64_t)curwin->w_cursor.lnum
|
_("line %" PRId64),
|
||||||
: (int64_t)buflist_findlnum(buf));
|
buf == curbuf ? (int64_t)curwin->w_cursor.lnum
|
||||||
|
: (int64_t)buflist_findlnum(buf));
|
||||||
msg_outtrans(IObuff);
|
msg_outtrans(IObuff);
|
||||||
out_flush(); /* output one line at a time */
|
out_flush(); /* output one line at a time */
|
||||||
ui_breakcheck();
|
ui_breakcheck();
|
||||||
|
@@ -4480,9 +4480,8 @@ do_sub_msg (
|
|||||||
"%s", count_only ? _("1 match") : _("1 substitution"));
|
"%s", count_only ? _("1 match") : _("1 substitution"));
|
||||||
else
|
else
|
||||||
vim_snprintf_add((char *)msg_buf, sizeof(msg_buf),
|
vim_snprintf_add((char *)msg_buf, sizeof(msg_buf),
|
||||||
count_only ?
|
count_only ? _("%" PRId64 " matches")
|
||||||
_("%" PRId64 " matches") :
|
: _("%" PRId64 " substitutions"),
|
||||||
_("%" PRId64 " substitutions"),
|
|
||||||
(int64_t)sub_nsubs);
|
(int64_t)sub_nsubs);
|
||||||
if (sub_nlines == 1)
|
if (sub_nlines == 1)
|
||||||
vim_snprintf_add((char *)msg_buf, sizeof(msg_buf),
|
vim_snprintf_add((char *)msg_buf, sizeof(msg_buf),
|
||||||
|
@@ -7897,9 +7897,8 @@ static void win_redr_ruler(win_T *wp, int always)
|
|||||||
* To avoid portability problems we use strlen() here.
|
* To avoid portability problems we use strlen() here.
|
||||||
*/
|
*/
|
||||||
vim_snprintf((char *)buffer, RULER_BUF_LEN, "%" PRId64 ",",
|
vim_snprintf((char *)buffer, RULER_BUF_LEN, "%" PRId64 ",",
|
||||||
(wp->w_buffer->b_ml.ml_flags & ML_EMPTY)
|
(wp->w_buffer->b_ml.ml_flags & ML_EMPTY) ? (int64_t)0L
|
||||||
? (int64_t)0L
|
: (int64_t)wp->w_cursor.lnum);
|
||||||
: (int64_t)wp->w_cursor.lnum);
|
|
||||||
len = STRLEN(buffer);
|
len = STRLEN(buffer);
|
||||||
col_print(buffer + len, RULER_BUF_LEN - len,
|
col_print(buffer + len, RULER_BUF_LEN - len,
|
||||||
empty_line ? 0 : (int)wp->w_cursor.col + 1,
|
empty_line ? 0 : (int)wp->w_cursor.col + 1,
|
||||||
|
Reference in New Issue
Block a user