mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0674485034 | |||
| 297440f777 | |||
| a111780dc7 | |||
| df7edfe33b | |||
| d8585eded6 | |||
| 9a3b3311d2 | |||
| b8d4905592 | |||
| 9b4ebc692d | |||
| 187147aedd |
@@ -1255,7 +1255,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>102</string>
|
||||
<string>103</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
@@ -1563,6 +1563,9 @@ gui_mch_flash(int msec)
|
||||
guicolor_T
|
||||
gui_mch_get_color(char_u *name)
|
||||
{
|
||||
if (![MMBackend sharedInstance])
|
||||
return INVALCOLOR;
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
name = CONVERT_TO_UTF8(name);
|
||||
#endif
|
||||
|
||||
+25
-18
@@ -3572,28 +3572,15 @@ set_ref_in_channel(int copyID)
|
||||
{
|
||||
int abort = FALSE;
|
||||
channel_T *channel;
|
||||
int part;
|
||||
typval_T tv;
|
||||
|
||||
for (channel = first_channel; channel != NULL; channel = channel->ch_next)
|
||||
{
|
||||
for (part = PART_SOCK; part < PART_IN; ++part)
|
||||
if (channel_still_useful(channel))
|
||||
{
|
||||
jsonq_T *head = &channel->ch_part[part].ch_json_head;
|
||||
jsonq_T *item = head->jq_next;
|
||||
|
||||
while (item != NULL)
|
||||
{
|
||||
list_T *l = item->jq_value->vval.v_list;
|
||||
|
||||
if (l->lv_copyID != copyID)
|
||||
{
|
||||
l->lv_copyID = copyID;
|
||||
abort = abort || set_ref_in_list(l, copyID, NULL);
|
||||
}
|
||||
item = item->jq_next;
|
||||
}
|
||||
tv.v_type = VAR_CHANNEL;
|
||||
tv.vval.v_channel = channel;
|
||||
abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL);
|
||||
}
|
||||
}
|
||||
return abort;
|
||||
}
|
||||
|
||||
@@ -4111,6 +4098,26 @@ job_still_useful(job_T *job)
|
||||
&& channel_still_useful(job->jv_channel)));
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark references in jobs that are still useful.
|
||||
*/
|
||||
int
|
||||
set_ref_in_job(int copyID)
|
||||
{
|
||||
int abort = FALSE;
|
||||
job_T *job;
|
||||
typval_T tv;
|
||||
|
||||
for (job = first_job; job != NULL; job = job->jv_next)
|
||||
if (job_still_useful(job))
|
||||
{
|
||||
tv.v_type = VAR_JOB;
|
||||
tv.vval.v_job = job;
|
||||
abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL);
|
||||
}
|
||||
return abort;
|
||||
}
|
||||
|
||||
void
|
||||
job_unref(job_T *job)
|
||||
{
|
||||
|
||||
+7
-1
@@ -3292,11 +3292,16 @@ eval_for_line(
|
||||
if (!skip)
|
||||
{
|
||||
l = tv.vval.v_list;
|
||||
if (tv.v_type != VAR_LIST || l == NULL)
|
||||
if (tv.v_type != VAR_LIST)
|
||||
{
|
||||
EMSG(_(e_listreq));
|
||||
clear_tv(&tv);
|
||||
}
|
||||
else if (l == NULL)
|
||||
{
|
||||
/* a null list is like an empty list: do nothing */
|
||||
clear_tv(&tv);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No need to increment the refcount, it's already set for the
|
||||
@@ -7024,6 +7029,7 @@ garbage_collect(int testing)
|
||||
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
abort = abort || set_ref_in_channel(copyID);
|
||||
abort = abort || set_ref_in_job(copyID);
|
||||
#endif
|
||||
#ifdef FEAT_NETBEANS_INTG
|
||||
abort = abort || set_ref_in_nb_channel(copyID);
|
||||
|
||||
@@ -49,6 +49,7 @@ void clear_job_options(jobopt_T *opt);
|
||||
void free_job_options(jobopt_T *opt);
|
||||
int get_job_options(typval_T *tv, jobopt_T *opt, int supported);
|
||||
channel_T *get_channel_arg(typval_T *tv, int check_open, int reading, int part);
|
||||
int set_ref_in_job(int copyID);
|
||||
void job_unref(job_T *job);
|
||||
int free_unused_jobs_contents(int copyID, int mask);
|
||||
void free_unused_jobs(int copyID, int mask);
|
||||
|
||||
+9
-9
@@ -207,9 +207,9 @@ qf_init_ext(
|
||||
char_u *fmtstr = NULL;
|
||||
char_u *growbuf = NULL;
|
||||
int growbuflen;
|
||||
int growbufsiz;
|
||||
char_u *linebuf;
|
||||
int linelen;
|
||||
int growbufsiz = 0;
|
||||
char_u *linebuf = NULL;
|
||||
int linelen = 0;
|
||||
int discard;
|
||||
int col = 0;
|
||||
char_u use_viscol = FALSE;
|
||||
@@ -545,12 +545,12 @@ qf_init_ext(
|
||||
linelen = len > LINE_MAXLEN ? LINE_MAXLEN - 1 : len;
|
||||
if (growbuf == NULL)
|
||||
{
|
||||
growbuf = alloc(linelen);
|
||||
growbuf = alloc(linelen + 1);
|
||||
growbufsiz = linelen;
|
||||
}
|
||||
else if (linelen > growbufsiz)
|
||||
{
|
||||
growbuf = vim_realloc(growbuf, linelen);
|
||||
growbuf = vim_realloc(growbuf, linelen + 1);
|
||||
if (growbuf == NULL)
|
||||
goto qf_init_end;
|
||||
growbufsiz = linelen;
|
||||
@@ -589,13 +589,13 @@ qf_init_ext(
|
||||
linelen = LINE_MAXLEN - 1;
|
||||
if (growbuf == NULL)
|
||||
{
|
||||
growbuf = alloc(linelen);
|
||||
growbuf = alloc(linelen + 1);
|
||||
growbufsiz = linelen;
|
||||
}
|
||||
else if (linelen > growbufsiz)
|
||||
{
|
||||
if ((growbuf = vim_realloc(growbuf,
|
||||
linelen)) == NULL)
|
||||
linelen + 1)) == NULL)
|
||||
goto qf_init_end;
|
||||
growbufsiz = linelen;
|
||||
}
|
||||
@@ -623,14 +623,14 @@ qf_init_ext(
|
||||
{
|
||||
if (growbuf == NULL)
|
||||
{
|
||||
growbuf = alloc(linelen);
|
||||
growbuf = alloc(linelen + 1);
|
||||
growbufsiz = linelen;
|
||||
}
|
||||
else if (linelen > growbufsiz)
|
||||
{
|
||||
if (linelen > LINE_MAXLEN)
|
||||
linelen = LINE_MAXLEN - 1;
|
||||
if ((growbuf = vim_realloc(growbuf, linelen)) == NULL)
|
||||
if ((growbuf = vim_realloc(growbuf, linelen + 1)) == NULL)
|
||||
goto qf_init_end;
|
||||
growbufsiz = linelen;
|
||||
}
|
||||
|
||||
+2
-2
@@ -9262,8 +9262,8 @@ set_hl_attr(
|
||||
at_en.ae_u.cterm.fg_color = sgp->sg_cterm_fg;
|
||||
at_en.ae_u.cterm.bg_color = sgp->sg_cterm_bg;
|
||||
# ifdef FEAT_TERMGUICOLORS
|
||||
at_en.ae_u.cterm.fg_rgb = GUI_MCH_GET_RGB(sgp->sg_gui_fg);
|
||||
at_en.ae_u.cterm.bg_rgb = GUI_MCH_GET_RGB(sgp->sg_gui_bg);
|
||||
at_en.ae_u.cterm.fg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_fg);
|
||||
at_en.ae_u.cterm.bg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_bg);
|
||||
# endif
|
||||
sgp->sg_cterm_attr = get_attr_entry(&cterm_attr_table, &at_en);
|
||||
}
|
||||
|
||||
@@ -1269,6 +1269,12 @@ static struct builtin_term builtin_termcaps[] =
|
||||
guicolor_T
|
||||
termgui_mch_get_color(char_u *name)
|
||||
{
|
||||
# if defined(FEAT_GUI_MACVIM)
|
||||
guicolor_T t;
|
||||
t = gui_mch_get_color(name);
|
||||
if (t != INVALCOLOR)
|
||||
return t;
|
||||
# endif
|
||||
return gui_get_color_cmn(name);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,3 +83,10 @@ func Test_getreg_empty_list()
|
||||
call add(x, 'foo')
|
||||
call assert_equal(['foo'], y)
|
||||
endfunc
|
||||
|
||||
func Test_loop_over_null_list()
|
||||
let null_list = submatch(1, 1)
|
||||
for i in null_list
|
||||
call assert_true(0, 'should not get here')
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
@@ -768,6 +768,16 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1816,
|
||||
/**/
|
||||
1815,
|
||||
/**/
|
||||
1814,
|
||||
/**/
|
||||
1813,
|
||||
/**/
|
||||
1812,
|
||||
/**/
|
||||
1811,
|
||||
/**/
|
||||
|
||||
@@ -1564,14 +1564,23 @@ typedef UINT32_TYPEDEF UINT32_T;
|
||||
#ifdef FEAT_GUI
|
||||
# ifdef FEAT_TERMGUICOLORS
|
||||
# define GUI_FUNCTION(f) (gui.in_use ? gui_##f : termgui_##f)
|
||||
# define GUI_FUNCTION2(f, pixel) (gui.in_use \
|
||||
? ((pixel) != INVALCOLOR \
|
||||
? gui_##f((pixel)) \
|
||||
: (long_u)INVALCOLOR) \
|
||||
: termgui_##f((pixel)))
|
||||
# define USE_24BIT (gui.in_use || p_tgc)
|
||||
# else
|
||||
# define GUI_FUNCTION(f) gui_##f
|
||||
# define GUI_FUNCTION2(f,pixel) ((pixel) != INVALCOLOR \
|
||||
? gui_##f((pixel)) \
|
||||
: (long_u)INVALCOLOR)
|
||||
# define USE_24BIT gui.in_use
|
||||
# endif
|
||||
#else
|
||||
# ifdef FEAT_TERMGUICOLORS
|
||||
# define GUI_FUNCTION(f) termgui_##f
|
||||
# define GUI_FUNCTION2(f, pixel) termgui_##f((pixel))
|
||||
# define USE_24BIT p_tgc
|
||||
# endif
|
||||
#endif
|
||||
@@ -1582,6 +1591,7 @@ typedef UINT32_TYPEDEF UINT32_T;
|
||||
#endif
|
||||
#ifdef GUI_FUNCTION
|
||||
# define GUI_MCH_GET_RGB GUI_FUNCTION(mch_get_rgb)
|
||||
# define GUI_MCH_GET_RGB2(pixel) GUI_FUNCTION2(mch_get_rgb, (pixel))
|
||||
# define GUI_MCH_GET_COLOR GUI_FUNCTION(mch_get_color)
|
||||
# define GUI_GET_COLOR GUI_FUNCTION(get_color)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user