aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-08-20 22:24:34 +0300
committerZyX <kp-pav@yandex.ru>2017-03-29 10:07:42 +0300
commite18a5783080f7c94f408ec5f53dedffdb69789e1 (patch)
tree17f54dfabb1163f2defce7989b3a182b846334f9 /src/nvim/syntax.c
parent50a48f2a0ecf7f767df961f7f5060505cf28e331 (diff)
downloadrneovim-e18a5783080f7c94f408ec5f53dedffdb69789e1.tar.gz
rneovim-e18a5783080f7c94f408ec5f53dedffdb69789e1.tar.bz2
rneovim-e18a5783080f7c94f408ec5f53dedffdb69789e1.zip
*: Move some dictionary functions to typval.h and use char*
Also fixes buffer reusage in setmatches() and complete().
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r--src/nvim/syntax.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 0a27d9dd92..632a5bf2a5 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -1406,14 +1406,14 @@ static int syn_stack_equal(synstate_T *sp)
/* If the pointer is different it can still be the
* same text. Compare the strings, ignore case when
* the start item has the sp_ic flag set. */
- if (bsx->matches[j] == NULL
- || six->matches[j] == NULL)
+ if (bsx->matches[j] == NULL || six->matches[j] == NULL) {
break;
- if ((SYN_ITEMS(syn_block)[CUR_STATE(i).si_idx]).sp_ic
- ? mb_stricmp(bsx->matches[j],
- six->matches[j]) != 0
- : STRCMP(bsx->matches[j], six->matches[j]) != 0)
+ }
+ if (mb_strcmp_ic((SYN_ITEMS(syn_block)[CUR_STATE(i).si_idx]).sp_ic,
+ (const char *)bsx->matches[j],
+ (const char *)six->matches[j]) != 0) {
break;
+ }
}
}
if (j != NSUBEXP)
@@ -6510,16 +6510,16 @@ do_highlight (
if (!ui_rgb_attached()) {
must_redraw = CLEAR;
if (color >= 0) {
- if (t_colors < 16)
+ if (t_colors < 16) {
i = (color == 0 || color == 4);
- else
+ } else {
i = (color < 7 || color == 8);
- /* Set the 'background' option if the value is
- * wrong. */
- if (i != (*p_bg == 'd'))
- set_option_value((char_u *)"bg", 0L,
- i ? (char_u *)"dark"
- : (char_u *)"light", 0);
+ }
+ // Set the 'background' option if the value is
+ // wrong.
+ if (i != (*p_bg == 'd')) {
+ set_option_value("bg", 0L, (i ? "dark" : "light"), 0);
+ }
}
}
}
@@ -7113,7 +7113,7 @@ set_hl_attr (
* Lookup a highlight group name and return it's ID.
* If it is not found, 0 is returned.
*/
-int syn_name2id(char_u *name)
+int syn_name2id(const char_u *name)
{
int i;
char_u name_u[200];