Skip to content

Commit c843b9a

Browse files
committed
Merge branch 'vim' of git://github.com/b4winckler/macvim into kaoriya
2 parents c3b3686 + 155ee7b commit c843b9a

33 files changed

+983
-140
lines changed

.hgtags

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,3 +1578,20 @@ b67d3a44262a97e7b3ae212fcffb36926b5f53f4 v7-3-232
15781578
441d364773dc53264b5f26042f8fc6f8b77c8044 v7-3-235
15791579
c1733ef5b6e87dde521d0d85a1e5e62259854ac1 v7-3-236
15801580
e3bb93df6c34da672244bce5695c1426da139614 v7-3-237
1581+
f2c108f44f415c7cfe92862e791a01cc542ac378 v7-3-238
1582+
0bef86c5c985218a9448fa16d935b913e67af8d5 v7-3-239
1583+
bf283e37792b4b557a2b9081e4fdb0e10acb9655 v7-3-240
1584+
0a650db0265381b540df8ca6bd716c4b2d47dfc9 v7-3-241
1585+
3d96ddbeb3b0003de29b736f63b76675909f133c v7-3-242
1586+
512ddd87f1a817749c8362bd043682a7bbd87014 v7-3-243
1587+
be6b6509636242cd7e6fab9a4b8772e97fc9a0db v7-3-244
1588+
52512eddb876f64399e98d12643233a87c9f2823 v7-3-245
1589+
3f1a4ed36d1b520a1ad5aa6cbf50d68bc8b9c7a5 v7-3-246
1590+
7fe2c092913e84e6717782da1f1a220069eebbe7 v7-3-247
1591+
57a7998e0fa8854a7a8c3946df1d4c9b1ee220e5 v7-3-248
1592+
9f71f5a526aff4f1e0eefe1068d9534aee427afa v7-3-249
1593+
f909f4f0f38c71594266b3595d31ce04d4ebe3ec v7-3-250
1594+
fe6ad3fd85322b394824a5c495a78061a747b074 v7-3-251
1595+
0b4289bcf8364854dd5f94c42d0252504103e5b9 v7-3-252
1596+
c21429d7768cd4b834a086dd47881d01bca74e8c v7-3-253
1597+
1eb805225de7750c03af7b0f7ac2f5dd18d032be v7-3-254

src/INSTALLpc.txt

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ The file "feature.h" can be edited to match your preferences. You can skip
1111
this, then you will get the default behavior as is documented, which should
1212
be fine for most people.
1313

14-
With the exception of the last two sections (Windows 3.1 and MS-DOS),
15-
this document assumes that you are building Vim for Win32
16-
(Windows NT/2000/XP/2003/Vista and Windows 95/98/Me)
14+
With the exception of two sections (Windows 3.1 and MS-DOS), this document
15+
assumes that you are building Vim for Win32 or later.
16+
(Windows 95/98/Me/NT/2000/XP/2003/Vista/7)
1717

1818

1919
Contents:
@@ -27,6 +27,9 @@ Contents:
2727
8. Windows 3.1
2828
9. MS-DOS
2929

30+
10. Installing after building from sources
31+
32+
3033
The currently preferred method is using the free Visual C++ Toolkit 2008
3134
|msvc-2008-express|, the produced binary runs on most MS-Windows systems. If
3235
you need the executable to run on Windows 98 or ME, use the 2003 one
@@ -409,3 +412,59 @@ will work properly! Esp. handling multi-byte file names.
409412

410413
If you get all kinds of strange error messages when compiling, try adding
411414
changing the file format from "unix" to "dos".
415+
416+
417+
10. Installing after building from sources
418+
==========================================
419+
420+
[provided by Michael Soyka]
421+
422+
After you've built the Vim binaries as described above, you're ready to
423+
install Vim on your system. However, if you've obtained the Vim sources
424+
using Mercurial or by downloading them as a unix tar file, you must first
425+
create a "vim73" directory. If you instead downloaded the sources as
426+
zip files, you can skip this setup as the zip archives already have the
427+
correct directory structure.
428+
429+
A. Create a Vim "runtime" subdirectory named "vim73"
430+
-----------------------------------------------------
431+
If you obtained your Vim sources as zip files, you can skip this step.
432+
Otherwise, continue reading.
433+
434+
Go to the directory that contains the Vim "src" and "runtime"
435+
directories and create a new subdirectory named "vim73".
436+
437+
Copy the "runtime" files into "vim73":
438+
copy runtime\* vim73
439+
440+
B. Copy the new binaries into the "vim73" directory
441+
----------------------------------------------------
442+
Regardless of how you installed the Vim sources, you need to copy the
443+
new binaries you created above into "vim73":
444+
445+
copy src\*.exe vim73
446+
copy src\GvimExt\gvimext.dll vim73
447+
copy src\xxd\xxd.exe vim73
448+
449+
C. Move the "vim73" directory into the Vim installation subdirectory
450+
---------------------------------------------------------------------
451+
Move the "vim73" subdirectory into the subdirectory where you want Vim
452+
to be installed. Typically, this subdirectory will be named "vim".
453+
If you already have a "vim73" subdirectory in "vim", delete it first
454+
by running its unstal.exe program.
455+
456+
D. Install Vim
457+
---------------
458+
"cd" to your Vim installation subdirectory "vim\vim73" and run the
459+
"install.exe" program. It will ask you a number of questions about
460+
how you would like to have your Vim setup. Among these are:
461+
- You can tell it to write a "_vimrc" file with your preferences in the
462+
parent directory.
463+
- It can also install an "Edit with Vim" entry in the Windows Explorer
464+
popup menu.
465+
- You can have it create batch files, so that you can run Vim from the
466+
console or in a shell. You can select one of the directories in your
467+
PATH or add the directory to PATH using the Windows Control Panel.
468+
- Create entries for Vim on the desktop and in the Start menu.
469+
470+
Happy Vimming!

src/auto/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5611,7 +5611,7 @@ __:
56115611
eof
56125612
eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
56135613
rm -f -- "${tmp_mkf}"
5614-
vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}"
5614+
vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
56155615
vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}"
56165616
vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`
56175617
vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//`

src/configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ eof
10681068
dnl -- delete the lines from make about Entering/Leaving directory
10691069
eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
10701070
rm -f -- "${tmp_mkf}"
1071-
vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}"
1071+
vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
10721072
vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}"
10731073
dnl remove -ltermcap, it can conflict with an earlier -lncurses
10741074
vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`

src/eval.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3431,6 +3431,9 @@ ex_call(eap)
34313431
{
34323432
curwin->w_cursor.lnum = lnum;
34333433
curwin->w_cursor.col = 0;
3434+
#ifdef FEAT_VIRTUALEDIT
3435+
curwin->w_cursor.coladd = 0;
3436+
#endif
34343437
}
34353438
arg = startarg;
34363439
if (get_func_tv(name, (int)STRLEN(name), &rettv, &arg,
@@ -11933,7 +11936,7 @@ f_has(argvars, rettv)
1193311936
#ifdef FEAT_SEARCHPATH
1193411937
"file_in_path",
1193511938
#endif
11936-
#if defined(UNIX) && !defined(USE_SYSTEM)
11939+
#if (defined(UNIX) && !defined(USE_SYSTEM)) || defined(WIN3264)
1193711940
"filterpipe",
1193811941
#endif
1193911942
#ifdef FEAT_FIND_ID
@@ -14349,7 +14352,7 @@ f_readfile(argvars, rettv)
1434914352
tolist = 0;
1435014353
for ( ; filtd < buflen || readlen <= 0; ++filtd)
1435114354
{
14352-
if (buf[filtd] == '\n' || readlen <= 0)
14355+
if (readlen <= 0 || buf[filtd] == '\n')
1435314356
{
1435414357
/* In binary mode add an empty list item when the last
1435514358
* non-empty line ends in a '\n'. */

src/ex_cmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ do_filter(line1, line2, eap, cmd, do_in, do_out)
11071107
if (do_out)
11081108
shell_flags |= SHELL_DOOUT;
11091109

1110-
#if !defined(USE_SYSTEM) && defined(UNIX)
1110+
#if (!defined(USE_SYSTEM) && defined(UNIX)) || defined(WIN3264)
11111111
if (!do_in && do_out && !p_stmp)
11121112
{
11131113
/* Use a pipe to fetch stdout of the command, do not use a temp file. */

src/ex_getln.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3063,7 +3063,7 @@ cmdline_paste(regname, literally, remcr)
30633063
int len;
30643064

30653065
/* Locate start of last word in the cmd buffer. */
3066-
for (w = ccline.cmdbuff + ccline.cmdlen; w > ccline.cmdbuff; )
3066+
for (w = ccline.cmdbuff + ccline.cmdpos; w > ccline.cmdbuff; )
30673067
{
30683068
#ifdef FEAT_MBYTE
30693069
if (has_mbyte)
@@ -3081,7 +3081,7 @@ cmdline_paste(regname, literally, remcr)
30813081
--w;
30823082
}
30833083
}
3084-
len = (int)((ccline.cmdbuff + ccline.cmdlen) - w);
3084+
len = (int)((ccline.cmdbuff + ccline.cmdpos) - w);
30853085
if (p_ic ? STRNICMP(w, arg, len) == 0 : STRNCMP(w, arg, len) == 0)
30863086
p += len;
30873087
}
@@ -5042,7 +5042,7 @@ ExpandRTDir(pat, num_file, file, dirnames)
50425042

50435043
*num_file = 0;
50445044
*file = NULL;
5045-
pat_len = STRLEN(pat);
5045+
pat_len = (int)STRLEN(pat);
50465046
ga_init2(&ga, (int)sizeof(char *), 10);
50475047

50485048
for (i = 0; dirnames[i] != NULL; ++i)

src/gui_w32.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,6 +1631,10 @@ gui_mch_init(void)
16311631
#endif
16321632

16331633
#ifdef FEAT_EVAL
1634+
# if _MSC_VER < 1400
1635+
/* HandleToLong() only exists in compilers that can do 64 bit builds */
1636+
# define HandleToLong(h) ((long)(h))
1637+
# endif
16341638
/* set the v:windowid variable */
16351639
set_vim_var_nr(VV_WINDOWID, HandleToLong(s_hwnd));
16361640
#endif

src/if_py_both.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,6 @@ WindowSetattr(PyObject *self, char *name, PyObject *val)
534534
{
535535
long lnum;
536536
long col;
537-
long len;
538537

539538
if (!PyArg_Parse(val, "(ll)", &lnum, &col))
540539
return -1;
@@ -549,18 +548,15 @@ WindowSetattr(PyObject *self, char *name, PyObject *val)
549548
if (VimErrorCheck())
550549
return -1;
551550

552-
/* When column is out of range silently correct it. */
553-
len = (long)STRLEN(ml_get_buf(this->win->w_buffer, lnum, FALSE));
554-
if (col > len)
555-
col = len;
556-
557551
this->win->w_cursor.lnum = lnum;
558552
this->win->w_cursor.col = col;
559553
#ifdef FEAT_VIRTUALEDIT
560554
this->win->w_cursor.coladd = 0;
561555
#endif
562-
update_screen(VALID);
556+
/* When column is out of range silently correct it. */
557+
check_cursor_col_win(this->win);
563558

559+
update_screen(VALID);
564560
return 0;
565561
}
566562
else if (strcmp(name, "height") == 0)

src/if_python3.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,16 @@
6868

6969
static void init_structs(void);
7070

71+
/* The "surrogateescape" error handler is new in Python 3.1 */
72+
#if PY_VERSION_HEX >= 0x030100f0
73+
# define CODEC_ERROR_HANDLER "surrogateescape"
74+
#else
75+
# define CODEC_ERROR_HANDLER NULL
76+
#endif
77+
7178
#define PyInt Py_ssize_t
7279
#define PyString_Check(obj) PyUnicode_Check(obj)
73-
#define PyString_AsBytes(obj) PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, NULL);
80+
#define PyString_AsBytes(obj) PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, CODEC_ERROR_HANDLER);
7481
#define PyString_FreeBytes(obj) Py_XDECREF(bytes)
7582
#define PyString_AsString(obj) PyBytes_AsString(obj)
7683
#define PyString_Size(obj) PyBytes_GET_SIZE(bytes)
@@ -661,8 +668,9 @@ DoPy3Command(exarg_T *eap, const char *cmd)
661668

662669
/* PyRun_SimpleString expects a UTF-8 string. Wrong encoding may cause
663670
* SyntaxError (unicode error). */
664-
cmdstr = PyUnicode_Decode(cmd, strlen(cmd), (char *)ENC_OPT, NULL);
665-
cmdbytes = PyUnicode_AsEncodedString(cmdstr, "utf-8", NULL);
671+
cmdstr = PyUnicode_Decode(cmd, strlen(cmd),
672+
(char *)ENC_OPT, CODEC_ERROR_HANDLER);
673+
cmdbytes = PyUnicode_AsEncodedString(cmdstr, "utf-8", CODEC_ERROR_HANDLER);
666674
Py_XDECREF(cmdstr);
667675
PyRun_SimpleString(PyBytes_AsString(cmdbytes));
668676
Py_XDECREF(cmdbytes);
@@ -1463,7 +1471,7 @@ LineToString(const char *str)
14631471
}
14641472
*p = '\0';
14651473

1466-
result = PyUnicode_Decode(tmp, len, (char *)ENC_OPT, NULL);
1474+
result = PyUnicode_Decode(tmp, len, (char *)ENC_OPT, CODEC_ERROR_HANDLER);
14671475

14681476
vim_free(tmp);
14691477
return result;

0 commit comments

Comments
 (0)