Skip to content

Commit 4b63762

Browse files
committed
Remove load_colors & Remove logic from ex_colorscheme
1 parent 938f9ad commit 4b63762

File tree

3 files changed

+1
-60
lines changed

3 files changed

+1
-60
lines changed

src/ex_docmd.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5448,32 +5448,6 @@ get_command_name(expand_T *xp UNUSED, int idx)
54485448
static void
54495449
ex_colorscheme(exarg_T *eap)
54505450
{
5451-
if (*eap->arg == NUL)
5452-
{
5453-
#ifdef FEAT_EVAL
5454-
char_u *expr = vim_strsave((char_u *)"g:colors_name");
5455-
char_u *p = NULL;
5456-
5457-
if (expr != NULL)
5458-
{
5459-
++emsg_off;
5460-
p = eval_to_string(expr, NULL, FALSE);
5461-
--emsg_off;
5462-
vim_free(expr);
5463-
}
5464-
if (p != NULL)
5465-
{
5466-
msg((char *)p);
5467-
vim_free(p);
5468-
}
5469-
else
5470-
msg("default");
5471-
#else
5472-
msg(_("unknown"));
5473-
#endif
5474-
}
5475-
else if (load_colors(eap->arg) == FAIL)
5476-
semsg(_("E185: Cannot find color scheme '%s'"), eap->arg);
54775451
}
54785452

54795453
static void

src/proto/syntax.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ int syn_get_foldlevel(win_T *wp, long lnum);
2424
void ex_syntime(exarg_T *eap);
2525
char_u *get_syntime_arg(expand_T *xp, int idx);
2626
void init_highlight(int both, int reset);
27-
int load_colors(char_u *name);
2827
void do_highlight(char_u *line, int forceit, int init);
2928
void free_highlight(void);
3029
void restore_cterm_colors(void);

src/syntax.c

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ void init_highlight(
272272

273273
if (copy_p != NULL)
274274
{
275-
r = load_colors(copy_p);
275+
r = OK; // This used to be used to look up the load_colors() which has been removed in libvim.
276276
vim_free(copy_p);
277277
if (r == OK)
278278
return;
@@ -323,38 +323,6 @@ void init_highlight(
323323
}
324324
}
325325

326-
/*
327-
* Load color file "name".
328-
* Return OK for success, FAIL for failure.
329-
*/
330-
int load_colors(char_u *name)
331-
{
332-
char_u *buf;
333-
int retval = FAIL;
334-
static int recursive = FALSE;
335-
336-
/* When being called recursively, this is probably because setting
337-
* 'background' caused the highlighting to be reloaded. This means it is
338-
* working, thus we should return OK. */
339-
if (recursive)
340-
return OK;
341-
342-
recursive = TRUE;
343-
buf = alloc(STRLEN(name) + 12);
344-
if (buf != NULL)
345-
{
346-
apply_autocmds(EVENT_COLORSCHEMEPRE, name,
347-
curbuf->b_fname, FALSE, curbuf);
348-
sprintf((char *)buf, "colors/%s.vim", name);
349-
retval = source_runtime(buf, DIP_START + DIP_OPT);
350-
vim_free(buf);
351-
apply_autocmds(EVENT_COLORSCHEME, name, curbuf->b_fname, FALSE, curbuf);
352-
}
353-
recursive = FALSE;
354-
355-
return retval;
356-
}
357-
358326
static char *(color_names[28]) = {
359327
"Black", "DarkBlue", "DarkGreen", "DarkCyan",
360328
"DarkRed", "DarkMagenta", "Brown", "DarkYellow",

0 commit comments

Comments
 (0)