Compare commits

...

9 Commits

Author SHA1 Message Date
Kazuki Sakamoto 0674485034 MacVim Snapshot 103
Binary targets OS X 10.8(Mountain Lion), 10.9(Mavericks), 10.10(Yosemite), and 10.11(El Capitan)

- Vim patch 7.4.1816

Script interfaces have compatibility with these versions

- Lua 5.2
- Perl 5.16
- Python2 2.7
- Python3 3.5
- Ruby 2.0
2016-05-04 09:49:49 -07:00
Kazuki Sakamoto 297440f777 Merge pull request #276 from macvim-dev/fix/termguicolors
Fix termgui_mch_get_color in MacVim
2016-05-04 08:25:18 -07:00
Kazuki Sakamoto a111780dc7 Fix termgui_mch_get_color in MacVim 2016-05-03 21:44:21 -07:00
Kazuki Sakamoto df7edfe33b Merge remote-tracking branch 'vim/master' 2016-05-01 20:47:48 -07:00
Bram Moolenaar d8585eded6 patch 7.4.1816
Problem:    Looping over a null list throws an error.
Solution:   Skip over the for loop.
2016-05-01 23:05:53 +02:00
Bram Moolenaar 9a3b3311d2 patch 7.4.1815
Problem:    Compiler warnings for unused variables. (Ajit Thakkar)
Solution:   Add a dummy initialization. (Yasuhiro Matsumoto)
2016-05-01 20:20:49 +02:00
Bram Moolenaar b8d4905592 patch 7.4.1814
Problem:    A channel may be garbage collected while it's still being used by
            a job. (James McCoy)
Solution:   Mark the channel as used if the job is still used.  Do the same
            for channels that are still used.
2016-05-01 14:22:16 +02:00
Bram Moolenaar 9b4ebc692d patch 7.4.1813
Problem:    Memory access error when running test_quickfix.
Solution:   Allocate one more byte. (Yegappan Lakshmanan)
2016-05-01 13:28:38 +02:00
Bram Moolenaar 187147aedd patch 7.4.1812
Problem:    Failure on startup with Athena and Motif.
Solution:   Check for INVALCOLOR. (Kazunobu Kuriyama)
2016-05-01 13:09:57 +02:00
11 changed files with 81 additions and 31 deletions
+1 -1
View File
@@ -1255,7 +1255,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>102</string>
<string>103</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
+3
View File
@@ -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
View File
@@ -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
View File
@@ -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);
+1
View File
@@ -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
View File
@@ -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
View File
@@ -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);
}
+6
View File
@@ -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);
}
+7
View File
@@ -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
+10
View File
@@ -768,6 +768,16 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1816,
/**/
1815,
/**/
1814,
/**/
1813,
/**/
1812,
/**/
1811,
/**/
+10
View File
@@ -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