Compare commits

...

7 Commits

Author SHA1 Message Date
Bram Moolenaar
de9149ef18 updated for version 7.4a.031
Problem:    Compiler warnings. (Charles Campbell)
Solution:   Initialize variables even when not needed.
2013-07-17 19:22:13 +02:00
Bram Moolenaar
4a3aef7b28 updated for version 7.4a.030
Problem:    Missing find_win_for_buf(). (toothpik)
Solution:   Add missing changes.
2013-07-17 19:12:57 +02:00
Bram Moolenaar
9e90219032 updated for version 7.4a.029
Problem:    Can't build with MzScheme on Ubuntu 13.04.
Solution:   Add configure check for the "ffi" library.
2013-07-17 18:58:11 +02:00
Bram Moolenaar
706d2de9c1 updated for version 7.4a.028
Problem:    Crash when spell checking in new buffer.
Solution:   Set the b_p_key field.  (Mike Williams)
2013-07-17 17:35:13 +02:00
Bram Moolenaar
95064ece73 updated for version 7.4a.027
Problem:    When Python adds lines to another buffer the cursor position is
            wrong, it might be below the last line causing ml_get errors.
            (Vlad Irnov)
Solution:   Temporarily change the current window, so that marks are corrected
            properly.
2013-07-17 17:15:25 +02:00
Bram Moolenaar
33ca6bf240 updated for version 7.4a.026
Problem:    ":diffoff" does not remove folds. (Ramel)
Solution:   Do not restore 'foldenable' when 'foldmethod' is "manual".
2013-07-17 13:43:39 +02:00
Bram Moolenaar
56667a5d3e updated for version 7.4a.025
Problem:    Get the press-Enter prompt even after using :redraw.
Solution:   Clear need_wait_return when executing :redraw.
2013-07-17 11:54:28 +02:00
13 changed files with 208 additions and 31 deletions

85
src/auto/configure vendored
View File

@@ -5014,13 +5014,90 @@ $as_echo "needed" >&6; }
$as_echo "not needed" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ffi_type_void in -lffi" >&5
$as_echo_n "checking for ffi_type_void in -lffi... " >&6; }
if test "${ac_cv_lib_ffi_ffi_type_void+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lffi $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char ffi_type_void ();
int
main ()
{
return ffi_type_void ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_ffi_ffi_type_void=yes
else
ac_cv_lib_ffi_ffi_type_void=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ffi_ffi_type_void" >&5
$as_echo "$ac_cv_lib_ffi_ffi_type_void" >&6; }
if test "x$ac_cv_lib_ffi_ffi_type_void" = x""yes; then :
MZSCHEME_LIBS="$MZSCHEME_LIBS -lffi"
fi
MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \
-DMZSCHEME_COLLECTS='\"${SCHEME_COLLECTS}collects\"'"
MZSCHEME_SRC="if_mzsch.c"
MZSCHEME_OBJ="objects/if_mzsch.o"
MZSCHEME_PRO="if_mzsch.pro"
$as_echo "#define FEAT_MZSCHEME 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compile and link flags for MzScheme are sane" >&5
$as_echo_n "checking if compile and link flags for MzScheme are sane... " >&6; }
cflags_save=$CFLAGS
libs_save=$LIBS
CFLAGS="$CFLAGS $MZSCHEME_CFLAGS"
LIBS="$LIBS $MZSCHEME_LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; mzs_ok=yes
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no: MZSCHEME DISABLED" >&5
$as_echo "no: MZSCHEME DISABLED" >&6; }; mzs_ok=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$cflags_save
LIBS=$libs_save
if test $mzs_ok = yes; then
MZSCHEME_SRC="if_mzsch.c"
MZSCHEME_OBJ="objects/if_mzsch.o"
MZSCHEME_PRO="if_mzsch.pro"
$as_echo "#define FEAT_MZSCHEME 1" >>confdefs.h
else
MZSCHEME_CFLAGS=
MZSCHEME_LIBS=
MZSCHEME_EXTRA=
MZSCHEME_MZC=
fi
fi

View File

@@ -5313,18 +5313,14 @@ buf_spname(buf)
#if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
if (bt_quickfix(buf))
{
win_T *win = NULL;
win_T *win;
tabpage_T *tp;
/*
* For location list window, w_llist_ref points to the location list.
* For quickfix window, w_llist_ref is NULL.
*/
FOR_ALL_TAB_WINDOWS(tp, win)
if (win->w_buffer == buf)
goto win_found;
win_found:
if (win != NULL && win->w_llist_ref != NULL)
if (find_win_for_buf(buf, &win, &tp) == OK && win->w_llist_ref != NULL)
return (char_u *)_(msg_loclist);
else
return (char_u *)_(msg_qflist);
@@ -5345,6 +5341,28 @@ win_found:
return NULL;
}
#if (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
|| defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) \
|| defined(PROTO)
/*
* Find a window for buffer "buf".
* If found OK is returned and "wp" and "tp" are set to the window and tabpage.
* If not found FAIL is returned.
*/
int
find_win_for_buf(buf, wp, tp)
buf_T *buf;
win_T **wp;
tabpage_T **tp;
{
FOR_ALL_TAB_WINDOWS(*tp, *wp)
if ((*wp)->w_buffer == buf)
goto win_found;
return FAIL;
win_found:
return OK;
}
#endif
#if defined(FEAT_SIGNS) || defined(PROTO)
/*

View File

@@ -702,12 +702,34 @@ if test "$enable_mzschemeinterp" = "yes"; then
AC_MSG_RESULT(not needed)
fi
dnl On Ubuntu this fixes "undefined reference to symbol 'ffi_type_void'".
AC_CHECK_LIB(ffi, ffi_type_void, [MZSCHEME_LIBS="$MZSCHEME_LIBS -lffi"])
MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \
-DMZSCHEME_COLLECTS='\"${SCHEME_COLLECTS}collects\"'"
MZSCHEME_SRC="if_mzsch.c"
MZSCHEME_OBJ="objects/if_mzsch.o"
MZSCHEME_PRO="if_mzsch.pro"
AC_DEFINE(FEAT_MZSCHEME)
dnl Test that we can compile a simple program with these CFLAGS and LIBS.
AC_MSG_CHECKING([if compile and link flags for MzScheme are sane])
cflags_save=$CFLAGS
libs_save=$LIBS
CFLAGS="$CFLAGS $MZSCHEME_CFLAGS"
LIBS="$LIBS $MZSCHEME_LIBS"
AC_TRY_LINK(,[ ],
AC_MSG_RESULT(yes); mzs_ok=yes,
AC_MSG_RESULT(no: MZSCHEME DISABLED); mzs_ok=no)
CFLAGS=$cflags_save
LIBS=$libs_save
if test $mzs_ok = yes; then
MZSCHEME_SRC="if_mzsch.c"
MZSCHEME_OBJ="objects/if_mzsch.o"
MZSCHEME_PRO="if_mzsch.pro"
AC_DEFINE(FEAT_MZSCHEME)
else
MZSCHEME_CFLAGS=
MZSCHEME_LIBS=
MZSCHEME_EXTRA=
MZSCHEME_MZC=
fi
fi
AC_SUBST(MZSCHEME_SRC)
AC_SUBST(MZSCHEME_OBJ)

View File

@@ -1235,10 +1235,19 @@ ex_diffoff(eap)
curbuf = curwin->w_buffer;
if (wp->w_p_fdc == diff_foldcolumn)
wp->w_p_fdc = wp->w_p_diff_saved ? wp->w_p_fdc_save : 0;
if (wp->w_p_fen)
wp->w_p_fen = wp->w_p_diff_saved ? wp->w_p_fen_save : FALSE;
if (wp->w_p_fdl == 0 && wp->w_p_diff_saved)
wp->w_p_fdl = wp->w_p_fdl_save;
if (wp->w_p_fen)
{
/* Only restore 'foldenable' when 'foldmethod' is not
* "manual", otherwise we continue to show the diff folds. */
if (foldmethodIsManual(wp) || !wp->w_p_diff_saved)
wp->w_p_fen = FALSE;
else
wp->w_p_fen = wp->w_p_fen_save;
}
foldUpdateAll(wp);
/* make sure topline is not halfway a fold */
changed_window_setting_win(wp);

View File

@@ -8981,6 +8981,9 @@ ex_redraw(eap)
msg_didout = FALSE;
msg_col = 0;
/* No need to wait after an intentional redraw. */
need_wait_return = FALSE;
out_flush();
}

View File

@@ -3997,30 +3997,43 @@ SetBufferLineList(
static int
InsertBufferLines(buf_T *buf, PyInt n, PyObject *lines, PyInt *len_change)
{
buf_T *save_curbuf = NULL;
win_T *wp;
win_T *save_curwin = NULL;
tabpage_T *tp;
tabpage_T *save_curtab = NULL;
/* First of all, we check the type of the supplied Python object.
* It must be a string or a list, or the call is in error.
*/
if (PyBytes_Check(lines) || PyUnicode_Check(lines))
{
char *str = StringToLine(lines);
buf_T *savebuf;
char *str = StringToLine(lines);
if (str == NULL)
return FAIL;
PyErr_Clear();
VimTryStart();
switch_buffer(&savebuf, buf);
if (find_win_for_buf(buf, &wp, &tp) == FAIL
|| switch_win(&save_curwin, &save_curtab, wp, tp, TRUE)
== FAIL)
switch_buffer(&save_curbuf, buf);
if (u_save((linenr_T)n, (linenr_T)(n+1)) == FAIL)
if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL)
RAISE_UNDO_FAIL;
else if (ml_append((linenr_T)n, (char_u *)str, 0, FALSE) == FAIL)
RAISE_INSERT_LINE_FAIL;
else
else if (save_curbuf == NULL)
/* Only adjust marks if we managed to switch to a window that
* holds the buffer, otherwise line numbers will be invalid. */
appended_lines_mark((linenr_T)n, 1L);
vim_free(str);
restore_buffer(savebuf);
if (save_curbuf == NULL)
restore_win(save_curwin, save_curtab, TRUE);
else
restore_buffer(save_curbuf);
update_screen(VALID);
if (VimTryEnd())
@@ -4036,7 +4049,6 @@ InsertBufferLines(buf_T *buf, PyInt n, PyObject *lines, PyInt *len_change)
PyInt i;
PyInt size = PyList_Size(lines);
char **array;
buf_T *savebuf;
array = PyMem_New(char *, size);
if (array == NULL)
@@ -4061,7 +4073,10 @@ InsertBufferLines(buf_T *buf, PyInt n, PyObject *lines, PyInt *len_change)
PyErr_Clear();
VimTryStart();
switch_buffer(&savebuf, buf);
if (find_win_for_buf(buf, &wp, &tp) == FAIL
|| switch_win(&save_curwin, &save_curtab, wp, tp, TRUE)
== FAIL)
switch_buffer(&save_curbuf, buf);
if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL)
RAISE_UNDO_FAIL;
@@ -4087,11 +4102,13 @@ InsertBufferLines(buf_T *buf, PyInt n, PyObject *lines, PyInt *len_change)
}
/* Free the array of lines. All of its contents have now
* been freed.
*/
* been freed. */
PyMem_Free(array);
restore_buffer(savebuf);
if (save_curbuf == NULL)
restore_win(save_curwin, save_curtab, TRUE);
else
restore_buffer(save_curbuf);
update_screen(VALID);
if (VimTryEnd())

View File

@@ -52,6 +52,7 @@ void do_modelines __ARGS((int flags));
int read_viminfo_bufferlist __ARGS((vir_T *virp, int writing));
void write_viminfo_bufferlist __ARGS((FILE *fp));
char_u *buf_spname __ARGS((buf_T *buf));
int find_win_for_buf __ARGS((buf_T *buf, win_T **wp, tabpage_T **tp));
void buf_addsign __ARGS((buf_T *buf, int id, linenr_T lnum, int typenr));
linenr_T buf_change_sign_type __ARGS((buf_T *buf, int markId, int typenr));
int buf_getsigntype __ARGS((buf_T *buf, linenr_T lnum, int type));

View File

@@ -4060,9 +4060,13 @@ skip_add:
sub = &subs->norm;
}
/* avoid compiler warnings */
save_ptr = NULL;
save_lpos.lnum = 0;
save_lpos.col = 0;
/* Set the position (with "off" added) in the subexpression. Save
* and restore it when it was in use. Otherwise fill any gap. */
save_ptr = NULL;
if (REG_MULTI)
{
if (subidx < sub->in_use)
@@ -4192,11 +4196,16 @@ skip_add:
sub->list.multi[subidx].end.col =
(colnr_T)(reginput - regline + off);
}
/* avoid compiler warnings */
save_ptr = NULL;
}
else
{
save_ptr = sub->list.line[subidx].end;
sub->list.line[subidx].end = reginput + off;
/* avoid compiler warnings */
save_lpos.lnum = 0;
save_lpos.col = 0;
}
subs = addstate(l, state->out, subs, pim, off);

View File

@@ -4509,7 +4509,7 @@ current_search(count, forward)
int result; /* result of various function calls */
char_u old_p_ws = p_ws;
int flags = 0;
pos_T save_VIsual;
pos_T save_VIsual = VIsual;
int one_char;
/* wrapping should not occur */
@@ -4522,7 +4522,6 @@ current_search(count, forward)
if (VIsual_active)
{
orig_pos = curwin->w_cursor;
save_VIsual = VIsual;
pos = curwin->w_cursor;
start_pos = VIsual;

View File

@@ -9054,6 +9054,9 @@ open_spellbuf()
{
buf->b_spell = TRUE;
buf->b_p_swf = TRUE; /* may create a swap file */
#ifdef FEAT_CRYPT
buf->b_p_key = empty_option;
#endif
ml_open(buf);
ml_open_file(buf); /* create swap file now */
}

View File

@@ -7,6 +7,10 @@ STARTTEST
:set enc=latin1
:e!
:"
:" Check using z= in new buffer (crash fixed by patch 7.4a.028).
:set maxmem=512 spell
iasdz=:"
:"
:" Function to test .aff/.dic with list of good and bad words.
:func TestOne(aff, dic)
set spellfile=

View File

@@ -727,6 +727,20 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
31,
/**/
30,
/**/
29,
/**/
28,
/**/
27,
/**/
26,
/**/
25,
/**/
24,
/**/

View File

@@ -6577,7 +6577,8 @@ restore_snapshot_rec(sn, fr)
#endif
#if defined(FEAT_EVAL) || defined(PROTO)
#if defined(FEAT_EVAL) || defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) \
|| defined(PROTO)
/*
* Set "win" to be the curwin and "tp" to be the current tab page.
* restore_win() MUST be called to undo.