mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 7.4.1050
Problem: Warning for unused var with tiny features. (Tony Mechelynck) Solution: Add #ifdef. Use vim_snprintf(). Reduce number of statemements.
This commit is contained in:
parent
485dace817
commit
c71982b239
32
src/ops.c
32
src/ops.c
@ -6974,7 +6974,9 @@ cursor_pos_info(dict)
|
|||||||
char_u buf2[40];
|
char_u buf2[40];
|
||||||
linenr_T lnum;
|
linenr_T lnum;
|
||||||
long byte_count = 0;
|
long byte_count = 0;
|
||||||
|
#ifdef FEAT_MBYTE
|
||||||
long bom_count = 0;
|
long bom_count = 0;
|
||||||
|
#endif
|
||||||
long byte_count_cursor = 0;
|
long byte_count_cursor = 0;
|
||||||
long char_count = 0;
|
long char_count = 0;
|
||||||
long char_count_cursor = 0;
|
long char_count_cursor = 0;
|
||||||
@ -7190,15 +7192,15 @@ cursor_pos_info(dict)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't shorten this message, the user asked for it. */
|
|
||||||
#ifdef FEAT_MBYTE
|
#ifdef FEAT_MBYTE
|
||||||
bom_count = bomb_size();
|
bom_count = bomb_size();
|
||||||
if (bom_count > 0)
|
if (bom_count > 0)
|
||||||
sprintf((char *)IObuff + STRLEN(IObuff), _("(+%ld for BOM)"),
|
vim_snprintf((char *)IObuff + STRLEN(IObuff), IOSIZE,
|
||||||
bom_count);
|
_("(+%ld for BOM)"), bom_count);
|
||||||
#endif
|
#endif
|
||||||
if (dict == NULL)
|
if (dict == NULL)
|
||||||
{
|
{
|
||||||
|
/* Don't shorten this message, the user asked for it. */
|
||||||
p = p_shm;
|
p = p_shm;
|
||||||
p_shm = (char_u *)"";
|
p_shm = (char_u *)"";
|
||||||
msg(IObuff);
|
msg(IObuff);
|
||||||
@ -7210,19 +7212,17 @@ cursor_pos_info(dict)
|
|||||||
{
|
{
|
||||||
dict_add_nr_str(dict, "words", (long)word_count, NULL);
|
dict_add_nr_str(dict, "words", (long)word_count, NULL);
|
||||||
dict_add_nr_str(dict, "chars", (long)char_count, NULL);
|
dict_add_nr_str(dict, "chars", (long)char_count, NULL);
|
||||||
dict_add_nr_str(dict, "bytes", (long)byte_count + bom_count, NULL);
|
dict_add_nr_str(dict, "bytes", (long)byte_count
|
||||||
if (VIsual_active)
|
# ifdef FEAT_MBYTE
|
||||||
{
|
+ bom_count
|
||||||
dict_add_nr_str(dict, "visual_bytes", (long)byte_count_cursor, NULL);
|
# endif
|
||||||
dict_add_nr_str(dict, "visual_chars", (long)char_count_cursor, NULL);
|
, NULL);
|
||||||
dict_add_nr_str(dict, "visual_words", (long)word_count_cursor, NULL);
|
dict_add_nr_str(dict, VIsual_active ? "visual_bytes" : "cursor_bytes",
|
||||||
}
|
(long)byte_count_cursor, NULL);
|
||||||
else
|
dict_add_nr_str(dict, VIsual_active ? "visual_chars" : "cursor_chars",
|
||||||
{
|
(long)char_count_cursor, NULL);
|
||||||
dict_add_nr_str(dict, "cursor_bytes", (long)byte_count_cursor, NULL);
|
dict_add_nr_str(dict, VIsual_active ? "visual_words" : "cursor_words",
|
||||||
dict_add_nr_str(dict, "cursor_chars", (long)char_count_cursor, NULL);
|
(long)word_count_cursor, NULL);
|
||||||
dict_add_nr_str(dict, "cursor_words", (long)word_count_cursor, NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1050,
|
||||||
/**/
|
/**/
|
||||||
1049,
|
1049,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user