aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/cursor_shape.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/cursor_shape.c')
-rw-r--r--src/nvim/cursor_shape.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c
index 64cf1ea263..7461dc7288 100644
--- a/src/nvim/cursor_shape.c
+++ b/src/nvim/cursor_shape.c
@@ -101,15 +101,9 @@ Array mode_style_array(Arena *arena)
/// @returns error message for an illegal option, NULL otherwise.
const char *parse_shape_opt(int what)
{
- char *colonp;
- char *commap;
- char *slashp;
char *p = NULL;
- char *endp;
int idx = 0; // init for GCC
- int all_idx;
int len;
- int i;
bool found_ve = false; // found "ve" flag
// First round: check for errors; second round: do it for real.
@@ -126,8 +120,8 @@ const char *parse_shape_opt(int what)
// Repeat for all comma separated parts.
char *modep = p_guicursor;
while (modep != NULL && *modep != NUL) {
- colonp = vim_strchr(modep, ':');
- commap = vim_strchr(modep, ',');
+ char *colonp = vim_strchr(modep, ':');
+ char *commap = vim_strchr(modep, ',');
if (colonp == NULL || (commap != NULL && commap < colonp)) {
return N_("E545: Missing colon");
@@ -138,7 +132,7 @@ const char *parse_shape_opt(int what)
// Repeat for all modes before the colon.
// For the 'a' mode, we loop to handle all the modes.
- all_idx = -1;
+ int all_idx = -1;
while (modep < colonp || all_idx >= 0) {
if (all_idx < 0) {
// Find the mode
@@ -175,7 +169,7 @@ const char *parse_shape_opt(int what)
for (p = colonp + 1; *p && *p != ',';) {
{
// First handle the ones with a number argument.
- i = (uint8_t)(*p);
+ int i = (uint8_t)(*p);
len = 0;
if (STRNICMP(p, "ver", 3) == 0) {
len = 3;
@@ -221,7 +215,7 @@ const char *parse_shape_opt(int what)
}
p += 5;
} else { // must be a highlight group name then
- endp = vim_strchr(p, '-');
+ char *endp = vim_strchr(p, '-');
if (commap == NULL) { // last part
if (endp == NULL) {
endp = p + strlen(p); // find end of part
@@ -229,7 +223,7 @@ const char *parse_shape_opt(int what)
} else if (endp > commap || endp == NULL) {
endp = commap;
}
- slashp = vim_strchr(p, '/');
+ char *slashp = vim_strchr(p, '/');
if (slashp != NULL && slashp < endp) {
// "group/langmap_group"
i = syn_check_group(p, (size_t)(slashp - p));