Compare commits

...

15 Commits

Author SHA1 Message Date
Bram Moolenaar
55b7b7eeb5 updated for version 7.3.779
Problem:    Backwards search lands in wrong place when started on a multibyte
            character.
Solution:   Do not set extra_col for a backwards search. (Sung Pae)
2013-01-23 16:43:11 +01:00
Bram Moolenaar
94a8adfdd8 updated for version 7.3.778
Problem:    Compiler error for adding up two pointers. (Titov Anatoly)
Solution:   Add a type cast. (Ken Takata)
2013-01-23 16:19:23 +01:00
Bram Moolenaar
3be71ce28d updated for version 7.3.777
Problem:    When building with Gnome locale gets reset.
Solution:   Set locale after gnome_program_init(). (Christian Brabandt)
2013-01-23 16:00:11 +01:00
Bram Moolenaar
9d182dd0a6 updated for version 7.3.776
Problem:    ml_get error when searching, caused by curwin not matching curbuf.
Solution:   Avoid changing curbuf. (Lech Lorens)
2013-01-23 15:53:15 +01:00
Bram Moolenaar
4da70dbc4d updated for version 7.3.775
Problem:    Cygwin and Mingw builds miss dependency on gui_w48.c.
Solution:   Add a build rule. (Ken Takata)
2013-01-23 13:55:20 +01:00
Bram Moolenaar
f939c4e6b1 updated for version 7.3.774
Problem:    Tiny GUI version misses console dialog feature.
Solution:   Define FEAT_CON_DIALOG when apprpriate. (Christian Brabandt)
2013-01-23 13:41:00 +01:00
Bram Moolenaar
b5f7bf6ed9 updated for version 7.3.773
Problem:    Crash when OriginalFirstThunk is zero.
Solution:   Skip items with OriginalFirstThunk not set. (Ken Takata)
2013-01-19 14:02:02 +01:00
Bram Moolenaar
8c4fbd1a15 updated for version 7.3.772
Problem:    Cursor is at the wrong location and below the end of the file
            after doing substitutions with confirm flag: %s/x/y/c
            (Dominique Pelle)
Solution:   Update the cursor position. (Christian Brabandt & Dominique)
2013-01-17 18:34:05 +01:00
Bram Moolenaar
0936502538 updated for version 7.3.771
Problem:    Uninitialized variable. (Yasuhiro Matsumoto)
Solution:   Set x2 to -1.
2013-01-17 17:37:35 +01:00
Bram Moolenaar
08ed30eca7 updated for version 7.3.770
Problem:    Vim.h indentation is inconsistent.
Solution:   Adjust the indentation. (Elias Diem)
2013-01-17 17:17:26 +01:00
Bram Moolenaar
8c7694a864 updated for version 7.3.769
Problem:    'matchpairs' does not work with multi-byte characters.
Solution:   Make it work. (Christian Brabandt)
2013-01-17 17:02:05 +01:00
Bram Moolenaar
3e37fd0950 updated for version 7.3.768
Problem:    settabvar() and setwinvar() may move the cursor.
Solution:   Save and restore the cursor position when appropriate. (idea by
            Yasuhiro Matsumoto)
2013-01-17 15:37:01 +01:00
Bram Moolenaar
8fae8e658f updated for version 7.3.767
Problem:    (Win32) The _errno used for iconv may be the wrong one.
Solution:   Use the _errno from iconv.dll. (Ken Takata)
2013-01-17 14:39:47 +01:00
Bram Moolenaar
117f2c4b91 updated for version 7.3.766
Problem:    ":help cpo-*" jumps to the wrong place.
Solution:   Make it equivalent to ":help cpo-star".
2013-01-17 14:09:44 +01:00
Bram Moolenaar
802418d5eb updated for version 7.3.765
Problem:    Segfault when doing "cclose" on BufUnload in a python function.
            (Sean Reifschneider)
Solution:   Skip window with NULL buffer. (Christian Brabandt)
2013-01-17 14:00:11 +01:00
27 changed files with 378 additions and 126 deletions

View File

@@ -600,6 +600,9 @@ $(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h
$(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
$(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
$(OUTDIR)/gui_w32.o: gui_w32.c gui_w48.c $(INCL)
$(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
$(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o

View File

@@ -731,6 +731,9 @@ $(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h
$(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
$(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
$(OUTDIR)/gui_w32.o: gui_w32.c gui_w48.c $(INCL)
$(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
$(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o

View File

@@ -904,6 +904,14 @@ vim_isIDc(c)
int
vim_iswordc(c)
int c;
{
return vim_iswordc_buf(c, curbuf);
}
int
vim_iswordc_buf(c, buf)
int c;
buf_T *buf;
{
#ifdef FEAT_MBYTE
if (c >= 0x100)
@@ -914,7 +922,7 @@ vim_iswordc(c)
return utf_class(c) >= 2;
}
#endif
return (c > 0 && c < 0x100 && GET_CHARTAB(curbuf, c) != 0);
return (c > 0 && c < 0x100 && GET_CHARTAB(buf, c) != 0);
}
/*
@@ -933,7 +941,7 @@ vim_iswordp(p)
#if defined(FEAT_SYN_HL) || defined(PROTO)
int
vim_iswordc_buf(p, buf)
vim_iswordp_buf(p, buf)
char_u *p;
buf_T *buf;
{

View File

@@ -372,6 +372,8 @@ edit(cmdchar, startln, count)
*/
if (cmdchar != 'r' && cmdchar != 'v')
{
pos_T save_cursor = curwin->w_cursor;
# ifdef FEAT_EVAL
if (cmdchar == 'R')
ptr = (char_u *)"r";
@@ -382,6 +384,19 @@ edit(cmdchar, startln, count)
set_vim_var_string(VV_INSERTMODE, ptr, 1);
# endif
apply_autocmds(EVENT_INSERTENTER, NULL, NULL, FALSE, curbuf);
/* Since Insert mode was not started yet a call to check_cursor_col()
* may have moved the cursor, especially with the "A" command. */
if (curwin->w_cursor.col != save_cursor.col
&& curwin->w_cursor.lnum == save_cursor.lnum)
{
int save_state = State;
curwin->w_cursor = save_cursor;
State = INSERT;
check_cursor_col();
State = save_state;
}
}
#endif

View File

@@ -18884,7 +18884,7 @@ var2fpos(varp, dollar_lnum, fnum)
#endif
if (name[0] == '\'') /* mark */
{
pp = getmark_fnum(name[1], FALSE, fnum);
pp = getmark_buf_fnum(curbuf, name[1], FALSE, fnum);
if (pp == NULL || pp == (pos_T *)-1 || pp->lnum <= 0)
return NULL;
return pp;

View File

@@ -5200,6 +5200,12 @@ outofmem:
EMSG2(_(e_patnotf2), get_search_pat());
}
#ifdef FEAT_FOLDING
if (do_ask && hasAnyFolding(curwin))
/* Cursor position may require updating */
changed_window_setting();
#endif
vim_free(regmatch.regprog);
}
@@ -5849,14 +5855,14 @@ find_help_tags(arg, num_matches, matches, keep_lang)
int i;
static char *(mtable[]) = {"*", "g*", "[*", "]*", ":*",
"/*", "/\\*", "\"*", "**",
"/\\(\\)",
"cpo-*", "/\\(\\)",
"?", ":?", "?<CR>", "g?", "g?g?", "g??", "z?",
"/\\?", "/\\z(\\)", "\\=", ":s\\=",
"[count]", "[quotex]", "[range]",
"[pattern]", "\\|", "\\%$"};
static char *(rtable[]) = {"star", "gstar", "[star", "]star", ":star",
"/star", "/\\\\star", "quotestar", "starstar",
"/\\\\(\\\\)",
"cpo-star", "/\\\\(\\\\)",
"?", ":?", "?<CR>", "g?", "g?g?", "g??", "z?",
"/\\\\?", "/\\\\z(\\\\)", "\\\\=", ":s\\\\=",
"\\[count]", "\\[quotex]", "\\[range]",

View File

@@ -791,6 +791,15 @@
# endif
#endif
/*
* On some systems, when we compile with the GUI, we always use it. On Mac
* there is no terminal version, and on Windows we can't figure out how to
* fork one off with :gui.
*/
#if defined(FEAT_GUI_MSWIN) || (defined(FEAT_GUI_MAC) && !defined(MACOS_X_UNIX))
# define ALWAYS_USE_GUI
#endif
/*
* +dialog_gui Use GUI dialog.
* +dialog_con May use Console dialog.
@@ -820,6 +829,9 @@
|| defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MSWIN) \
|| defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC))
# define FEAT_GUI_TEXTDIALOG
# ifndef ALWAYS_USE_GUI
# define FEAT_CON_DIALOG
# endif
#endif
/* Mac specific thing: Codewarrior interface. */

View File

@@ -58,15 +58,6 @@
# include "photon/PxProto.h"
#endif
/*
* On some systems, when we compile with the GUI, we always use it. On Mac
* there is no terminal version, and on Windows we can't figure out how to
* fork one off with :gui.
*/
#if defined(FEAT_GUI_MSWIN) || (defined(FEAT_GUI_MAC) && !defined(MACOS_X_UNIX))
# define ALWAYS_USE_GUI
#endif
/*
* On some systems scrolling needs to be done right away instead of in the
* main loop.

View File

@@ -3130,8 +3130,16 @@ gui_mch_init(void)
* exits on failure, but that's a non-issue because we already called
* gtk_init_check() in gui_mch_init_check(). */
if (using_gnome)
{
gnome_program_init(VIMPACKAGE, VIM_VERSION_SHORT,
LIBGNOMEUI_MODULE, gui_argc, gui_argv, NULL);
# if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
/* Make sure strtod() uses a decimal point, not a comma. Gnome init
* may change it. */
if (setlocale(LC_NUMERIC, NULL) != (char *) "C")
setlocale(LC_NUMERIC, "C");
# endif
}
#endif
vim_free(gui_argv);
gui_argv = NULL;

View File

@@ -1376,6 +1376,9 @@ getout(exitval)
for (wp = (tp == curtab)
? firstwin : tp->tp_firstwin; wp != NULL; wp = wp->w_next)
{
if (wp->w_buffer == NULL)
/* Autocmd must have close the buffer already, skip. */
continue;
buf = wp->w_buffer;
if (buf->b_changedtick != -1)
{

View File

@@ -304,7 +304,7 @@ movechangelist(count)
#endif
/*
* Find mark "c".
* Find mark "c" in buffer pointed to by "buf".
* If "changefile" is TRUE it's allowed to edit another file for '0, 'A, etc.
* If "fnum" is not NULL store the fnum there for '0, 'A etc., don't edit
* another file.
@@ -314,16 +314,26 @@ movechangelist(count)
* - NULL if there is no mark called 'c'.
* - -1 if mark is in other file and jumped there (only if changefile is TRUE)
*/
pos_T *
getmark_buf(buf, c, changefile)
buf_T *buf;
int c;
int changefile;
{
return getmark_buf_fnum(buf, c, changefile, NULL);
}
pos_T *
getmark(c, changefile)
int c;
int changefile;
{
return getmark_fnum(c, changefile, NULL);
return getmark_buf_fnum(curbuf, c, changefile, NULL);
}
pos_T *
getmark_fnum(c, changefile, fnum)
getmark_buf_fnum(buf, c, changefile, fnum)
buf_T *buf;
int c;
int changefile;
int *fnum;
@@ -351,15 +361,15 @@ getmark_fnum(c, changefile, fnum)
posp = &pos_copy; /* w_pcmark may be changed soon */
}
else if (c == '"') /* to pos when leaving buffer */
posp = &(curbuf->b_last_cursor);
posp = &(buf->b_last_cursor);
else if (c == '^') /* to where Insert mode stopped */
posp = &(curbuf->b_last_insert);
posp = &(buf->b_last_insert);
else if (c == '.') /* to where last change was made */
posp = &(curbuf->b_last_change);
posp = &(buf->b_last_change);
else if (c == '[') /* to start of previous operator */
posp = &(curbuf->b_op_start);
posp = &(buf->b_op_start);
else if (c == ']') /* to end of previous operator */
posp = &(curbuf->b_op_end);
posp = &(buf->b_op_end);
else if (c == '{' || c == '}') /* to previous/next paragraph */
{
pos_T pos;
@@ -395,8 +405,8 @@ getmark_fnum(c, changefile, fnum)
#ifdef FEAT_VISUAL
else if (c == '<' || c == '>') /* start/end of visual area */
{
startp = &curbuf->b_visual.vi_start;
endp = &curbuf->b_visual.vi_end;
startp = &buf->b_visual.vi_start;
endp = &buf->b_visual.vi_end;
if ((c == '<') == lt(*startp, *endp))
posp = startp;
else
@@ -404,7 +414,7 @@ getmark_fnum(c, changefile, fnum)
/*
* For Visual line mode, set mark at begin or end of line
*/
if (curbuf->b_visual.vi_mode == 'V')
if (buf->b_visual.vi_mode == 'V')
{
pos_copy = *posp;
posp = &pos_copy;
@@ -420,7 +430,7 @@ getmark_fnum(c, changefile, fnum)
#endif
else if (ASCII_ISLOWER(c)) /* normal named mark */
{
posp = &(curbuf->b_namedm[c - 'a']);
posp = &(buf->b_namedm[c - 'a']);
}
else if (ASCII_ISUPPER(c) || VIM_ISDIGIT(c)) /* named file mark */
{
@@ -435,7 +445,7 @@ getmark_fnum(c, changefile, fnum)
if (fnum != NULL)
*fnum = namedfm[c].fmark.fnum;
else if (namedfm[c].fmark.fnum != curbuf->b_fnum)
else if (namedfm[c].fmark.fnum != buf->b_fnum)
{
/* mark is in another file */
posp = &pos_copy;

View File

@@ -3242,7 +3242,7 @@ utf_strnicmp(s1, s2, n1, n2)
/*
* Version of strnicmp() that handles multi-byte characters.
* Needed for Big5, Sjift-JIS and UTF-8 encoding. Other DBCS encodings can
* Needed for Big5, Shift-JIS and UTF-8 encoding. Other DBCS encodings can
* probably use strnicmp(), because there are no ASCII characters in the
* second byte.
* Returns zero if s1 and s2 are equal (ignoring case), the difference between
@@ -4293,6 +4293,47 @@ static HINSTANCE hMsvcrtDLL = 0;
# define DYNAMIC_MSVCRT_DLL "msvcrt.dll"
# endif
/*
* Get the address of 'funcname' which is imported by 'hInst' DLL.
*/
static void *
get_iconv_import_func(HINSTANCE hInst, const char *funcname)
{
PBYTE pImage = (PBYTE)hInst;
PIMAGE_DOS_HEADER pDOS = (PIMAGE_DOS_HEADER)hInst;
PIMAGE_NT_HEADERS pPE;
PIMAGE_IMPORT_DESCRIPTOR pImpDesc;
PIMAGE_THUNK_DATA pIAT; /* Import Address Table */
PIMAGE_THUNK_DATA pINT; /* Import Name Table */
PIMAGE_IMPORT_BY_NAME pImpName;
if (pDOS->e_magic != IMAGE_DOS_SIGNATURE)
return NULL;
pPE = (PIMAGE_NT_HEADERS)(pImage + pDOS->e_lfanew);
if (pPE->Signature != IMAGE_NT_SIGNATURE)
return NULL;
pImpDesc = (PIMAGE_IMPORT_DESCRIPTOR)(pImage
+ pPE->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT]
.VirtualAddress);
for (; pImpDesc->FirstThunk; ++pImpDesc)
{
if (!pImpDesc->OriginalFirstThunk)
continue;
pIAT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->FirstThunk);
pINT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->OriginalFirstThunk);
for (; pIAT->u1.Function; ++pIAT, ++pINT)
{
if (IMAGE_SNAP_BY_ORDINAL(pINT->u1.Ordinal))
continue;
pImpName = (PIMAGE_IMPORT_BY_NAME)(pImage
+ (UINT_PTR)(pINT->u1.AddressOfData));
if (strcmp(pImpName->Name, funcname) == 0)
return (void *)pIAT->u1.Function;
}
}
return NULL;
}
/*
* Try opening the iconv.dll and return TRUE if iconv() can be used.
*/
@@ -4326,7 +4367,9 @@ iconv_enabled(verbose)
iconv_open = (void *)GetProcAddress(hIconvDLL, "libiconv_open");
iconv_close = (void *)GetProcAddress(hIconvDLL, "libiconv_close");
iconvctl = (void *)GetProcAddress(hIconvDLL, "libiconvctl");
iconv_errno = (void *)GetProcAddress(hMsvcrtDLL, "_errno");
iconv_errno = get_iconv_import_func(hIconvDLL, "_errno");
if (iconv_errno == NULL)
iconv_errno = (void *)GetProcAddress(hMsvcrtDLL, "_errno");
if (iconv == NULL || iconv_open == NULL || iconv_close == NULL
|| iconvctl == NULL || iconv_errno == NULL)
{

View File

@@ -2288,14 +2288,18 @@ ins_char_bytes(buf, charlen)
*/
if (p_sm && (State & INSERT)
&& msg_silent == 0
#ifdef FEAT_MBYTE
&& charlen == 1
#endif
#ifdef FEAT_INS_EXPAND
&& !ins_compl_active()
#endif
)
showmatch(c);
{
#ifdef FEAT_MBYTE
if (has_mbyte)
showmatch(mb_ptr2char(buf));
else
#endif
showmatch(c);
}
#ifdef FEAT_RIGHTLEFT
if (!p_ri || (State & REPLACE_FLAG))

View File

@@ -6149,16 +6149,46 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
/* 'matchpairs' */
else if (gvarp == &p_mps)
{
/* Check for "x:y,x:y" */
for (p = *varp; *p != NUL; p += 4)
#ifdef FEAT_MBYTE
if (has_mbyte)
{
if (p[1] != ':' || p[2] == NUL || (p[3] != NUL && p[3] != ','))
for (p = *varp; *p != NUL; ++p)
{
errmsg = e_invarg;
break;
int x2 = -1;
int x3 = -1;
if (*p != NUL)
p += mb_ptr2len(p);
if (*p != NUL)
x2 = *p++;
if (*p != NUL)
{
x3 = mb_ptr2char(p);
p += mb_ptr2len(p);
}
if (x2 != ':' || x3 == -1 || (*p != NUL && *p != ','))
{
errmsg = e_invarg;
break;
}
if (*p == NUL)
break;
}
}
else
#endif
{
/* Check for "x:y,x:y" */
for (p = *varp; *p != NUL; p += 4)
{
if (p[1] != ':' || p[2] == NUL || (p[3] != NUL && p[3] != ','))
{
errmsg = e_invarg;
break;
}
if (p[3] == NUL)
break;
}
if (p[3] == NUL)
break;
}
}
@@ -11453,3 +11483,101 @@ get_sts_value()
{
return curbuf->b_p_sts < 0 ? get_sw_value() : curbuf->b_p_sts;
}
/*
* Check matchpairs option for "*initc".
* If there is a match set "*initc" to the matching character and "*findc" to
* the opposite character. Set "*backwards" to the direction.
* When "switchit" is TRUE swap the direction.
*/
void
find_mps_values(initc, findc, backwards, switchit)
int *initc;
int *findc;
int *backwards;
int switchit;
{
char_u *ptr;
ptr = curbuf->b_p_mps;
while (*ptr != NUL)
{
#ifdef FEAT_MBYTE
if (has_mbyte)
{
char_u *prev;
if (mb_ptr2char(ptr) == *initc)
{
if (switchit)
{
*findc = *initc;
*initc = mb_ptr2char(ptr + mb_ptr2len(ptr) + 1);
*backwards = TRUE;
}
else
{
*findc = mb_ptr2char(ptr + mb_ptr2len(ptr) + 1);
*backwards = FALSE;
}
return;
}
prev = ptr;
ptr += mb_ptr2len(ptr) + 1;
if (mb_ptr2char(ptr) == *initc)
{
if (switchit)
{
*findc = *initc;
*initc = mb_ptr2char(prev);
*backwards = FALSE;
}
else
{
*findc = mb_ptr2char(prev);
*backwards = TRUE;
}
return;
}
ptr += mb_ptr2len(ptr);
}
else
#endif
{
if (*ptr == *initc)
{
if (switchit)
{
*backwards = TRUE;
*findc = *initc;
*initc = ptr[2];
}
else
{
*backwards = FALSE;
*findc = ptr[2];
}
return;
}
ptr += 2;
if (*ptr == *initc)
{
if (switchit)
{
*backwards = FALSE;
*findc = *initc;
*initc = ptr[-2];
}
else
{
*backwards = TRUE;
*findc = ptr[-2];
}
return;
}
++ptr;
}
if (*ptr == ',')
++ptr;
}
}

View File

@@ -19,8 +19,9 @@ int linetabsize_col __ARGS((int startcol, char_u *s));
int win_linetabsize __ARGS((win_T *wp, char_u *p, colnr_T len));
int vim_isIDc __ARGS((int c));
int vim_iswordc __ARGS((int c));
int vim_iswordc_buf __ARGS((int c, buf_T *buf));
int vim_iswordp __ARGS((char_u *p));
int vim_iswordc_buf __ARGS((char_u *p, buf_T *buf));
int vim_iswordp_buf __ARGS((char_u *p, buf_T *buf));
int vim_isfilec __ARGS((int c));
int vim_isfilec_or_wc __ARGS((int c));
int vim_isprintc __ARGS((int c));

View File

@@ -5,8 +5,9 @@ void setpcmark __ARGS((void));
void checkpcmark __ARGS((void));
pos_T *movemark __ARGS((int count));
pos_T *movechangelist __ARGS((int count));
pos_T *getmark_buf __ARGS((buf_T *buf, int c, int changefile));
pos_T *getmark __ARGS((int c, int changefile));
pos_T *getmark_fnum __ARGS((int c, int changefile, int *fnum));
pos_T *getmark_buf_fnum __ARGS((buf_T *buf, int c, int changefile, int *fnum));
pos_T *getnextmark __ARGS((pos_T *startpos, int dir, int begin_line));
void fmarks_check_names __ARGS((buf_T *buf));
int check_mark __ARGS((pos_T *pos));

View File

@@ -59,4 +59,5 @@ int file_ff_differs __ARGS((buf_T *buf, int ignore_empty));
int check_ff_value __ARGS((char_u *p));
long get_sw_value __ARGS((void));
long get_sts_value __ARGS((void));
void find_mps_values __ARGS((int *initc, int *findc, int *backwards, int switchit));
/* vim: set ft=c : */

View File

@@ -3623,7 +3623,6 @@ vim_regexec_multi(rmp, win, buf, lnum, col, tm)
proftime_T *tm; /* timeout limit or NULL */
{
long r;
buf_T *save_curbuf = curbuf;
reg_match = NULL;
reg_mmatch = rmp;
@@ -3638,10 +3637,7 @@ vim_regexec_multi(rmp, win, buf, lnum, col, tm)
#endif
ireg_maxcol = rmp->rmm_maxcol;
/* Need to switch to buffer "buf" to make vim_iswordc() work. */
curbuf = buf;
r = vim_regexec_both(NULL, col, tm);
curbuf = save_curbuf;
return r;
}
@@ -4185,7 +4181,7 @@ regmatch(scan)
int cmp = OPERAND(scan)[1];
pos_T *pos;
pos = getmark(mark, FALSE);
pos = getmark_buf(reg_buf, mark, FALSE);
if (pos == NULL /* mark doesn't exist */
|| pos->lnum <= 0 /* mark isn't set (in curbuf) */
|| (pos->lnum == reglnum + reg_firstlnum
@@ -4315,8 +4311,8 @@ regmatch(scan)
#endif
else
{
if (!vim_iswordc(c)
|| (reginput > regline && vim_iswordc(reginput[-1])))
if (!vim_iswordc_buf(c, reg_buf)
|| (reginput > regline && vim_iswordc_buf(reginput[-1], reg_buf)))
status = RA_NOMATCH;
}
break;
@@ -4339,8 +4335,8 @@ regmatch(scan)
#endif
else
{
if (!vim_iswordc(reginput[-1])
|| (reginput[0] != NUL && vim_iswordc(c)))
if (!vim_iswordc_buf(reginput[-1], reg_buf)
|| (reginput[0] != NUL && vim_iswordc_buf(c, reg_buf)))
status = RA_NOMATCH;
}
break; /* Matched with EOW */

View File

@@ -572,7 +572,8 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
extra_col = 0;
#ifdef FEAT_MBYTE
/* Watch out for the "col" being MAXCOL - 2, used in a closed fold. */
else if (has_mbyte && pos->lnum >= 1 && pos->lnum <= buf->b_ml.ml_line_count
else if (dir != BACKWARD && has_mbyte
&& pos->lnum >= 1 && pos->lnum <= buf->b_ml.ml_line_count
&& pos->col < MAXCOL - 2)
{
ptr = ml_get_buf(buf, pos->lnum, FALSE) + pos->col;
@@ -1786,28 +1787,8 @@ findmatchlimit(oap, initc, flags, maxtravel)
}
else if (initc != '#' && initc != NUL)
{
/* 'matchpairs' is "x:y,x:y" */
for (ptr = curbuf->b_p_mps; *ptr; ptr += 2)
{
if (*ptr == initc)
{
findc = initc;
initc = ptr[2];
backwards = TRUE;
break;
}
ptr += 2;
if (*ptr == initc)
{
findc = initc;
initc = ptr[-2];
backwards = FALSE;
break;
}
if (ptr[1] != ',')
break;
}
if (!findc) /* invalid initc! */
find_mps_values(&initc, &findc, &backwards, TRUE);
if (findc == NUL)
return NULL;
}
/*
@@ -1886,36 +1867,14 @@ findmatchlimit(oap, initc, flags, maxtravel)
--pos.col;
for (;;)
{
initc = linep[pos.col];
initc = PTR2CHAR(linep + pos.col);
if (initc == NUL)
break;
for (ptr = curbuf->b_p_mps; *ptr; ++ptr)
{
if (*ptr == initc)
{
findc = ptr[2];
backwards = FALSE;
break;
}
ptr += 2;
if (*ptr == initc)
{
findc = ptr[-2];
backwards = TRUE;
break;
}
if (!*++ptr)
break;
}
find_mps_values(&initc, &findc, &backwards, FALSE);
if (findc)
break;
#ifdef FEAT_MBYTE
if (has_mbyte)
pos.col += (*mb_ptr2len)(linep + pos.col);
else
#endif
++pos.col;
pos.col += MB_PTR2LEN(linep + pos.col);
}
if (!findc)
{
@@ -2260,7 +2219,8 @@ findmatchlimit(oap, initc, flags, maxtravel)
* inquote if the number of quotes in a line is even, unless this
* line or the previous one ends in a '\'. Complicated, isn't it?
*/
switch (c = linep[pos.col])
c = PTR2CHAR(linep + pos.col);
switch (c)
{
case NUL:
/* at end of line without trailing backslash, reset inquote */
@@ -2469,20 +2429,23 @@ showmatch(c)
* Only show match for chars in the 'matchpairs' option.
*/
/* 'matchpairs' is "x:y,x:y" */
for (p = curbuf->b_p_mps; *p != NUL; p += 2)
for (p = curbuf->b_p_mps; *p != NUL; ++p)
{
if (PTR2CHAR(p) == c
#ifdef FEAT_RIGHTLEFT
if (*p == c && (curwin->w_p_rl ^ p_ri))
break;
&& (curwin->w_p_rl ^ p_ri)
#endif
p += 2;
if (*p == c
)
break;
p += MB_PTR2LEN(p) + 1;
if (PTR2CHAR(p) == c
#ifdef FEAT_RIGHTLEFT
&& !(curwin->w_p_rl ^ p_ri)
#endif
)
break;
if (p[1] != ',')
p += MB_PTR2LEN(p);
if (*p == NUL)
return;
}

View File

@@ -1954,9 +1954,9 @@ syn_current_attr(syncing, displaying, can_spell, keep_state)
if (do_keywords)
{
line = syn_getcurline();
if (vim_iswordc_buf(line + current_col, syn_buf)
if (vim_iswordp_buf(line + current_col, syn_buf)
&& (current_col == 0
|| !vim_iswordc_buf(line + current_col - 1
|| !vim_iswordp_buf(line + current_col - 1
#ifdef FEAT_MBYTE
- (has_mbyte
? (*mb_head_off)(line, line + current_col - 1)
@@ -3280,7 +3280,7 @@ check_keyword_id(line, startcol, endcolp, flagsp, next_listp, cur_si, ccharp)
#endif
++kwlen;
}
while (vim_iswordc_buf(kwp + kwlen, syn_buf));
while (vim_iswordp_buf(kwp + kwlen, syn_buf));
if (kwlen > MAXKEYWLEN)
return 0;

View File

@@ -29,6 +29,9 @@ x/[\U1234abcd\u1234\uabcd]
x/\%d21879b
x/ [[=A=]]* [[=B=]]* [[=C=]]* [[=D=]]* [[=E=]]* [[=F=]]* [[=G=]]* [[=H=]]* [[=I=]]* [[=J=]]* [[=K=]]* [[=L=]]* [[=M=]]* [[=N=]]* [[=O=]]* [[=P=]]* [[=Q=]]* [[=R=]]* [[=S=]]* [[=T=]]* [[=U=]]* [[=V=]]* [[=W=]]* [[=X=]]* [[=Y=]]* [[=Z=]]*/e
x/ [[=a=]]* [[=b=]]* [[=c=]]* [[=d=]]* [[=e=]]* [[=f=]]* [[=g=]]* [[=h=]]* [[=i=]]* [[=j=]]* [[=k=]]* [[=l=]]* [[=m=]]* [[=n=]]* [[=o=]]* [[=p=]]* [[=q=]]* [[=r=]]* [[=s=]]* [[=t=]]* [[=u=]]* [[=v=]]* [[=w=]]* [[=x=]]* [[=y=]]* [[=z=]]*/e
x:" Test backwards search from a multi-byte char
/x
x?.
x:?^1?,$w! test.out
:e! test.out
G:put =matchstr(\"אבגד\", \".\", 0, 2) " ב
@@ -57,3 +60,4 @@ f
g a啷bb
h AÀÁÂÃÄÅĀĂĄǍǞǠẢ BḂḆ CÇĆĈĊČ DĎĐḊḎḐ EÈÉÊËĒĔĖĘĚẺẼ FḞ GĜĞĠĢǤǦǴḠ HĤĦḢḦḨ IÌÍÎÏĨĪĬĮİǏỈ JĴ KĶǨḰḴ LĹĻĽĿŁḺ MḾṀ NÑŃŅŇṄṈ OÒÓÔÕÖØŌŎŐƠǑǪǬỎ PṔṖ Q RŔŖŘṘṞ SŚŜŞŠṠ TŢŤŦṪṮ UÙÚÛÜŨŪŬŮŰŲƯǓỦ VṼ WŴẀẂẄẆ XẊẌ YÝŶŸẎỲỶỸ ZŹŻŽƵẐẔ
i aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑẕ
j 0123❤x

View File

@@ -16,6 +16,7 @@ f z
g abb
h AÀÁÂÃÄÅĀĂĄǍǞǠẢ BḂḆ CÇĆĈĊČ DĎĐḊḎḐ EÈÉÊËĒĔĖĘĚẺẼ FḞ GĜĞĠĢǤǦǴḠ HĤĦḢḦḨ IÌÍÎÏĨĪĬĮİǏỈ JĴ KĶǨḰḴ LĹĻĽĿŁḺ MḾṀ NÑŃŅŇṄṈ OÒÓÔÕÖØŌŎŐƠǑǪǬỎ PṔṖ Q RŔŖŘṘṞ SŚŜŞŠṠ TŢŤŦṪṮ UÙÚÛÜŨŪŬŮŰŲƯǓỦ VṼ WŴẀẂẄẆ XẊẌ YÝŶŸẎỲỶỸ ZŹŻŽƵẐ
i aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑ
j 012❤
ב
בג
א

View File

@@ -1,4 +1,5 @@
Test for multi-byte text formatting.
Also test, that 'mps' with multibyte chars works.
STARTTEST
:so mbyte.vim
@@ -133,6 +134,15 @@ ENDTEST
}
STARTTEST
/^{/+1
:set mps+=u2018:u2019
d%
ENDTEST
{
two three four
}
STARTTEST
:g/^STARTTEST/.,/^ENDTEST/d
:1;/^Results/,$wq! test.out

View File

@@ -140,3 +140,7 @@ a
a
}
{
four
}

View File

@@ -725,6 +725,36 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
779,
/**/
778,
/**/
777,
/**/
776,
/**/
775,
/**/
774,
/**/
773,
/**/
772,
/**/
771,
/**/
770,
/**/
769,
/**/
768,
/**/
767,
/**/
766,
/**/
765,
/**/
764,
/**/

View File

@@ -104,7 +104,7 @@
# endif
#endif
#if defined(MACOS_X) || defined(MACOS_CLASSIC)
# define MACOS
# define MACOS
#endif
#if defined(MACOS_X) && defined(MACOS_CLASSIC)
Error: To compile for both MACOS X and Classic use a Classic Carbon
@@ -490,7 +490,7 @@ typedef unsigned long u8char_T; /* long should be 32 bits or more */
# include <string.h>
# endif
# if defined(HAVE_STRINGS_H) && !defined(NO_STRINGS_WITH_STRING_H)
# include <strings.h>
# include <strings.h>
# endif
# ifdef HAVE_STAT_H
# include <stat.h>
@@ -515,22 +515,22 @@ typedef unsigned long u8char_T; /* long should be 32 bits or more */
# include <stdarg.h>
#endif
# if defined(HAVE_SYS_SELECT_H) && \
#if defined(HAVE_SYS_SELECT_H) && \
(!defined(HAVE_SYS_TIME_H) || defined(SYS_SELECT_WITH_SYS_TIME))
# include <sys/select.h>
# endif
# include <sys/select.h>
#endif
# ifndef HAVE_SELECT
# ifdef HAVE_SYS_POLL_H
# include <sys/poll.h>
#ifndef HAVE_SELECT
# ifdef HAVE_SYS_POLL_H
# include <sys/poll.h>
# define HAVE_POLL
# else
# ifdef HAVE_POLL_H
# include <poll.h>
# define HAVE_POLL
# else
# ifdef HAVE_POLL_H
# include <poll.h>
# define HAVE_POLL
# endif
# endif
# endif
#endif
/* ================ end of the header file puzzle =============== */
@@ -1877,8 +1877,8 @@ typedef int proftime_T; /* dummy for function prototypes */
/* VIM_ATOM_NAME is the older Vim-specific selection type for X11. Still
* supported for when a mix of Vim versions is used. VIMENC_ATOM_NAME includes
* the encoding to support Vims using different 'encoding' values. */
#define VIM_ATOM_NAME "_VIM_TEXT"
#define VIMENC_ATOM_NAME "_VIMENC_TEXT"
# define VIM_ATOM_NAME "_VIM_TEXT"
# define VIMENC_ATOM_NAME "_VIMENC_TEXT"
/* Selection states for modeless selection */
# define SELECT_CLEARED 0

View File

@@ -2276,9 +2276,15 @@ win_close(win, free_buf)
#endif
}
if (only_one_window() && win_valid(win) && win->w_buffer == NULL
&& (last_window() || curtab != prev_curtab
|| close_last_window_tabpage(win, free_buf, prev_curtab)))
/* Autocommands have close all windows, quit now. */
getout(0);
/* Autocommands may have closed the window already, or closed the only
* other window or moved to another tab page. */
if (!win_valid(win) || last_window() || curtab != prev_curtab
else if (!win_valid(win) || last_window() || curtab != prev_curtab
|| close_last_window_tabpage(win, free_buf, prev_curtab))
return;
@@ -6282,7 +6288,8 @@ only_one_window()
return FALSE;
for (wp = firstwin; wp != NULL; wp = wp->w_next)
if ((!((wp->w_buffer->b_help && !curbuf->b_help)
if (wp->w_buffer != NULL
&& (!((wp->w_buffer->b_help && !curbuf->b_help)
# ifdef FEAT_QUICKFIX
|| wp->w_p_pvw
# endif