diff options
-rw-r--r-- | runtime/doc/eval.txt | 52 | ||||
-rw-r--r-- | runtime/doc/options.txt | 19 | ||||
-rw-r--r-- | runtime/doc/tags | 1 | ||||
-rw-r--r-- | src/Makefile | 11 | ||||
-rwxr-xr-x | src/auto/configure | 142 | ||||
-rw-r--r-- | src/configure.in | 42 | ||||
-rw-r--r-- | src/edit.c | 37 | ||||
-rw-r--r-- | src/ex_getln.c | 22 | ||||
-rw-r--r-- | src/feature.h | 5 | ||||
-rw-r--r-- | src/globals.h | 4 | ||||
-rw-r--r-- | src/gui_mac.c | 3 | ||||
-rw-r--r-- | src/ops.c | 2 | ||||
-rw-r--r-- | src/option.c | 72 | ||||
-rw-r--r-- | src/option.h | 15 | ||||
-rw-r--r-- | src/proto/eval.pro | 2 | ||||
-rw-r--r-- | src/proto/gui.pro | 1 | ||||
-rw-r--r-- | src/proto/normal.pro | 1 | ||||
-rw-r--r-- | src/regexp.c | 12 | ||||
-rw-r--r-- | src/search.c | 30 | ||||
-rw-r--r-- | src/structs.h | 32 | ||||
-rw-r--r-- | src/tag.c | 178 | ||||
-rw-r--r-- | src/undo.c | 21 | ||||
-rw-r--r-- | src/version.h | 4 | ||||
-rw-r--r-- | src/workshop.c | 18 |
24 files changed, 536 insertions, 190 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index aa5f54f4bc..b6534e0e91 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.0aa. Last change: 2006 Feb 25 +*eval.txt* For Vim version 7.0aa. Last change: 2006 Feb 26 VIM REFERENCE MANUAL by Bram Moolenaar @@ -767,7 +767,7 @@ expr6 + expr6 .. Number addition or |List| concatenation *expr-+* expr6 - expr6 .. Number subtraction *expr--* expr6 . expr6 .. String concatenation *expr-.* -For |List|s only "+" is possible and then both expr6 must be a list. The +For |Lists| only "+" is possible and then both expr6 must be a list. The result is a new list with the two lists Concatenated. expr7 * expr7 .. number multiplication *expr-star* @@ -1651,11 +1651,11 @@ reverse( {list}) List reverse {list} in-place search( {pattern} [, {flags}]) Number search for {pattern} searchdecl({name} [, {global} [, {thisblock}]]) Number search for variable declaration -searchpair( {start}, {middle}, {end} [, {flags} [, {skip}]]) +searchpair( {start}, {middle}, {end} [, {flags} [, {skip} [, {stopline}]]]) Number search for other end of start/end pair -searchpairpos( {start}, {middle}, {end} [, {flags} [, {skip}]]) +searchpairpos( {start}, {middle}, {end} [, {flags} [, {skip} [, {stopline}]]]) List search for other end of start/end pair -searchpos( {pattern} [, {flags}]) +searchpos( {pattern} [, {flags} [, {stopline}]]) List search for {pattern} server2client( {clientid}, {string}) Number send reply string @@ -1725,7 +1725,7 @@ add({list}, {expr}) *add()* :let alist = add([1, 2, 3], item) :call add(mylist, "woodstock") < Note that when {expr} is a |List| it is appended as a single - item. Use |extend()| to concatenate |List|s. + item. Use |extend()| to concatenate |Lists|. Use |insert()| to add an item at another position. @@ -2016,7 +2016,7 @@ copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't When {expr} is a |List| a shallow copy is created. This means that the original |List| can be changed without changing the copy, and vise versa. But the items are identical, thus - changing an item changes the contents of both |List|s. Also + changing an item changes the contents of both |Lists|. Also see |deepcopy()|. count({comp}, {expr} [, {ic} [, {start}]]) *count()* @@ -2327,9 +2327,10 @@ expand({expr} [, {flag}]) *expand()* getting the raw output of an external command. extend({expr1}, {expr2} [, {expr3}]) *extend()* - {expr1} and {expr2} must be both |List|s or both Dictionaries. + {expr1} and {expr2} must be both |Lists| or both + |Dictionaries|. - If they are |List|s: Append {expr2} to {expr1}. + If they are |Lists|: Append {expr2} to {expr1}. If {expr3} is given insert the items of {expr2} before item {expr3} in {expr1}. When {expr3} is zero insert before the first item. When {expr3} is equal to len({expr1}) then @@ -2341,7 +2342,7 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()* two lists into a new list use the + operator: > :let newlist = [1, 2, 3] + [4, 5] < - If they are Dictionaries: + If they are |Dictionaries|: Add all entries from {expr2} to {expr1}. If a key exists in both {expr1} and {expr2} then {expr3} is used to decide what to do: @@ -2486,7 +2487,7 @@ function({name}) *function()* *E700* garbagecollect() *garbagecollect()* - Cleanup unused |List|s and Dictionaries that have circular + Cleanup unused |Lists| and |Dictionaries| that have circular references. There is hardly ever a need to invoke this function, as it is automatically done when Vim runs out of memory or is waiting for the user to press a key after @@ -3108,7 +3109,7 @@ insert({list}, {item} [, {idx}]) *insert()* :call insert(mylist, 6, len(mylist)) < The last example can be done simpler with |add()|. Note that when {item} is a |List| it is inserted as a single - item. Use |extend()| to concatenate |List|s. + item. Use |extend()| to concatenate |Lists|. isdirectory({directory}) *isdirectory()* The result is a Number, which is non-zero when a directory @@ -3143,7 +3144,7 @@ join({list} [, {sep}]) *join()* Note that {sep} is not added at the end. You might want to add it there too: > let lines = join(mylist, "\n") . "\n" -< String items are used as-is. |List|s and Dictionaries are +< String items are used as-is. |Lists| and |Dictionaries| are converted into a string like with |string()|. The opposite function is |split()|. @@ -3342,7 +3343,7 @@ mapcheck({name}[, {mode}]) *mapcheck()* match({expr}, {pat}[, {start}[, {count}]]) *match()* When {expr} is a |List| then this returns the index of the first item where {pat} matches. Each item is used as a - String, |List|s and Dictionaries are used as echoed. + String, |Lists| and |Dictionaries| are used as echoed. Otherwise, {expr} is used as a String. The result is a Number, which gives the index (byte offset) in {expr} where {pat} matches. @@ -3807,7 +3808,7 @@ reverse({list}) Reverse the order of items in {list} in-place. Returns If you want a list to remain unmodified make a copy first: > :let revlist = reverse(copy(mylist)) -search({pattern} [, {flags}]) *search()* +search({pattern} [, {flags} [, {stopline}]]) *search()* Search for regexp pattern {pattern}. The search starts at the cursor position (you can use |cursor()| to set it). {flags} is a String, which can contain these character flags: @@ -3823,11 +3824,20 @@ search({pattern} [, {flags}]) *search()* cursor is moved. The 's' flag cannot be combined with the 'n' flag. + When the {stopline} argument is given then the search stops + after searching this line. This is useful to restrict the + search to a range of lines. Examples: > + let match = search('(', 'b', line("w0")) + let end = search('END', '', line("w$")) +< When {stopline} is used and it is not zero this also implies + that the search does not wrap around the end of the file. + When a match has been found its line number is returned. The cursor will be positioned at the match, unless the 'n' flag is used). If there is no match a 0 is returned and the cursor doesn't move. No error message is given. + To get the column number too use |searchpos()|. Example (goes over all files in the argument list): > :let n = 1 @@ -3865,7 +3875,7 @@ searchdecl({name} [, {global} [, {thisblock}]]) *searchdecl()* endif < *searchpair()* -searchpair({start}, {middle}, {end} [, {flags} [, {skip}]]) +searchpair({start}, {middle}, {end} [, {flags} [, {skip} [, {stopline}]]]) Search for the match of a nested start-end pair. This can be used to find the "endif" that matches an "if", while other if/endif pairs in between are ignored. @@ -3900,6 +3910,8 @@ searchpair({start}, {middle}, {end} [, {flags} [, {skip}]]) When evaluating {skip} causes an error the search is aborted and -1 returned. + For {stopline} see |search()|. + The value of 'ignorecase' is used. 'magic' is ignored, the patterns are used like it's on. @@ -3944,7 +3956,7 @@ searchpair({start}, {middle}, {end} [, {flags} [, {skip}]]) \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"') < *searchpairpos()* -searchpairpos({start}, {middle}, {end} [, {flags} [, {skip}]]) +searchpairpos({start}, {middle}, {end} [, {flags} [, {skip} [, {stopline}]]]) Same as searchpair(), but returns a |List| with the line and column position of the match. The first element of the |List| is the line number and the second element is the byte index of @@ -3955,8 +3967,8 @@ searchpairpos({start}, {middle}, {end} [, {flags} [, {skip}]]) < See |match-parens| for a bigger and more useful example. -searchpos({pattern} [, {flags}]) *searchpos()* - Same as search(), but returns a |List| with the line and +searchpos({pattern} [, {flags} [, {stopline}]]) *searchpos()* + Same as |search()|, but returns a |List| with the line and column position of the match. The first element of the |List| is the line number and the second element is the byte index of the column position of the match. If no match is found, @@ -4143,7 +4155,7 @@ sort({list} [, {func}]) *sort()* *E702* want a list to remain unmodified make a copy first: > :let sortedlist = sort(copy(mylist)) < Uses the string representation of each item to sort on. - Numbers sort after Strings, |List|s after Numbers. + Numbers sort after Strings, |Lists| after Numbers. For sorting text in the current buffer use |:sort|. When {func} is given and it is one then case is ignored. When {func} is a |Funcref| or a function name, this function diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 5cd614981a..13642e6f56 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 25 +*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 26 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2447,6 +2447,7 @@ A jump table for the options with a short description can be found at |Q_op|. When reading a file 'fileencoding' will be set from 'fileencodings'. To read a file in a certain encoding it won't work by setting 'fileencoding', use the |++enc| argument. + For a new file the global value of 'fileencoding' is used. Prepending "8bit-" and "2byte-" has no meaning here, they are ignored. When the option is set, the value is converted to lowercase. Thus you can set it with uppercase values too. '_' characters are @@ -2496,9 +2497,11 @@ A jump table for the options with a short description can be found at |Q_op|. non-blank characters. When the |++enc| argument is used then the value of 'fileencodings' is not used. - Note that 'fileencodings' is not used for a new file, 'fileencoding' - is always empty then. This means that a non-existing file may get a - different encoding than an empty file. + Note that 'fileencodings' is not used for a new file, the global value + of 'fileencoding' is used instead. You can set it with: > + :setglobal fenc=iso-8859-2 +< This means that a non-existing file may get a different encoding than + an empty file. The special value "ucs-bom" can be used to check for a Unicode BOM (Byte Order Mark) at the start of the file. It must not be preceded by "utf-8" or another Unicode encoding for this to work properly. @@ -3317,10 +3320,14 @@ A jump table for the options with a short description can be found at |Q_op|. 'guitablabel' 'gtl' string (default empty) global {not in Vi} + {only available when compiled with GUI enabled and + with the +windows feature} When nonempty describes the text to use in a label of the GUI tab - pages line. When empty Vim will use a default label. See + pages line. When empty Vim will use a default label. See |setting-guitablabel| for more info. + The format of this option is like that of 'statusline'. + Only used when the GUI tab pages line is displayed. 'e' must be present in 'guioptions'. For the non-GUI tab pages line 'tabline' is used. @@ -5089,7 +5096,7 @@ A jump table for the options with a short description can be found at |Q_op|. feature} When this option is not empty, it determines the content of the ruler string, as displayed for the 'ruler' option. - The format of this option, is like that of 'statusline'. + The format of this option is like that of 'statusline'. The default ruler width is 17 characters. To make the ruler 15 characters wide, put "%15(" at the start and "%)" at the end. Example: > diff --git a/runtime/doc/tags b/runtime/doc/tags index c96dccc6e4..0a5d062e11 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -5471,7 +5471,6 @@ hebrew hebrew.txt /*hebrew* hebrew.txt hebrew.txt /*hebrew.txt* help various.txt /*help* help-context help.txt /*help-context* -help-tags tags 1 help-translated various.txt /*help-translated* help-xterm-window various.txt /*help-xterm-window* help.txt help.txt /*help.txt* diff --git a/src/Makefile b/src/Makefile index 8ff3e3b2e6..66185ce02c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -354,7 +354,10 @@ CClink = $(CC) # DARWIN - detecting Mac OS X # Uncomment this line when you want to compile a Unix version of Vim on # Darwin. None of the Mac specific options or files will be used. +# You can also change the architecture supported, default is to test for both. #CONF_OPT_DARWIN = --disable-darwin +#CONF_OPT_DARWIN = --with-mac-arch=i386 +#CONF_OPT_DARWIN = --with-mac-arch=ppc # PERL # Uncomment this when you want to include the Perl interface. @@ -547,10 +550,6 @@ LINT_OPTIONS = -beprxzF #PROFILE_CFLAGS = -DEXITFREE #PROFILE_LIBS = -lccmalloc -# MAC OS X platform -MAC_OSX_ARCH = -arch ppc -#MAC_OSX_ARCH = -arch i386 - ##################################################### ### Specific systems, check if yours is listed! ### {{{ ##################################################### @@ -1201,11 +1200,11 @@ PHOTONGUI_BUNDLE = # CARBON GUI CARBONGUI_SRC = gui.c gui_mac.c CARBONGUI_OBJ = objects/gui.o objects/gui_mac.o objects/pty.o -CARBONGUI_DEFS = -DFEAT_GUI_MAC $(MAC_OSX_ARCH) -fno-common -fpascal-strings \ +CARBONGUI_DEFS = -DFEAT_GUI_MAC -fno-common -fpascal-strings \ -Wall -Wno-unknown-pragmas \ -mdynamic-no-pic -pipe CARBONGUI_IPATH = -I. -Iproto -CARBONGUI_LIBS_DIR = $(MAC_OSX_ARCH) +CARBONGUI_LIBS_DIR = CARBONGUI_LIBS1 = -framework Carbon CARBONGUI_LIBS2 = CARBONGUI_INSTALL = install_macosx diff --git a/src/auto/configure b/src/auto/configure index 41245b5786..ae30634c5d 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -876,6 +876,7 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-mac-arch=ARCH intel, ppc or both --with-vim-name=NAME what to call the Vim executable --with-ex-name=NAME what to call the Ex executable --with-view-name=NAME what to call the View executable @@ -2864,11 +2865,149 @@ echo "${ECHO_T}no, Darwin support disabled" >&6 echo "${ECHO_T}yes, Darwin support excluded" >&6 fi + echo "$as_me:$LINENO: checking --with-mac-arch argument" >&5 +echo $ECHO_N "checking --with-mac-arch argument... $ECHO_C" >&6 + +# Check whether --with-mac-arch or --without-mac-arch was given. +if test "${with_mac_arch+set}" = set; then + withval="$with_mac_arch" + MACARCH="$withval"; echo "$as_me:$LINENO: result: $MACARCH" >&5 +echo "${ECHO_T}$MACARCH" >&6 +else + MACARCH="both"; echo "$as_me:$LINENO: result: Defaulting to $MACARCH" >&5 +echo "${ECHO_T}Defaulting to $MACARCH" >&6 +fi; + + if test "x$MACARCH" = "xboth"; then + echo "$as_me:$LINENO: checking if both architectures are supported" >&5 +echo $ECHO_N "checking if both architectures are supported... $ECHO_C" >&6 + save_cppflags="$CPPFLAGS" + save_ldflags="$LDFLAGS" + CPPFLAGS="$CPPFLAGS -arch i386 -arch ppc" + LDFLAGS="$LDFLAGS -arch i386 -arch ppc" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + echo "$as_me:$LINENO: checking if Intel architecture is supported" >&5 +echo $ECHO_N "checking if Intel architecture is supported... $ECHO_C" >&6 + CPPFLAGS="$save_cppflags -arch i386" + LDFLAGS="$save_ldflags -arch i386" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; MACARCH="intel" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; MACARCH="ppc" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CPPFLAGS="$save_cppflags" + LDFLAGS="$save_ldflags" + fi + + case "$MACARCH" in + intel) MAC_OSX_ARCH="-arch i386";; + both) MAC_OSX_ARCH="-arch i386 -arch ppc";; + ppc) MAC_OSX_ARCH="-arch ppc";; + *) MAC_OSX_ARCH="";; + esac + + if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then + CFLAGS=`echo "$CFLAGS" | sed 's/-O[23456789]/-O/'` + fi + + CPPFLAGS="$CPPFLAGS $MAC_OSX_ARCH" + LDFLAGS="$LDFLAGS $MAC_OSX_ARCH" + if test "$enable_darwin" = "yes"; then MACOSX=yes 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 -arch ppc" + CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp" echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 @@ -3256,6 +3395,7 @@ fi fi fi fi + else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 diff --git a/src/configure.in b/src/configure.in index 382d1af165..574e2df9e2 100644 --- a/src/configure.in +++ b/src/configure.in @@ -102,12 +102,51 @@ if test "`(uname) 2>/dev/null`" = Darwin; then AC_MSG_RESULT([yes, Darwin support excluded]) fi + AC_MSG_CHECKING(--with-mac-arch argument) + AC_ARG_WITH(mac-arch, [ --with-mac-arch=ARCH intel, ppc or both], + MACARCH="$withval"; AC_MSG_RESULT($MACARCH), + MACARCH="both"; AC_MSG_RESULT(Defaulting to $MACARCH)) + + if test "x$MACARCH" = "xboth"; then + AC_MSG_CHECKING(if both architectures are supported) + save_cppflags="$CPPFLAGS" + save_ldflags="$LDFLAGS" + CPPFLAGS="$CPPFLAGS -arch i386 -arch ppc" + LDFLAGS="$LDFLAGS -arch i386 -arch ppc" + AC_TRY_LINK([ ], [ ], + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) + AC_MSG_CHECKING(if Intel architecture is supported) + CPPFLAGS="$save_cppflags -arch i386" + LDFLAGS="$save_ldflags -arch i386" + AC_TRY_LINK([ ], [ ], + AC_MSG_RESULT(yes); MACARCH="intel", + AC_MSG_RESULT(no); MACARCH="ppc")) + CPPFLAGS="$save_cppflags" + LDFLAGS="$save_ldflags" + fi + + case "$MACARCH" in + intel) MAC_OSX_ARCH="-arch i386";; + both) MAC_OSX_ARCH="-arch i386 -arch ppc";; + ppc) MAC_OSX_ARCH="-arch ppc";; + *) MAC_OSX_ARCH="";; + esac + + dnl avoid a bug with -O2 for intel + if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then + CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-O/'` + fi + + CPPFLAGS="$CPPFLAGS $MAC_OSX_ARCH" + LDFLAGS="$LDFLAGS $MAC_OSX_ARCH" + if test "$enable_darwin" = "yes"; then MACOSX=yes OS_EXTRA_SCR="os_macosx.c os_mac_conv.c"; OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" dnl TODO: use -arch i386 on Intel machines - CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp -arch ppc" + 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) @@ -119,6 +158,7 @@ if test "`(uname) 2>/dev/null`" = Darwin; then fi fi fi + else AC_MSG_RESULT(no) fi diff --git a/src/edit.c b/src/edit.c index 79605666aa..bfd27cec24 100644 --- a/src/edit.c +++ b/src/edit.c @@ -202,6 +202,9 @@ static int ins_bs __ARGS((int c, int mode, int *inserted_space_p)); static void ins_mouse __ARGS((int c)); static void ins_mousescroll __ARGS((int up)); #endif +#if defined(FEAT_GUI_TABLINE) || defined(PROTO) +static void ins_tabline __ARGS((int c)); +#endif static void ins_left __ARGS((void)); static void ins_home __ARGS((int c)); static void ins_end __ARGS((int c)); @@ -1044,6 +1047,12 @@ doESCkey: ins_mousescroll(TRUE); break; #endif +#ifdef FEAT_GUI_TABLINE + case K_TABLINE: + case K_TABMENU: + ins_tabline(c); + break; +#endif case K_IGNORE: /* Something mapped to nothing */ break; @@ -3515,7 +3524,7 @@ ins_compl_get_exp(ini) found_new_match = searchit(NULL, ins_buf, pos, compl_direction, compl_pattern, 1L, SEARCH_KEEP + SEARCH_NFMSG, - RE_LAST); + RE_LAST, (linenr_T)0); if (!compl_started) { /* set "compl_started" even on fail */ @@ -7978,7 +7987,31 @@ ins_mousescroll(up) } #endif -#ifdef FEAT_GUI +#if defined(FEAT_GUI_TABLINE) || defined(PROTO) + void +ins_tabline(c) + int c; +{ + /* We will be leaving the current window, unless closing another tab. */ + if (c != K_TABMENU || current_tabmenu != TABLINE_MENU_CLOSE + || (current_tab != 0 && current_tab != tabpage_index(curtab))) + { + undisplay_dollar(); + start_arrow(&curwin->w_cursor); +# ifdef FEAT_CINDENT + can_cindent = TRUE; +# endif + } + + if (c == K_TABLINE) + goto_tabpage(current_tab); + else + handle_tabmenu(); + +} +#endif + +#if defined(FEAT_GUI) || defined(PROTO) void ins_scroll() { diff --git a/src/ex_getln.c b/src/ex_getln.c index bac600cf5f..061f8c4f50 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -1224,21 +1224,21 @@ getcmdline(firstc, count, indent) # endif if (!mouse_has(MOUSE_COMMAND)) goto cmdline_not_changed; /* Ignore mouse */ -#ifdef FEAT_CLIPBOARD +# ifdef FEAT_CLIPBOARD if (clip_star.available) cmdline_paste('*', TRUE); else -#endif +# endif cmdline_paste(0, TRUE); redrawcmd(); goto cmdline_changed; -#ifdef FEAT_DND +# ifdef FEAT_DND case K_DROP: cmdline_paste('~', TRUE); redrawcmd(); goto cmdline_changed; -#endif +# endif case K_LEFTDRAG: case K_LEFTRELEASE: @@ -1291,7 +1291,7 @@ getcmdline(firstc, count, indent) if (mouse_row <= cmdline_row + ccline.cmdspos / Columns && mouse_col < ccline.cmdspos % Columns + i) break; -#ifdef FEAT_MBYTE +# ifdef FEAT_MBYTE if (has_mbyte) { /* Count ">" for double-wide char that doesn't fit. */ @@ -1299,7 +1299,7 @@ getcmdline(firstc, count, indent) ccline.cmdpos += (*mb_ptr2len)(ccline.cmdbuff + ccline.cmdpos) - 1; } -#endif +# endif ccline.cmdspos += i; } goto cmdline_not_changed; @@ -1339,6 +1339,16 @@ getcmdline(firstc, count, indent) } goto cmdline_not_changed; #endif +#ifdef FEAT_GUI_TABLINE + case K_TABLINE: + case K_TABMENU: + /* Don't want to change any tabs here. Make sure the same tab + * is still selected. */ + if (gui_use_tabline()) + gui_mch_set_curtab(tabpage_index(curtab)); + goto cmdline_not_changed; +#endif + case K_SELECT: /* end of Select mode mapping - ignore */ goto cmdline_not_changed; diff --git a/src/feature.h b/src/feature.h index e2d90132f1..34b673d5d7 100644 --- a/src/feature.h +++ b/src/feature.h @@ -1194,6 +1194,11 @@ # define FEAT_BEVAL_TIP /* balloon eval used for toolbar tooltip */ #endif +/* both Motif and Athena are X11 and share some code */ +#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) +# define FEAT_GUI_X11 +#endif + #if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG) /* * The following features are (currently) only used by Sun Visual WorkShop 6 diff --git a/src/globals.h b/src/globals.h index 8acd3696dd..e77e08ffd1 100644 --- a/src/globals.h +++ b/src/globals.h @@ -489,6 +489,10 @@ EXTERN VimClipboard clip_plus; /* CLIPBOARD selection in X11 */ # else # define clip_plus clip_star /* there is only one clipboard */ # endif +EXTERN int clip_unnamed INIT(= FALSE); +EXTERN int clip_autoselect INIT(= FALSE); +EXTERN int clip_autoselectml INIT(= FALSE); +EXTERN regprog_T *clip_exclude_prog INIT(= NULL); #endif /* diff --git a/src/gui_mac.c b/src/gui_mac.c index 8f8358c8bf..127c590ca6 100644 --- a/src/gui_mac.c +++ b/src/gui_mac.c @@ -3394,8 +3394,6 @@ gui_mch_init_font(char_u *font_name, int fontset) kATSStyleNoAntiAliasing : kATSStyleNoOptions; - printf("BLA\n"); - ATSUAttributeTag attribTags[] = { kATSUFontTag, kATSUSizeTag, kATSUStyleRenderingOptionsTag, @@ -3426,7 +3424,6 @@ gui_mch_init_font(char_u *font_name, int fontset) #endif return OK; - } /* @@ -3249,7 +3249,7 @@ do_put(regname, dir, count, flags) if (flags & PUT_LINE_FORWARD) { /* Must be "p" for a Visual block, put lines below the block. */ - curwin->w_cursor = curbuf->b_visual_end; + curwin->w_cursor = curbuf->b_visual.vi_end; dir = FORWARD; } curbuf->b_op_start = curwin->w_cursor; /* default for '[ mark */ diff --git a/src/option.c b/src/option.c index 3d9c77849d..4d575ab21a 100644 --- a/src/option.c +++ b/src/option.c @@ -38,20 +38,61 @@ * The options that are local to a window or buffer have "indir" set to one of * these values. Special values: * PV_NONE: global option. + * PV_WIN is added: window-local option + * PV_BUF is added: buffer-local option * PV_BOTH is added: global option which also has a local value. */ #define PV_BOTH 0x1000 +#define PV_WIN 0x2000 +#define PV_BUF 0x4000 +#define OPT_WIN(x) (idopt_T)(PV_WIN + (int)(x)) +#define OPT_BUF(x) (idopt_T)(PV_BUF + (int)(x)) #define OPT_BOTH(x) (idopt_T)(PV_BOTH + (int)(x)) +/* + * "indir" values for buffer-local opions + */ +enum +{ + BV_AI = 0 + , BV_AR +#if defined(FEAT_QUICKFIX) + , BV_BH +#endif + , BV_BIN + , BV_BL + , BV_COUNT /* must be the last one */ +}; + +#define PV_AI OPT_BUF(BV_AI) +#define PV_AR OPT_BOTH(OPT_BUF(BV_AR)) +#if defined(FEAT_QUICKFIX) +# define PV_BH OPT_BUF(BV_BH) +#endif +#define PV_BIN OPT_BUF(BV_BIN) +#define PV_BL OPT_BUF(BV_BL) + +/* + * "indir" values for window-local options + */ +enum +{ + WV_LIST = 0 +#ifdef FEAT_ARABIC + , WV_ARAB +#endif + , WV_COUNT /* must be the last one */ +}; + +#define PV_LIST OPT_WIN(WV_LIST) +#ifdef FEAT_ARABIC +# define PV_ARAB OPT_WIN(WV_ARAB) +#endif + +/* TODO: "indir" values for the rest */ typedef enum { PV_NONE = 0 - , PV_AI - , PV_AR - , PV_ARAB - , PV_BH - , PV_BIN - , PV_BL , PV_BOMB , PV_BT , PV_CI @@ -100,7 +141,6 @@ typedef enum , PV_KP , PV_LBR , PV_LISP - , PV_LIST , PV_MA , PV_ML , PV_MOD @@ -408,7 +448,7 @@ static struct vimoption (char_u *)NULL, PV_NONE, {(char_u *)FALSE, (char_u *)0L}}, {"autoread", "ar", P_BOOL|P_VI_DEF, - (char_u *)&p_ar, OPT_BOTH(PV_AR), + (char_u *)&p_ar, PV_AR, {(char_u *)FALSE, (char_u *)0L}}, {"autowrite", "aw", P_BOOL|P_VI_DEF, (char_u *)&p_aw, PV_NONE, @@ -4092,7 +4132,7 @@ do_set(arg, opt_flags) * with a local value the local value will be * reset, use the global value here. */ if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0 - && (int)options[opt_idx].indir >= PV_BOTH) + && ((int)options[opt_idx].indir & PV_BOTH)) varp = options[opt_idx].var; /* The old value is kept until we are sure that the @@ -4189,7 +4229,7 @@ do_set(arg, opt_flags) /* When setting the local value of a global * option, the old value may be the global value. */ - if ((int)options[opt_idx].indir >= PV_BOTH + if (((int)options[opt_idx].indir & PV_BOTH) && (opt_flags & OPT_LOCAL)) origval = *(char_u **)get_varp( &options[opt_idx]); @@ -5035,7 +5075,7 @@ set_string_option_direct(name, opt_idx, val, opt_flags) /* When setting both values of a global option with a local value, * make the local value empty, so that the global value is used. */ - if ((int)options[opt_idx].indir >= PV_BOTH && both) + if (((int)options[opt_idx].indir & PV_BOTH) && both) { free_string_option(*varp); *varp = empty_option; @@ -5088,7 +5128,7 @@ set_string_option(opt_idx, value, opt_flags) { varp = (char_u **)get_varp_scope(&(options[opt_idx]), (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0 - ? ((int)options[opt_idx].indir >= PV_BOTH + ? (((int)options[opt_idx].indir & PV_BOTH) ? OPT_GLOBAL : OPT_LOCAL) : opt_flags); oldval = *varp; |