mirror of
https://github.com/vim/vim
synced 2025-07-15 16:51:57 +00:00
updated for version 7.0010
This commit is contained in:
9
Filelist
9
Filelist
@ -358,7 +358,14 @@ SRC_MAC = \
|
||||
src/gui_mac.c \
|
||||
src/gui_mac.icns \
|
||||
src/gui_mac.r \
|
||||
src/os_mac* \
|
||||
src/os_mac.build \
|
||||
src/os_mac.c \
|
||||
src/os_mac.h \
|
||||
src/os_mac.rsr.hqx \
|
||||
src/os_mac.sit.hqx \
|
||||
src/os_mac_conv.c \
|
||||
src/os_macosx.c \
|
||||
src/os_mac.pbproj/project.pbxproj
|
||||
src/proto/gui_mac.pro \
|
||||
src/proto/os_mac.pro \
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 7.0aa. Last change: 2004 Jul 05
|
||||
*eval.txt* For Vim version 7.0aa. Last change: 2004 Jul 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -814,6 +814,7 @@ bufname( {expr}) String Name of the buffer {expr}
|
||||
bufnr( {expr}) Number Number of the buffer {expr}
|
||||
bufwinnr( {expr}) Number window number of buffer {expr}
|
||||
byte2line( {byte}) Number line number at byte count {byte}
|
||||
byteidx( {expr}, {nr}) Number byte index of {nr}'th char in {expr}
|
||||
char2nr( {expr}) Number ASCII value of first char in {expr}
|
||||
cindent( {lnum}) Number C indent for line {lnum}
|
||||
col( {expr}) Number column nr of cursor or mark
|
||||
@ -897,6 +898,7 @@ remote_read( {serverid}) String read reply string
|
||||
remote_send( {server}, {string} [, {idvar}])
|
||||
String send key sequence
|
||||
rename( {from}, {to}) Number rename (move) file from {from} to {to}
|
||||
repeat( {expr}, {count}) String repeat {expr} {count} times
|
||||
resolve( {filename}) String get filename a shortcut points to
|
||||
search( {pattern} [, {flags}]) Number search for {pattern}
|
||||
searchpair( {start}, {middle}, {end} [, {flags} [, {skip}]])
|
||||
@ -1072,6 +1074,22 @@ byte2line({byte}) *byte2line()*
|
||||
{not available when compiled without the |+byte_offset|
|
||||
feature}
|
||||
|
||||
byteidx({expr}, {nr}) *byteidx()*
|
||||
Return byte index of the {nr}'th character in the string
|
||||
{expr}. Use zero for the first character, it returns zero.
|
||||
This function is only useful when there are multibyte
|
||||
characters, otherwise the returned value is equal to {nr}.
|
||||
Composing characters are counted as a separate character.
|
||||
Example : >
|
||||
echo matchstr(str, ".", byteidx(str, 3))
|
||||
< will display the fourth character. Another way to do the
|
||||
same: >
|
||||
let s = strpart(str, byteidx(str, 3))
|
||||
echo strpart(s, 0, byteidx(s, 1))
|
||||
< If there are less than {nr} characters -1 is returned.
|
||||
If there are exactly {nr} characters the length of the string
|
||||
is returned.
|
||||
|
||||
char2nr({expr}) *char2nr()*
|
||||
Return number value of the first char in {expr}. Examples: >
|
||||
char2nr(" ") returns 32
|
||||
@ -2179,6 +2197,12 @@ rename({from}, {to}) *rename()*
|
||||
successfully, and non-zero when the renaming failed.
|
||||
This function is not available in the |sandbox|.
|
||||
|
||||
repeat({expr}, {count}) *repeat()*
|
||||
Repeat {expr} {count} times and return the concatenated
|
||||
result. Example: >
|
||||
:let seperator = repeat('-', 80)
|
||||
< When {count} is zero or negative the result is empty.
|
||||
|
||||
resolve({filename}) *resolve()* *E655*
|
||||
On MS-Windows, when {filename} is a shortcut (a .lnk file),
|
||||
returns the path the shortcut points to in a simplified form.
|
||||
|
@ -5789,6 +5789,7 @@ remove-filetype filetype.txt /*remove-filetype*
|
||||
remove-option-flags options.txt /*remove-option-flags*
|
||||
rename() eval.txt /*rename()*
|
||||
rename-files tips.txt /*rename-files*
|
||||
repeat() eval.txt /*repeat()*
|
||||
repeat.txt repeat.txt /*repeat.txt*
|
||||
repeating repeat.txt /*repeating*
|
||||
replacing change.txt /*replacing*
|
||||
@ -5866,6 +5867,8 @@ s<CR> change.txt /*s<CR>*
|
||||
sandbox eval.txt /*sandbox*
|
||||
save-file editing.txt /*save-file*
|
||||
save-settings starting.txt /*save-settings*
|
||||
scheme-syntax syntax.txt /*scheme-syntax*
|
||||
scheme.vim syntax.txt /*scheme.vim*
|
||||
scp pi_netrw.txt /*scp*
|
||||
script-here if_perl.txt /*script-here*
|
||||
script-local map.txt /*script-local*
|
||||
|
@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 7.0aa. Last change: 2004 Jul 16
|
||||
*todo.txt* For Vim version 7.0aa. Last change: 2004 Jul 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -30,37 +30,12 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
When switching between Aap script and make Vim won't always run.
|
||||
Add fix for zh_cn to Vim 6.3? (Liang)
|
||||
|
||||
Mac: Compiling --enable-gui=athena doesn't work. Try to fix without disabling
|
||||
Carbon. Otherwise adjust configure to disable Darwin. (raf)
|
||||
|
||||
Mac: "make install" doesn't install. Patch from RAF.
|
||||
|
||||
UTF-8 in 'comments' causes wrong indent. Counting bytes instead of char
|
||||
width? (Nikolai Weibull)
|
||||
|
||||
For version 7.0:
|
||||
- Include many PATCHES:
|
||||
8 Add functions:
|
||||
strrep() Repeat a string (patch from Christophe Poucet,
|
||||
2003 Sep 12, also contains XX)
|
||||
Alt: repeat(expr, count) werkt ook voor lists.
|
||||
mousex() mousey() get position of mouse pointer (patch by Ross
|
||||
Presser)
|
||||
He will send a new patch.
|
||||
Is this really useful?
|
||||
multibyteidx(string, idx) Byte index in multi-byte character.
|
||||
Patch by Ilya Sher, 2004 Feb 25
|
||||
Update June 18 (third one).
|
||||
menuprop({name}, {idx}, {what})
|
||||
Get menu property of menu {name} item {idx}.
|
||||
menuprop("", 1, "name") returns "File".
|
||||
menuprop("File", 1, "n") returns "nmenu
|
||||
File.Open..." argument.
|
||||
Patch by Ilya Sher, 2004 Apr 22
|
||||
mapname({idx}, mode) return the name of the idx'th mapping.
|
||||
Patch by Ilya Sher, 2004 Mar 4.
|
||||
match({pat}, {string} [,start] [,count]) get index of count'th match
|
||||
Patch by Ilya Sher, 2004 Jun 19
|
||||
find() find file in 'path' (patch from Johannes
|
||||
@ -287,6 +262,8 @@ For version 7.0:
|
||||
- When using 'incsearch" CTRL-R CTRL-W gets the word under the cursor, but
|
||||
the part that already matched is doubled then. Remove the part of the
|
||||
word that would be doubled. Make it work line CTRL-N in Insert mode.
|
||||
- Add Lua interface? (Wolfgang Oertl)
|
||||
|
||||
|
||||
Vi incompatibility:
|
||||
8 With undo/redo only marks in the changed lines should be changed. Other
|
||||
@ -1486,6 +1463,17 @@ Built-in script language:
|
||||
7 Add argument to winwidth() to subtract the space taken by 'foldcolumn',
|
||||
signs and/or 'number'.
|
||||
8 Add functions:
|
||||
menuprop({name}, {idx}, {what})
|
||||
Get menu property of menu {name} item {idx}.
|
||||
menuprop("", 1, "name") returns "File".
|
||||
menuprop("File", 1, "n") returns "nmenu
|
||||
File.Open..." argument.
|
||||
Patch by Ilya Sher, 2004 Apr 22
|
||||
Return a list of menus and/or a dictionary
|
||||
with properties instead.
|
||||
mapname({idx}, mode) return the name of the idx'th mapping.
|
||||
Patch by Ilya Sher, 2004 Mar 4.
|
||||
Return a list instead.
|
||||
sprintf(format, arg, ..) How to prevent a crash???
|
||||
attributes() return file protection flags "drwxrwxrwx"
|
||||
mkdir(dir) Create directory
|
||||
|
@ -1,4 +1,4 @@
|
||||
*version7.txt* For Vim version 7.0aa. Last change: 2004 Jul 16
|
||||
*version7.txt* For Vim version 7.0aa. Last change: 2004 Jul 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -123,7 +123,10 @@ Win32: The ":winpos" command now also works in the console. (Vipin Aravind)
|
||||
|
||||
New functions: ~
|
||||
|
||||
tr(expr, from, to) |tr()| Translate characters. (Ron Aaron)
|
||||
repeat(expr, count) |repeat()| Repeat "expr" "count" times.
|
||||
(Christophe Poucet)
|
||||
tr(expr, from, to) |tr()| Translate characters. (Ron Aaron)
|
||||
byteidx(expr, nr) |byteidx()| Index of a character. (Ilya Sher)
|
||||
|
||||
|
||||
New autocommand events: ~
|
||||
@ -182,6 +185,12 @@ For lisp indenting and matching parenthesis: (Sergey Khorev)
|
||||
==============================================================================
|
||||
COMPILE TIME CHANGES *compile-changes-7*
|
||||
|
||||
Mac: "make" now creates the Vim.app directory and "make install" copies it to
|
||||
its final destination. (Raf)
|
||||
|
||||
Mac: Made it possible to compile with Motif, Athena or GTK without tricks and
|
||||
still being able to use the MacRoman conversion. Added the os_mac_conv.c
|
||||
file.
|
||||
|
||||
==============================================================================
|
||||
BUG FIXES *bug-fixes-7*
|
||||
@ -255,4 +264,7 @@ When 'comments' includes multi-byte characters inserting the middle part and
|
||||
alignment may go wrong. 'cindent' also suffers from this for right-aligned
|
||||
items.
|
||||
|
||||
The default for 'helplang' was "zh" for both "zh_cn" and "zh_tw". Now use
|
||||
"cn" or "tw" as intended.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
30
src/Makefile
30
src/Makefile
@ -1196,7 +1196,9 @@ CARBONGUI_LIBS2 =
|
||||
CARBONGUI_INSTALL = install_macosx
|
||||
CARBONGUI_TARGETS =
|
||||
CARBONGUI_MAN_TARGETS =
|
||||
CARBONGUI_TESTTARGET =
|
||||
CARBONGUI_TESTTARGET = gui
|
||||
CARBONGUI_BUNDLE = $(VIMNAME).app
|
||||
CARBONGUI_TESTARG = VIMPROG=../$(CARBONGUI_BUNDLE)/Contents/MacOS/$(VIMTARGET)
|
||||
|
||||
# All GUI files
|
||||
ALL_GUI_SRC = gui.c gui_gtk.c gui_gtk_f.c gui_motif.c gui_athena.c gui_gtk_x11.c gui_x11.c gui_at_sb.c gui_at_fs.c pty.c gui_kde.cc gui_kde_widget.cc gui_kde_x11.cc gui_kde_widget_moc.cc
|
||||
@ -1465,7 +1467,7 @@ PRO_MANUAL = os_amiga.pro os_msdos.pro os_win16.pro os_win32.pro \
|
||||
os_mswin.pro os_beos.pro os_vms.pro os_riscos.pro $(PERL_PRO)
|
||||
|
||||
# Default target is making the executable and tools
|
||||
all: $(VIMTARGET) $(TOOLS) languages
|
||||
all: $(VIMTARGET) $(TOOLS) languages $(GUI_BUNDLE)
|
||||
|
||||
tools: $(TOOLS)
|
||||
|
||||
@ -1641,7 +1643,7 @@ types.vim: $(TAGS_SRC) $(TAGS_INCL)
|
||||
#
|
||||
test check:
|
||||
$(MAKE) -f Makefile $(VIMTARGET)
|
||||
cd testdir; $(MAKE) -f Makefile $(GUI_TESTTARGET) VIMPROG=../$(VIMTARGET)
|
||||
cd testdir; $(MAKE) -f Makefile $(GUI_TESTTARGET) VIMPROG=../$(VIMTARGET) $(GUI_TESTARG)
|
||||
|
||||
testclean:
|
||||
cd testdir; $(MAKE) -f Makefile clean
|
||||
@ -2035,6 +2037,7 @@ clean celan: testclean
|
||||
-rm -f *.o objects/* core $(VIMTARGET).core $(VIMTARGET) xxd/*.o
|
||||
-rm -f $(TOOLS) auto/osdef.h auto/pathdef.c auto/if_perl.c
|
||||
-rm -f conftest* *~ auto/link.sed
|
||||
-rm -rf $(GUI_BUNDLE)
|
||||
-rm -f gui_kde_widget_moc.cc kvim_iface_skel.cc *.kidl
|
||||
if test -d $(PODIR); then \
|
||||
cd $(PODIR); $(MAKE) prefix=$(DESTDIR)$(prefix) clean; \
|
||||
@ -2327,6 +2330,9 @@ objects/os_qnx.o: os_qnx.c
|
||||
objects/os_macosx.o: os_macosx.c
|
||||
$(CCC) -o $@ os_macosx.c
|
||||
|
||||
objects/os_mac_conv.o: os_mac_conv.c
|
||||
$(CCC) -o $@ os_mac_conv.c
|
||||
|
||||
objects/os_unix.o: os_unix.c
|
||||
$(CCC) -o $@ os_unix.c
|
||||
|
||||
@ -2410,13 +2416,11 @@ Makefile:
|
||||
###############################################################################
|
||||
### MacOS X installation
|
||||
###
|
||||
### This creates a runnable Vim.app in the src directory
|
||||
### This installs a runnable Vim.app in $(prefix)
|
||||
|
||||
REZ = /Developer/Tools/Rez
|
||||
APPDIR = $(VIMNAME).app
|
||||
APPDIR = $(GUI_BUNDLE)
|
||||
RESDIR = $(APPDIR)/Contents/Resources
|
||||
# FIXME: i'm sure someone else can do something clever with grep
|
||||
# sed and version.h here
|
||||
VERSION = $(VIMMAJOR).$(VIMMINOR)
|
||||
|
||||
### Common flags
|
||||
@ -2434,7 +2438,10 @@ ICONS = $(RESDIR)/$(ICON_APP)
|
||||
#ICON_DOCTXT = $(shell if [ -e doc-txt.icns ] ; then echo doc-txt.icns ; else echo ; fi)
|
||||
#ICONS = $(addprefix $(RESDIR)/, $(ICON_APP) $(ICON_DOC) $(ICON_DOCTXT))
|
||||
|
||||
install_macosx: bundle-dir bundle-executable bundle-info bundle-resource \
|
||||
install_macosx: $(APPDIR)
|
||||
$(INSTALL_DATA_R) $(APPDIR) $(DESTDIR)$(prefix)
|
||||
|
||||
$(APPDIR): bundle-dir bundle-executable bundle-info bundle-resource \
|
||||
bundle-language
|
||||
|
||||
bundle-dir: $(APPDIR)/Contents $(VIMTARGET)
|
||||
@ -2473,11 +2480,8 @@ bundle-rsrc: os_mac.rsr.hqx
|
||||
bundle-language: bundle-dir
|
||||
|
||||
$(APPDIR)/Contents:
|
||||
mkdir $(APPDIR)
|
||||
mkdir $(APPDIR)/Contents
|
||||
mkdir $(APPDIR)/Contents/MacOS
|
||||
mkdir $(RESDIR)
|
||||
mkdir $(RESDIR)/English.lproj
|
||||
-$(SHELL) ./mkinstalldirs $(APPDIR)/Contents/MacOS
|
||||
-$(SHELL) ./mkinstalldirs $(RESDIR)/English.lproj
|
||||
|
||||
$(RESDIR)/%.icns: %.icns
|
||||
cp $< $@
|
||||
|
8
src/auto/configure
vendored
8
src/auto/configure
vendored
@ -1239,11 +1239,11 @@ echo "configure:1230: checking if Darwin files are there" >&5
|
||||
|
||||
if test "$enable_darwin" = "yes"; then
|
||||
MACOSX=yes
|
||||
OS_EXTRA_SCR="os_macosx.c";
|
||||
OS_EXTRA_OBJ="objects/os_macosx.o"
|
||||
OS_EXTRA_SCR="os_macosx.c os_mac_conv.c";
|
||||
OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o"
|
||||
CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp"
|
||||
|
||||
ac_safe=`echo "Carbon/Carbon.h" | sed 'y%./+-%__p_%'`
|
||||
ac_safe=`echo "Carbon/Carbon.h" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for Carbon/Carbon.h""... $ac_c" 1>&6
|
||||
echo "configure:1249: checking for Carbon/Carbon.h" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
@ -1277,7 +1277,7 @@ else
|
||||
fi
|
||||
|
||||
if test "x$CARBON" = "xyes"; then
|
||||
if test -z "$with_x"; then
|
||||
if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk -a "X$enable_gui" != Xgtk2; then
|
||||
with_x=no
|
||||
DEFAULT_VIMNAME=Vim
|
||||
fi
|
||||
|
@ -126,6 +126,8 @@ GUI_INSTALL = $(@GUITYPE@_INSTALL)
|
||||
GUI_TARGETS = $(@GUITYPE@_TARGETS)
|
||||
GUI_MAN_TARGETS = $(@GUITYPE@_MAN_TARGETS)
|
||||
GUI_TESTTARGET = $(@GUITYPE@_TESTTARGET)
|
||||
GUI_TESTARG = $(@GUITYPE@_TESTARG)
|
||||
GUI_BUNDLE = $(@GUITYPE@_BUNDLE)
|
||||
NARROW_PROTO = @NARROW_PROTO@
|
||||
GUI_X_LIBS = @GUI_X_LIBS@
|
||||
MOTIF_LIBNAME = @MOTIF_LIBNAME@
|
||||
|
@ -103,15 +103,16 @@ if test "`(uname) 2>/dev/null`" = Darwin; then
|
||||
|
||||
if test "$enable_darwin" = "yes"; then
|
||||
MACOSX=yes
|
||||
OS_EXTRA_SCR="os_macosx.c";
|
||||
OS_EXTRA_OBJ="objects/os_macosx.o"
|
||||
OS_EXTRA_SCR="os_macosx.c os_mac_conv.c";
|
||||
OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o"
|
||||
CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp"
|
||||
|
||||
dnl If Carbon is found, assume we don't want X11
|
||||
dnl unless it was specifically asked for (--with-x)
|
||||
dnl or Motif, Athena or GTK GUI is used.
|
||||
AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes)
|
||||
if test "x$CARBON" = "xyes"; then
|
||||
if test -z "$with_x"; then
|
||||
if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk -a "X$enable_gui" != Xgtk2; then
|
||||
with_x=no
|
||||
DEFAULT_VIMNAME=Vim
|
||||
fi
|
||||
|
79
src/eval.c
79
src/eval.c
@ -263,6 +263,7 @@ static void f_bufname __ARGS((VAR argvars, VAR retvar));
|
||||
static void f_bufnr __ARGS((VAR argvars, VAR retvar));
|
||||
static void f_bufwinnr __ARGS((VAR argvars, VAR retvar));
|
||||
static void f_byte2line __ARGS((VAR argvars, VAR retvar));
|
||||
static void f_byteidx __ARGS((VAR argvars, VAR retvar));
|
||||
static void f_char2nr __ARGS((VAR argvars, VAR retvar));
|
||||
static void f_cindent __ARGS((VAR argvars, VAR retvar));
|
||||
static void f_col __ARGS((VAR argvars, VAR retvar));
|
||||
@ -349,6 +350,7 @@ static void f_remote_foreground __ARGS((VAR argvars, VAR retvar));
|
||||
static void f_remote_peek __ARGS((VAR argvars, VAR retvar));
|
||||
static void f_remote_read __ARGS((VAR argvars, VAR retvar));
|
||||
static void f_remote_send __ARGS((VAR argvars, VAR retvar));
|
||||
static void f_repeat __ARGS((VAR argvars, VAR retvar));
|
||||
static void f_server2client __ARGS((VAR argvars, VAR retvar));
|
||||
static void f_serverlist __ARGS((VAR argvars, VAR retvar));
|
||||
static void f_setline __ARGS((VAR argvars, VAR retvar));
|
||||
@ -2817,6 +2819,7 @@ static struct fst
|
||||
{"bufnr", 1, 1, f_bufnr},
|
||||
{"bufwinnr", 1, 1, f_bufwinnr},
|
||||
{"byte2line", 1, 1, f_byte2line},
|
||||
{"byteidx", 2, 2, f_byteidx},
|
||||
{"char2nr", 1, 1, f_char2nr},
|
||||
{"cindent", 1, 1, f_cindent},
|
||||
{"col", 1, 1, f_col},
|
||||
@ -2896,6 +2899,7 @@ static struct fst
|
||||
{"remote_read", 1, 1, f_remote_read},
|
||||
{"remote_send", 2, 3, f_remote_send},
|
||||
{"rename", 2, 2, f_rename},
|
||||
{"repeat", 2, 2, f_repeat},
|
||||
{"resolve", 1, 1, f_resolve},
|
||||
{"search", 1, 2, f_search},
|
||||
{"searchpair", 3, 5, f_searchpair},
|
||||
@ -3587,6 +3591,42 @@ f_byte2line(argvars, retvar)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* "byteidx()" function
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
f_byteidx(argvars, retvar)
|
||||
VAR argvars;
|
||||
VAR retvar;
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
char_u *t;
|
||||
#endif
|
||||
char_u *str;
|
||||
long idx;
|
||||
|
||||
str = get_var_string(&argvars[0]);
|
||||
idx = get_var_number(&argvars[1]);
|
||||
retvar->var_val.var_number = -1;
|
||||
if (idx < 0)
|
||||
return;
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
t = str;
|
||||
for ( ; idx > 0; idx--)
|
||||
{
|
||||
if (*t == NUL) /* EOL reached */
|
||||
return;
|
||||
t += mb_ptr2len_check(t);
|
||||
}
|
||||
retvar->var_val.var_number = t - str;
|
||||
#else
|
||||
if (idx <= STRLEN(str))
|
||||
retvar->var_val.var_number = idx;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* "char2nr(string)" function
|
||||
*/
|
||||
@ -6920,6 +6960,45 @@ f_remote_foreground(argvars, retvar)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* "repeat()" function
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
f_repeat(argvars, retvar)
|
||||
VAR argvars;
|
||||
VAR retvar;
|
||||
{
|
||||
char_u *p;
|
||||
int n;
|
||||
int slen;
|
||||
int len;
|
||||
char_u *r;
|
||||
int i;
|
||||
|
||||
p = get_var_string(&argvars[0]);
|
||||
n = get_var_number(&argvars[1]);
|
||||
|
||||
retvar->var_type = VAR_STRING;
|
||||
retvar->var_val.var_string = NULL;
|
||||
|
||||
slen = (int)STRLEN(p);
|
||||
len = slen * n;
|
||||
|
||||
if (len <= 0)
|
||||
return;
|
||||
|
||||
r = alloc(len + 1);
|
||||
if (r != NULL)
|
||||
{
|
||||
for (i = 0; i < n; i++)
|
||||
mch_memmove(r + i * slen, p, (size_t)slen);
|
||||
r[len] = NUL;
|
||||
}
|
||||
|
||||
retvar->var_val.var_string = r;
|
||||
}
|
||||
|
||||
#ifdef HAVE_STRFTIME
|
||||
/*
|
||||
* "strftime({format}[, {time}])" function
|
||||
|
78
src/fileio.c
78
src/fileio.c
@ -1498,40 +1498,14 @@ retry:
|
||||
# ifdef MACOS_X
|
||||
if (fio_flags & FIO_MACROMAN)
|
||||
{
|
||||
extern int macroman2enc __ARGS((char_u *ptr, long *sizep, long
|
||||
real_size));
|
||||
/*
|
||||
* Conversion from Apple MacRoman char encoding to UTF-8 or
|
||||
* latin1, using standard Carbon framework.
|
||||
* latin1. This is in os_mac_conv.c.
|
||||
*/
|
||||
CFStringRef cfstr;
|
||||
CFRange r;
|
||||
CFIndex len = size;
|
||||
|
||||
/* MacRoman is an 8-bit encoding, no need to move bytes to
|
||||
* conv_rest[]. */
|
||||
cfstr = CFStringCreateWithBytes(NULL, ptr, len,
|
||||
kCFStringEncodingMacRoman, 0);
|
||||
/*
|
||||
* If there is a conversion error, try using another
|
||||
* conversion.
|
||||
*/
|
||||
if (cfstr == NULL)
|
||||
if (macroman2enc(ptr, &size, real_size) == FAIL)
|
||||
goto rewind_retry;
|
||||
|
||||
r.location = 0;
|
||||
r.length = CFStringGetLength(cfstr);
|
||||
if (r.length != CFStringGetBytes(cfstr, r,
|
||||
(enc_utf8) ? kCFStringEncodingUTF8
|
||||
: kCFStringEncodingISOLatin1,
|
||||
0, /* no lossy conversion */
|
||||
0, /* not external representation */
|
||||
ptr + size, real_size - size, &len))
|
||||
{
|
||||
CFRelease(cfstr);
|
||||
goto rewind_retry;
|
||||
}
|
||||
CFRelease(cfstr);
|
||||
mch_memmove(ptr, ptr + size, len);
|
||||
size = len;
|
||||
}
|
||||
else
|
||||
# endif
|
||||
@ -2744,7 +2718,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
|
||||
if (!(did_cmd = apply_autocmds_exarg(EVENT_FILEAPPENDCMD,
|
||||
sfname, sfname, FALSE, curbuf, eap)))
|
||||
{
|
||||
if (bt_nofile(curbuf))
|
||||
if (overwriting && bt_nofile(curbuf))
|
||||
nofile_err = TRUE;
|
||||
else
|
||||
apply_autocmds_exarg(EVENT_FILEAPPENDPRE,
|
||||
@ -4789,11 +4763,11 @@ buf_write_bytes(ip)
|
||||
/*
|
||||
* Convert UTF-8 or latin1 to Apple MacRoman.
|
||||
*/
|
||||
CFStringRef cfstr;
|
||||
CFRange r;
|
||||
CFIndex l;
|
||||
char_u *from;
|
||||
size_t fromlen;
|
||||
extern int enc2macroman __ARGS((char_u *from, size_t fromlen,
|
||||
char_u *to, int *tolenp, int maxtolen, char_u *rest,
|
||||
int *restlenp));
|
||||
|
||||
if (ip->bw_restlen > 0)
|
||||
{
|
||||
@ -4811,41 +4785,14 @@ buf_write_bytes(ip)
|
||||
fromlen = len;
|
||||
}
|
||||
|
||||
ip->bw_restlen = 0;
|
||||
cfstr = CFStringCreateWithBytes(NULL, from, fromlen,
|
||||
(enc_utf8) ?
|
||||
kCFStringEncodingUTF8 : kCFStringEncodingISOLatin1,
|
||||
0);
|
||||
while (cfstr == NULL && ip->bw_restlen < 3 && fromlen > 1)
|
||||
{
|
||||
ip->bw_rest[ip->bw_restlen++] = from[--fromlen];
|
||||
cfstr = CFStringCreateWithBytes(NULL, from, fromlen,
|
||||
(enc_utf8) ?
|
||||
kCFStringEncodingUTF8 : kCFStringEncodingISOLatin1,
|
||||
0);
|
||||
}
|
||||
if (cfstr == NULL)
|
||||
if (enc2macroman(from, fromlen,
|
||||
ip->bw_conv_buf, &len, ip->bw_conv_buflen,
|
||||
ip->bw_rest, &ip->bw_restlen) == FAIL)
|
||||
{
|
||||
ip->bw_conv_error = TRUE;
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
r.location = 0;
|
||||
r.length = CFStringGetLength(cfstr);
|
||||
if (r.length != CFStringGetBytes(cfstr, r,
|
||||
kCFStringEncodingMacRoman,
|
||||
0, /* no lossy conversion */
|
||||
0, /* not external representation (since vim
|
||||
* handles this internally */
|
||||
ip->bw_conv_buf, ip->bw_conv_buflen, &l))
|
||||
{
|
||||
CFRelease(cfstr);
|
||||
ip->bw_conv_error = TRUE;
|
||||
return FAIL;
|
||||
}
|
||||
CFRelease(cfstr);
|
||||
buf = ip->bw_conv_buf;
|
||||
len = l;
|
||||
}
|
||||
# endif
|
||||
|
||||
@ -6696,7 +6643,8 @@ static AutoPat *first_autopat[NUM_EVENTS] =
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
/*
|
||||
|
111
src/mbyte.c
111
src/mbyte.c
@ -5553,99 +5553,8 @@ convert_input_safe(ptr, len, maxlen, restp, restlenp)
|
||||
}
|
||||
|
||||
#if defined(MACOS_X)
|
||||
static char_u *mac_string_convert __ARGS((char_u *ptr, int len, int *lenp, int fail_on_error, CFStringEncoding from, CFStringEncoding to, int *unconvlenp));
|
||||
|
||||
/*
|
||||
* A Mac version of string_convert_ext() for special cases.
|
||||
*/
|
||||
static char_u *
|
||||
mac_string_convert(ptr, len, lenp, fail_on_error, from, to, unconvlenp)
|
||||
char_u *ptr;
|
||||
int len;
|
||||
int *lenp;
|
||||
int fail_on_error;
|
||||
CFStringEncoding from;
|
||||
CFStringEncoding to;
|
||||
int *unconvlenp;
|
||||
{
|
||||
char_u *retval, *d;
|
||||
CFStringRef cfstr;
|
||||
int buflen, in, out, l, i;
|
||||
|
||||
if (unconvlenp != NULL)
|
||||
*unconvlenp = 0;
|
||||
cfstr = CFStringCreateWithBytes(NULL, ptr, len, from, 0);
|
||||
/* When conversion failed, try excluding bytes from the end, helps when
|
||||
* there is an incomplete byte sequence. Only do up to 6 bytes to avoid
|
||||
* looping a long time when there really is something unconvertable. */
|
||||
while (cfstr == NULL && unconvlenp != NULL && len > 1 && *unconvlenp < 6)
|
||||
{
|
||||
--len;
|
||||
++*unconvlenp;
|
||||
cfstr = CFStringCreateWithBytes(NULL, ptr, len, from, 0);
|
||||
}
|
||||
if (cfstr == NULL)
|
||||
return NULL;
|
||||
if (to == kCFStringEncodingUTF8)
|
||||
buflen = len * 6 + 1;
|
||||
else
|
||||
buflen = len + 1;
|
||||
retval = alloc(buflen);
|
||||
if (retval == NULL)
|
||||
{
|
||||
CFRelease(cfstr);
|
||||
return NULL;
|
||||
}
|
||||
if (!CFStringGetCString(cfstr, retval, buflen, to))
|
||||
{
|
||||
CFRelease(cfstr);
|
||||
if (fail_on_error)
|
||||
{
|
||||
vim_free(retval);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* conversion failed for the whole string, but maybe it will work
|
||||
* for each character */
|
||||
for (d = retval, in = 0, out = 0; in < len && out < buflen - 1;)
|
||||
{
|
||||
if (from == kCFStringEncodingUTF8)
|
||||
l = utf_ptr2len_check(ptr + in);
|
||||
else
|
||||
l = 1;
|
||||
cfstr = CFStringCreateWithBytes(NULL, ptr + in, l, from, 0);
|
||||
if (cfstr == NULL)
|
||||
{
|
||||
*d++ = '?';
|
||||
out++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!CFStringGetCString(cfstr, d, buflen - out, to))
|
||||
{
|
||||
*d++ = '?';
|
||||
out++;
|
||||
}
|
||||
else
|
||||
{
|
||||
i = strlen(d);
|
||||
d += i;
|
||||
out += i;
|
||||
}
|
||||
CFRelease(cfstr);
|
||||
}
|
||||
in += l;
|
||||
}
|
||||
*d = NUL;
|
||||
if (lenp != NULL)
|
||||
*lenp = out;
|
||||
return retval;
|
||||
}
|
||||
CFRelease(cfstr);
|
||||
if (lenp != NULL)
|
||||
*lenp = strlen(retval);
|
||||
return retval;
|
||||
}
|
||||
/* This is in os_mac_conv.c. */
|
||||
extern char_u *mac_string_convert __ARGS((char_u *ptr, int len, int *lenp, int fail_on_error, int from, int to, int *unconvlenp));
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -5762,30 +5671,22 @@ string_convert_ext(vcp, ptr, lenp, unconvlenp)
|
||||
# ifdef MACOS_X
|
||||
case CONV_MAC_LATIN1:
|
||||
retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
|
||||
kCFStringEncodingMacRoman,
|
||||
kCFStringEncodingISOLatin1,
|
||||
unconvlenp);
|
||||
'm', 'l', unconvlenp);
|
||||
break;
|
||||
|
||||
case CONV_LATIN1_MAC:
|
||||
retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
|
||||
kCFStringEncodingISOLatin1,
|
||||
kCFStringEncodingMacRoman,
|
||||
unconvlenp);
|
||||
'l', 'm', unconvlenp);
|
||||
break;
|
||||
|
||||
case CONV_MAC_UTF8:
|
||||
retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
|
||||
kCFStringEncodingMacRoman,
|
||||
kCFStringEncodingUTF8,
|
||||
unconvlenp);
|
||||
'm', 'u', unconvlenp);
|
||||
break;
|
||||
|
||||
case CONV_UTF8_MAC:
|
||||
retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
|
||||
kCFStringEncodingUTF8,
|
||||
kCFStringEncodingMacRoman,
|
||||
unconvlenp);
|
||||
'u', 'm', unconvlenp);
|
||||
break;
|
||||
# endif
|
||||
|
||||
|
@ -1 +1 @@
|
||||
=auto/configure-lastupdate=1089626426.19-@buildcheck=2c92a9e4676b2304fab9af16f1664194=configure.in@md5=021fe2d41058c80f220721c96886b73b
|
||||
=auto/configure-lastupdate=1090067895.52-@buildcheck=2c92a9e4676b2304fab9af16f1664194=configure.in@md5=9058353ef67f4d224686695cb80f645e
|
||||
|
@ -3237,7 +3237,15 @@ set_helplang_default(lang)
|
||||
if (p_hlg == NULL)
|
||||
p_hlg = empty_option;
|
||||
else
|
||||
{
|
||||
/* zh_CN becomes "cn", zh_TW becomes "tw". */
|
||||
if (STRNICMP(p_hlg, "zh_", 3) == 0 && STRLEN(p_hlg) >= 5)
|
||||
{
|
||||
p_hlg[0] = TOLOWER_ASC(p_hlg[3]);
|
||||
p_hlg[1] = TOLOWER_ASC(p_hlg[4]);
|
||||
}
|
||||
p_hlg[2] = NUL;
|
||||
}
|
||||
options[idx].flags |= P_ALLOCED;
|
||||
}
|
||||
}
|
||||
|
38
src/os_mac.h
38
src/os_mac.h
@ -18,18 +18,23 @@
|
||||
|
||||
/*
|
||||
* Macintosh machine-dependent things.
|
||||
*
|
||||
* Include the Mac header files, unless also compiling with X11 (the header
|
||||
* files have many conflicts).
|
||||
*/
|
||||
#include <QuickDraw.h>
|
||||
#include <ToolUtils.h>
|
||||
#include <LowMem.h>
|
||||
#include <Scrap.h>
|
||||
#include <Sound.h>
|
||||
#include <TextUtils.h>
|
||||
#include <Memory.h>
|
||||
#include <OSUtils.h>
|
||||
#include <Files.h>
|
||||
#ifdef FEAT_MBYTE
|
||||
# include <Script.h>
|
||||
#ifndef FEAT_X11
|
||||
# include <QuickDraw.h>
|
||||
# include <ToolUtils.h>
|
||||
# include <LowMem.h>
|
||||
# include <Scrap.h>
|
||||
# include <Sound.h>
|
||||
# include <TextUtils.h>
|
||||
# include <Memory.h>
|
||||
# include <OSUtils.h>
|
||||
# include <Files.h>
|
||||
# ifdef FEAT_MBYTE
|
||||
# include <Script.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -303,10 +308,13 @@
|
||||
#endif
|
||||
|
||||
#define DFLT_ERRORFILE "errors.err"
|
||||
#ifdef COLON_AS_PATHSEP
|
||||
# define DFLT_RUNTIMEPATH "$VIM:vimfiles,$VIMRUNTIME,$VIM:vimfiles:after"
|
||||
#else
|
||||
# define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after"
|
||||
|
||||
#ifndef DFLT_RUNTIMEPATH
|
||||
# ifdef COLON_AS_PATHSEP
|
||||
# define DFLT_RUNTIMEPATH "$VIM:vimfiles,$VIMRUNTIME,$VIM:vimfiles:after"
|
||||
# else
|
||||
# define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
1537
src/os_mac.pbproj/project.pbxproj
Normal file
1537
src/os_mac.pbproj/project.pbxproj
Normal file
File diff suppressed because it is too large
Load Diff
230
src/os_mac_conv.c
Normal file
230
src/os_mac_conv.c
Normal file
@ -0,0 +1,230 @@
|
||||
/* vi:set ts=8 sts=4 sw=4:
|
||||
*
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
*
|
||||
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
/*
|
||||
* os_mac_conv.c: Code specifically for Mac string conversions.
|
||||
*
|
||||
* This code has been put in a separate file to avoid the conflicts that are
|
||||
* caused by including both the X11 and Carbon header files.
|
||||
*/
|
||||
|
||||
#define NO_X11_INCLUDES
|
||||
#include "vim.h"
|
||||
|
||||
extern char_u *mac_string_convert __ARGS((char_u *ptr, int len, int *lenp, int fail_on_error, int from, int to, int *unconvlenp));
|
||||
extern int macroman2enc __ARGS((char_u *ptr, long *sizep, long real_size));
|
||||
extern int enc2macroman __ARGS((char_u *from, size_t fromlen, char_u *to, int *tolenp, int maxtolen, char_u *rest, int *restlenp));
|
||||
|
||||
/*
|
||||
* A Mac version of string_convert_ext() for special cases.
|
||||
*/
|
||||
char_u *
|
||||
mac_string_convert(ptr, len, lenp, fail_on_error, from_enc, to_enc, unconvlenp)
|
||||
char_u *ptr;
|
||||
int len;
|
||||
int *lenp;
|
||||
int fail_on_error;
|
||||
int from_enc;
|
||||
int to_enc;
|
||||
int *unconvlenp;
|
||||
{
|
||||
char_u *retval, *d;
|
||||
CFStringRef cfstr;
|
||||
int buflen, in, out, l, i;
|
||||
CFStringEncoding from;
|
||||
CFStringEncoding to;
|
||||
|
||||
switch (from_enc)
|
||||
{
|
||||
case 'l': from = kCFStringEncodingISOLatin1; break;
|
||||
case 'm': from = kCFStringEncodingMacRoman; break;
|
||||
case 'u': from = kCFStringEncodingUTF8; break;
|
||||
default: return NULL;
|
||||
}
|
||||
switch (to_enc)
|
||||
{
|
||||
case 'l': to = kCFStringEncodingISOLatin1; break;
|
||||
case 'm': to = kCFStringEncodingMacRoman; break;
|
||||
case 'u': to = kCFStringEncodingUTF8; break;
|
||||
default: return NULL;
|
||||
}
|
||||
|
||||
if (unconvlenp != NULL)
|
||||
*unconvlenp = 0;
|
||||
cfstr = CFStringCreateWithBytes(NULL, ptr, len, from, 0);
|
||||
|
||||
/* When conversion failed, try excluding bytes from the end, helps when
|
||||
* there is an incomplete byte sequence. Only do up to 6 bytes to avoid
|
||||
* looping a long time when there really is something unconvertable. */
|
||||
while (cfstr == NULL && unconvlenp != NULL && len > 1 && *unconvlenp < 6)
|
||||
{
|
||||
--len;
|
||||
++*unconvlenp;
|
||||
cfstr = CFStringCreateWithBytes(NULL, ptr, len, from, 0);
|
||||
}
|
||||
if (cfstr == NULL)
|
||||
return NULL;
|
||||
if (to == kCFStringEncodingUTF8)
|
||||
buflen = len * 6 + 1;
|
||||
else
|
||||
buflen = len + 1;
|
||||
retval = alloc(buflen);
|
||||
if (retval == NULL)
|
||||
{
|
||||
CFRelease(cfstr);
|
||||
return NULL;
|
||||
}
|
||||
if (!CFStringGetCString(cfstr, retval, buflen, to))
|
||||
{
|
||||
CFRelease(cfstr);
|
||||
if (fail_on_error)
|
||||
{
|
||||
vim_free(retval);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* conversion failed for the whole string, but maybe it will work
|
||||
* for each character */
|
||||
for (d = retval, in = 0, out = 0; in < len && out < buflen - 1;)
|
||||
{
|
||||
if (from == kCFStringEncodingUTF8)
|
||||
l = utf_ptr2len_check(ptr + in);
|
||||
else
|
||||
l = 1;
|
||||
cfstr = CFStringCreateWithBytes(NULL, ptr + in, l, from, 0);
|
||||
if (cfstr == NULL)
|
||||
{
|
||||
*d++ = '?';
|
||||
out++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!CFStringGetCString(cfstr, d, buflen - out, to))
|
||||
{
|
||||
*d++ = '?';
|
||||
out++;
|
||||
}
|
||||
else
|
||||
{
|
||||
i = strlen(d);
|
||||
d += i;
|
||||
out += i;
|
||||
}
|
||||
CFRelease(cfstr);
|
||||
}
|
||||
in += l;
|
||||
}
|
||||
*d = NUL;
|
||||
if (lenp != NULL)
|
||||
*lenp = out;
|
||||
return retval;
|
||||
}
|
||||
CFRelease(cfstr);
|
||||
if (lenp != NULL)
|
||||
*lenp = strlen(retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Conversion from Apple MacRoman char encoding to UTF-8 or latin1, using
|
||||
* standard Carbon framework.
|
||||
* Input: "ptr[*sizep]".
|
||||
* "real_size" is the size of the buffer that "ptr" points to.
|
||||
* output is in-place, "sizep" is adjusted.
|
||||
* Returns OK or FAIL.
|
||||
*/
|
||||
int
|
||||
macroman2enc(ptr, sizep, real_size)
|
||||
char_u *ptr;
|
||||
long *sizep;
|
||||
long real_size;
|
||||
{
|
||||
CFStringRef cfstr;
|
||||
CFRange r;
|
||||
CFIndex len = *sizep;
|
||||
|
||||
/* MacRoman is an 8-bit encoding, no need to move bytes to
|
||||
* conv_rest[]. */
|
||||
cfstr = CFStringCreateWithBytes(NULL, ptr, len,
|
||||
kCFStringEncodingMacRoman, 0);
|
||||
/*
|
||||
* If there is a conversion error, try using another
|
||||
* conversion.
|
||||
*/
|
||||
if (cfstr == NULL)
|
||||
return FAIL;
|
||||
|
||||
r.location = 0;
|
||||
r.length = CFStringGetLength(cfstr);
|
||||
if (r.length != CFStringGetBytes(cfstr, r,
|
||||
(enc_utf8) ? kCFStringEncodingUTF8 : kCFStringEncodingISOLatin1,
|
||||
0, /* no lossy conversion */
|
||||
0, /* not external representation */
|
||||
ptr + *sizep, real_size - *sizep, &len))
|
||||
{
|
||||
CFRelease(cfstr);
|
||||
return FAIL;
|
||||
}
|
||||
CFRelease(cfstr);
|
||||
mch_memmove(ptr, ptr + *sizep, len);
|
||||
*sizep = len;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Conversion from UTF-8 or latin1 to MacRoman.
|
||||
* Input: "from[fromlen]"
|
||||
* Output: "to[maxtolen]" length in "*tolenp"
|
||||
* Unconverted rest in rest[*restlenp].
|
||||
* Returns OK or FAIL.
|
||||
*/
|
||||
int
|
||||
enc2macroman(from, fromlen, to, tolenp, maxtolen, rest, restlenp)
|
||||
char_u *from;
|
||||
size_t fromlen;
|
||||
char_u *to;
|
||||
int *tolenp;
|
||||
int maxtolen;
|
||||
char_u *rest;
|
||||
int *restlenp;
|
||||
{
|
||||
CFStringRef cfstr;
|
||||
CFRange r;
|
||||
CFIndex l;
|
||||
|
||||
*restlenp = 0;
|
||||
cfstr = CFStringCreateWithBytes(NULL, from, fromlen,
|
||||
(enc_utf8) ? kCFStringEncodingUTF8 : kCFStringEncodingISOLatin1,
|
||||
0);
|
||||
while (cfstr == NULL && *restlenp < 3 && fromlen > 1)
|
||||
{
|
||||
rest[*restlenp++] = from[--fromlen];
|
||||
cfstr = CFStringCreateWithBytes(NULL, from, fromlen,
|
||||
(enc_utf8) ? kCFStringEncodingUTF8 : kCFStringEncodingISOLatin1,
|
||||
0);
|
||||
}
|
||||
if (cfstr == NULL)
|
||||
return FAIL;
|
||||
|
||||
r.location = 0;
|
||||
r.length = CFStringGetLength(cfstr);
|
||||
if (r.length != CFStringGetBytes(cfstr, r,
|
||||
kCFStringEncodingMacRoman,
|
||||
0, /* no lossy conversion */
|
||||
0, /* not external representation (since vim
|
||||
* handles this internally */
|
||||
to, maxtolen, &l))
|
||||
{
|
||||
CFRelease(cfstr);
|
||||
return FAIL;
|
||||
}
|
||||
CFRelease(cfstr);
|
||||
*tolenp = l;
|
||||
return OK;
|
||||
}
|
@ -338,8 +338,8 @@ ICONV_OPEN_ERR:
|
||||
* TECCreateConverter() failed.
|
||||
*/
|
||||
static size_t
|
||||
null_conv(iconv_t cd, const char** inbuf, size_t *inbytesleft,
|
||||
char** outbuf, size_t *outbytesleft)
|
||||
null_conv(iconv_t cd, const char **inbuf, size_t *inbytesleft,
|
||||
char **outbuf, size_t *outbytesleft)
|
||||
{
|
||||
const char* buf_in = inbuf && *inbuf ? *inbuf : NULL;
|
||||
char* buf_out = outbuf && *outbuf ? *outbuf : NULL;
|
||||
@ -375,14 +375,14 @@ null_conv(iconv_t cd, const char** inbuf, size_t *inbytesleft,
|
||||
}
|
||||
|
||||
size_t
|
||||
iconv(iconv_t cd, const char** inbuf, size_t *inbytesleft,
|
||||
char** outbuf, size_t *outbytesleft)
|
||||
iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft,
|
||||
char **outbuf, size_t *outbytesleft)
|
||||
{
|
||||
ConstTextPtr buf_in;
|
||||
TextPtr buf_out;
|
||||
ByteCount out_len, out_true;
|
||||
ByteCount in_len, in_true;
|
||||
OSStatus st;
|
||||
ConstTextPtr buf_in;
|
||||
TextPtr buf_out;
|
||||
ByteCount out_len, out_true;
|
||||
ByteCount in_len, in_true;
|
||||
OSStatus st;
|
||||
|
||||
if (!cd)
|
||||
{
|
||||
@ -537,7 +537,7 @@ iconv_close(iconv_t cd)
|
||||
}
|
||||
}
|
||||
|
||||
int*
|
||||
int *
|
||||
iconv_errno()
|
||||
{
|
||||
return &last_errno;
|
||||
@ -549,8 +549,8 @@ iconv_errno()
|
||||
#define GETTEXT_BUFNUM 64
|
||||
#define GETTEXT_BUFSIZE 256
|
||||
|
||||
char*
|
||||
mch_gettext(const char* msgid)
|
||||
char *
|
||||
mch_gettext(const char *msgid)
|
||||
{
|
||||
static char buf[GETTEXT_BUFNUM][GETTEXT_BUFSIZE];
|
||||
static int bufnum = 0;
|
||||
@ -593,18 +593,18 @@ MCH_GETTEXT_FINISH:
|
||||
CFRelease(strkey);
|
||||
if (strmsg)
|
||||
CFRelease(strmsg);
|
||||
return (char*)(msg ? msg : msgid);
|
||||
return (char *)(msg ? msg : msgid);
|
||||
}
|
||||
|
||||
char*
|
||||
mch_bindtextdomain(const char* domain, const char* dirname)
|
||||
char *
|
||||
mch_bindtextdomain(const char *domain, const char *dirname)
|
||||
{
|
||||
TRACE("mch_bindtextdomain(%s, %s)\n", domain, dirname);
|
||||
return (char*)dirname;
|
||||
}
|
||||
|
||||
char*
|
||||
mch_textdomain(const char* domain)
|
||||
char *
|
||||
mch_textdomain(const char *domain)
|
||||
{
|
||||
TRACE("mch_textdomain(%s)\n", domain);
|
||||
return (char*)domain;
|
||||
|
@ -20,13 +20,12 @@ STARTTEST
|
||||
:set bin
|
||||
:au FileWritePre *.gz '[,']!gzip
|
||||
:au FileWritePost *.gz undo
|
||||
:/start of testfile/,/end of testfile/w! Xtestfile.gz
|
||||
:/^start of testfile/,/^end of testfile/w! Xtestfile.gz
|
||||
:au FileReadPost *.gz '[,']!gzip -d
|
||||
:$r Xtestfile.gz " Read and decompress the testfile
|
||||
:?startstart?,$w! test.out " Write contents of this file
|
||||
:au BufNewFile *.c read Xtest.c
|
||||
gg/^end of testfile
|
||||
:/start of test.c/+1,/end of test.c/-1w! Xtest.c
|
||||
:/^start of test.c/+1,/^end of test.c/-1w! Xtest.c
|
||||
:e! foo.c " Will load Xtest.c
|
||||
:au FileAppendPre *.out '[,']s/new/NEW/
|
||||
:au FileAppendPost *.out !cat Xtest.c >>test.out
|
||||
|
31
src/vim.h
31
src/vim.h
@ -91,7 +91,7 @@
|
||||
|| defined(FEAT_GUI_AMIGA) \
|
||||
|| defined(FEAT_GUI_PHOTON) \
|
||||
|| defined(FEAT_GUI_KDE)
|
||||
# ifndef FEAT_GUI
|
||||
# if !defined(FEAT_GUI) && !defined(NO_X11_INCLUDES)
|
||||
# define FEAT_GUI
|
||||
# endif
|
||||
#endif
|
||||
@ -160,6 +160,35 @@
|
||||
# define FEAT_X11
|
||||
#endif
|
||||
|
||||
#ifdef NO_X11_INCLUDES
|
||||
/* In os_mac_conv.c NO_X11_INCLUDES is defined to avoid X11 headers.
|
||||
* Disable all X11 related things to avoid conflicts. */
|
||||
# ifdef FEAT_X11
|
||||
# undef FEAT_X11
|
||||
# endif
|
||||
# ifdef FEAT_XCLIPBOARD
|
||||
# undef FEAT_XCLIPBOARD
|
||||
# endif
|
||||
# ifdef FEAT_GUI_MOTIF
|
||||
# undef FEAT_GUI_MOTIF
|
||||
# endif
|
||||
# ifdef FEAT_GUI_ATHENA
|
||||
# undef FEAT_GUI_ATHENA
|
||||
# endif
|
||||
# ifdef FEAT_GUI_GTK
|
||||
# undef FEAT_GUI_GTK
|
||||
# endif
|
||||
# ifdef FEAT_BEVAL_TIP
|
||||
# undef FEAT_BEVAL_TIP
|
||||
# endif
|
||||
# ifdef FEAT_XIM
|
||||
# undef FEAT_XIM
|
||||
# endif
|
||||
# ifdef FEAT_CLIENTSERVER
|
||||
# undef FEAT_CLIENTSERVER
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Can't use "PACKAGE" here, conflicts with a Perl include file. */
|
||||
#ifndef VIMPACKAGE
|
||||
# define VIMPACKAGE "vim"
|
||||
|
Reference in New Issue
Block a user