From: edyfox Date: Thu, 11 Mar 2010 02:59:04 +0000 (+0000) Subject: Merged from the latest developing branch. X-Git-Url: https://repo.or.cz/w/MacVim.git/commitdiff_plain/40eb72f8f64356ab23ffda683d7e1962fda2f16c Merged from the latest developing branch. git-svn-id: https://vim.svn.sourceforge.net/svnroot/vim/trunk@1802 2a77ed30-b011-0410-a7ad-c7884a0aa172 --- diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index feee51a9..9c9b72df 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -5370,6 +5370,8 @@ synIDattr({synID}, {what} [, {mode}]) *synIDattr()* the color, cterm: color number as a string, term: empty string) "bg" background color (as with "fg") + "font" font name (only available in the GUI) + |highlight-font| "sp" special color (as with "fg") |highlight-guisp| "fg#" like "fg", but for the GUI and the GUI is running the name in "#RRGGBB" form @@ -5379,6 +5381,7 @@ synIDattr({synID}, {what} [, {mode}]) *synIDattr()* "italic" "1" if italic "reverse" "1" if reverse "inverse" "1" if inverse (= reverse) + "standout" "1" if standout "underline" "1" if underlined "undercurl" "1" if undercurled diff --git a/runtime/plugin/gzip.vim b/runtime/plugin/gzip.vim index 65602387..edef1495 100644 --- a/runtime/plugin/gzip.vim +++ b/runtime/plugin/gzip.vim @@ -1,6 +1,6 @@ " Vim plugin for editing compressed files. " Maintainer: Bram Moolenaar -" Last Change: 2005 Jul 26 +" Last Change: 2010 Mar 10 " Exit quickly when: " - this plugin was already loaded @@ -20,17 +20,25 @@ augroup gzip " " Set binary mode before reading the file. " Use "gzip -d", gunzip isn't always available. - autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z setlocal bin + autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z,*.lzma,*.xz setlocal bin autocmd BufReadPost,FileReadPost *.gz call gzip#read("gzip -dn") autocmd BufReadPost,FileReadPost *.bz2 call gzip#read("bzip2 -d") autocmd BufReadPost,FileReadPost *.Z call gzip#read("uncompress") + autocmd BufReadPost,FileReadPost *.lzma call gzip#read("lzma -d") + autocmd BufReadPost,FileReadPost *.xz call gzip#read("xz -d") autocmd BufWritePost,FileWritePost *.gz call gzip#write("gzip") autocmd BufWritePost,FileWritePost *.bz2 call gzip#write("bzip2") autocmd BufWritePost,FileWritePost *.Z call gzip#write("compress -f") + autocmd BufWritePost,FileWritePost *.lzma call gzip#write("lzma -z") + autocmd BufWritePost,FileWritePost *.xz call gzip#write("xz -z") autocmd FileAppendPre *.gz call gzip#appre("gzip -dn") autocmd FileAppendPre *.bz2 call gzip#appre("bzip2 -d") autocmd FileAppendPre *.Z call gzip#appre("uncompress") + autocmd FileAppendPre *.lzma call gzip#appre("lzma -d") + autocmd FileAppendPre *.xz call gzip#appre("xz -d") autocmd FileAppendPost *.gz call gzip#write("gzip") autocmd FileAppendPost *.bz2 call gzip#write("bzip2") autocmd FileAppendPost *.Z call gzip#write("compress -f") + autocmd FileAppendPost *.lzma call gzip#write("lzma -z") + autocmd FileAppendPost *.xz call gzip#write("xz -z") augroup END diff --git a/src/Make_ming.mak b/src/Make_ming.mak index f57fb18d..0a917890 100644 --- a/src/Make_ming.mak +++ b/src/Make_ming.mak @@ -212,23 +212,25 @@ ifndef RUBY_VER_LONG RUBY_VER_LONG = 1.6 endif -ifeq ($(RUBY_VER), 16) ifndef RUBY_PLATFORM +ifeq ($(RUBY_VER), 16) RUBY_PLATFORM = i586-mswin32 -endif -ifndef RUBY_INSTALL_NAME -RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER) -endif +else ifneq ("X$(wildcard, $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32)", X) +RUBY_PLATFORM = i386-mingw32 else -ifndef RUBY_PLATFORM RUBY_PLATFORM = i386-mswin32 endif +endif + ifndef RUBY_INSTALL_NAME +ifeq ($(RUBY_VER), 16) +RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER) +else RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER) endif endif -RUBYINC =-I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM) +RUBYINC =-I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM) -I $(RUBY)/include/ruby-$(RUBY_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM) ifeq (no, $(DYNAMIC_RUBY)) RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME) endif diff --git a/src/auto/configure b/src/auto/configure index 0362c5a8..d8d80103 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -718,6 +718,7 @@ EXNAME VIMNAME OS_EXTRA_OBJ OS_EXTRA_SRC +XCODE_SELECT CPP_MM STRIP AWK @@ -774,6 +775,7 @@ ac_user_opts=' enable_option_checking enable_darwin with_mac_arch +with_developer_dir with_local_dir with_vim_name with_ex_name @@ -1492,6 +1494,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-mac-arch=ARCH current, intel, ppc or both + --with-developer-dir=PATH use PATH as location for Xcode developer tools --with-local-dir=PATH search PATH instead of /usr/local for local libraries. --without-local-dir do not search /usr/local for local libraries. --with-vim-name=NAME what to call the Vim executable @@ -3833,13 +3836,78 @@ $as_echo "defaulting to $MACARCH" >&6; } fi + { $as_echo "$as_me:$LINENO: checking --with-developer-dir argument" >&5 +$as_echo_n "checking --with-developer-dir argument... " >&6; } + +# Check whether --with-developer-dir was given. +if test "${with_developer_dir+set}" = set; then + withval=$with_developer_dir; DEVELOPER_DIR="$withval"; { $as_echo "$as_me:$LINENO: result: $DEVELOPER_DIR" >&5 +$as_echo "$DEVELOPER_DIR" >&6; } +else + DEVELOPER_DIR=""; { $as_echo "$as_me:$LINENO: result: not present" >&5 +$as_echo "not present" >&6; } +fi + + + if test "x$DEVELOPER_DIR" = "x"; then + # Extract the first word of "xcode-select", so it can be a program name with args. +set dummy xcode-select; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_XCODE_SELECT+set}" = set; then + $as_echo_n "(cached) " >&6 +else + case $XCODE_SELECT in + [\\/]* | ?:[\\/]*) + ac_cv_path_XCODE_SELECT="$XCODE_SELECT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_XCODE_SELECT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +XCODE_SELECT=$ac_cv_path_XCODE_SELECT +if test -n "$XCODE_SELECT"; then + { $as_echo "$as_me:$LINENO: result: $XCODE_SELECT" >&5 +$as_echo "$XCODE_SELECT" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$XCODE_SELECT" != "x"; then + { $as_echo "$as_me:$LINENO: checking for developer dir using xcode-select" >&5 +$as_echo_n "checking for developer dir using xcode-select... " >&6; } + DEVELOPER_DIR=`$XCODE_SELECT -print-path` + { $as_echo "$as_me:$LINENO: result: $DEVELOPER_DIR" >&5 +$as_echo "$DEVELOPER_DIR" >&6; } + else + DEVELOPER_DIR=/Developer + fi + fi + if test "x$MACARCH" = "xboth"; then { $as_echo "$as_me:$LINENO: checking for 10.4 universal SDK" >&5 $as_echo_n "checking for 10.4 universal SDK... " >&6; } save_cppflags="$CPPFLAGS" save_cflags="$CFLAGS" save_ldflags="$LDFLAGS" - CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3960,9 +4028,9 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp" if test "x$MACARCH" = "xboth"; then - CPPFLAGS="$CPPFLAGS -I/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" + CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" else - CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon" + CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/Headers/FlatCarbon" fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. @@ -17319,7 +17387,7 @@ $as_echo "no" >&6; } fi fi if test "x$MACARCH" = "xboth"; then - LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" fi DEPEND_CFLAGS_FILTER= diff --git a/src/charset.c b/src/charset.c index 5b0e71c8..ef162e4a 100644 --- a/src/charset.c +++ b/src/charset.c @@ -1255,7 +1255,10 @@ getvcol(wp, pos, start, cursor, end) vcol = 0; ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE); - posptr = ptr + pos->col; + if (pos->col == MAXCOL) + posptr = NULL; /* continue until the NUL */ + else + posptr = ptr + pos->col; /* * This function is used very often, do some speed optimizations. @@ -1313,7 +1316,7 @@ getvcol(wp, pos, start, cursor, end) incr = CHARSIZE(c); } - if (ptr >= posptr) /* character at pos->col */ + if (posptr != NULL && ptr >= posptr) /* character at pos->col */ break; vcol += incr; @@ -1334,7 +1337,7 @@ getvcol(wp, pos, start, cursor, end) break; } - if (ptr >= posptr) /* character at pos->col */ + if (posptr != NULL && ptr >= posptr) /* character at pos->col */ break; vcol += incr; diff --git a/src/configure.in b/src/configure.in index 177fa885..b7ebe449 100644 --- a/src/configure.in +++ b/src/configure.in @@ -116,6 +116,22 @@ if test "`(uname) 2>/dev/null`" = Darwin; then MACARCH="$withval"; AC_MSG_RESULT($MACARCH), MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH)) + AC_MSG_CHECKING(--with-developer-dir argument) + AC_ARG_WITH(developer-dir, [ --with-developer-dir=PATH use PATH as location for Xcode developer tools], + DEVELOPER_DIR="$withval"; AC_MSG_RESULT($DEVELOPER_DIR), + DEVELOPER_DIR=""; AC_MSG_RESULT(not present)) + + if test "x$DEVELOPER_DIR" = "x"; then + AC_PATH_PROG(XCODE_SELECT, xcode-select) + if test "x$XCODE_SELECT" != "x"; then + AC_MSG_CHECKING(for developer dir using xcode-select) + DEVELOPER_DIR=`$XCODE_SELECT -print-path` + AC_MSG_RESULT([$DEVELOPER_DIR]) + else + DEVELOPER_DIR=/Developer + fi + fi + if test "x$MACARCH" = "xboth"; then AC_MSG_CHECKING(for 10.4 universal SDK) dnl There is a terrible inconsistency (but we appear to get away with it): @@ -127,7 +143,7 @@ if test "`(uname) 2>/dev/null`" = Darwin; then save_cppflags="$CPPFLAGS" save_cflags="$CFLAGS" save_ldflags="$LDFLAGS" - CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" AC_TRY_LINK([ ], [ ], AC_MSG_RESULT(found, will make universal binary), @@ -157,9 +173,9 @@ if test "`(uname) 2>/dev/null`" = Darwin; then dnl TODO: use -arch i386 on Intel machines CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp" if test "x$MACARCH" = "xboth"; then - CPPFLAGS="$CPPFLAGS -I/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" + CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" else - CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon" + CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/Headers/FlatCarbon" fi dnl If Carbon is found, assume we don't want X11 @@ -3233,7 +3249,7 @@ if test "x$MACOSX" = "xyes" && test "x$CARBON" = "xyes" \ fi fi if test "x$MACARCH" = "xboth"; then - LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" fi dnl gcc 3.1 changed the meaning of -MM. The only solution appears to be to diff --git a/src/edit.c b/src/edit.c index 43058f8b..33e580f1 100644 --- a/src/edit.c +++ b/src/edit.c @@ -4684,6 +4684,7 @@ ins_complete(c) int startcol = 0; /* column where searched text starts */ colnr_T curs_col; /* cursor column */ int n; + int save_w_wrow; compl_direction = ins_compl_key2dir(c); if (!compl_started) @@ -5067,6 +5068,7 @@ ins_complete(c) /* * Find next match (and following matches). */ + save_w_wrow = curwin->w_wrow; n = ins_compl_next(TRUE, ins_compl_key2count(c), ins_compl_use_match(c)); /* may undisplay the popup menu */ @@ -5220,6 +5222,12 @@ ins_complete(c) /* RedrawingDisabled may be set when invoked through complete(). */ n = RedrawingDisabled; RedrawingDisabled = 0; + + /* If the cursor moved we need to remove the pum first. */ + setcursor(); + if (save_w_wrow != curwin->w_wrow) + ins_compl_del_pum(); + ins_compl_show_pum(); setcursor(); RedrawingDisabled = n; diff --git a/src/eval.c b/src/eval.c index 87333c2b..f9babb3f 100644 --- a/src/eval.c +++ b/src/eval.c @@ -16627,7 +16627,7 @@ f_synIDattr(argvars, rettv) p = highlight_has_attr(id, HL_BOLD, modec); break; - case 'f': /* fg[#] */ + case 'f': /* fg[#] or font */ p = highlight_color(id, what, modec); break; diff --git a/src/gui_gtk.c b/src/gui_gtk.c index 0535e204..6a657a3e 100644 --- a/src/gui_gtk.c +++ b/src/gui_gtk.c @@ -2313,19 +2313,6 @@ gui_mch_dialog(int type, /* type of dialog */ gtk_widget_destroy(dialog); } - /* Terrible hack: When the text area still has focus when we remove the - * dialog, somehow gvim loses window focus. This is with "point to type" - * in the KDE 3.1 window manager. Warp the mouse pointer to outside the - * window and back to avoid that. */ - if (!gui.in_focus) - { - int x, y; - - gdk_window_get_pointer(gui.drawarea->window, &x, &y, NULL); - gui_mch_setmouse(-100, -100); - gui_mch_setmouse(x, y); - } - return response > 0 ? response : 0; } diff --git a/src/if_ruby.c b/src/if_ruby.c index 6d28de37..802e1c1c 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -39,8 +39,8 @@ # define rb_cTrueClass (*dll_rb_cTrueClass) # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 /* - * On ver 1.8, all Ruby functions are exported with "__declspce(dllimport)" - * in ruby.h. But it cause trouble for these variables, because it is + * On ver 1.8, all Ruby functions are exported with "__declspec(dllimport)" + * in ruby.h. But it causes trouble for these variables, because it is * defined in this file. When defined this RUBY_EXPORT it modified to * "extern" and be able to avoid this problem. */ @@ -53,6 +53,13 @@ # undef _WIN32_WINNT #endif +#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 +/* Ruby 1.9 defines a number of static functions which use rb_num2long and + * rb_int2big */ +# define rb_num2long rb_num2long_stub +# define rb_int2big rb_int2big_stub +#endif + #include #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 # include @@ -159,7 +166,14 @@ static void ruby_vim_init(void); #define rb_str_concat dll_rb_str_concat #define rb_str_new dll_rb_str_new #define rb_str_new2 dll_rb_str_new2 -#if defined(RUBY_VERSION) && RUBY_VERSION >= 19 +#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 +# define rb_string_value_ptr dll_rb_string_value_ptr +# define rb_float_new dll_rb_float_new +# define rb_ary_new dll_rb_ary_new +# define rb_ary_push dll_rb_ary_push +#endif +#if defined(RUBY_VERSION) && RUBY_VERSION >= 19 \ + || defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 # define rb_errinfo dll_rb_errinfo #else # define ruby_errinfo (*dll_ruby_errinfo) @@ -226,7 +240,8 @@ static VALUE (*dll_rb_str_cat) (VALUE, const char*, long); static VALUE (*dll_rb_str_concat) (VALUE, VALUE); static VALUE (*dll_rb_str_new) (const char*, long); static VALUE (*dll_rb_str_new2) (const char*); -#if defined(RUBY_VERSION) && RUBY_VERSION >= 19 +#if defined(RUBY_VERSION) && RUBY_VERSION >= 19 \ + || defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 static VALUE (*dll_rb_errinfo) (void); #else static VALUE *dll_ruby_errinfo; @@ -235,6 +250,15 @@ static void (*dll_ruby_init) (void); static void (*dll_ruby_init_loadpath) (void); static void (*dll_NtInitialize) (int*, char***); #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 +static char * (*dll_rb_string_value_ptr) (volatile VALUE*); +static VALUE (*dll_rb_float_new) (double); +static VALUE (*dll_rb_ary_new) (void); +static VALUE (*dll_rb_ary_push) (VALUE, VALUE); +#endif +#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 +static VALUE (*dll_rb_int2big)(SIGNED_VALUE); +#endif +#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...); #endif @@ -246,6 +270,17 @@ static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*); static VALUE (*dll_rb_sprintf) (const char*, ...); #endif +#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 +static SIGNED_VALUE rb_num2long_stub(VALUE x) +{ + return dll_rb_num2long(x); +} +static VALUE rb_int2big_stub(SIGNED_VALUE x) +{ + return dll_rb_int2big(x); +} +#endif + static HINSTANCE hinstRuby = 0; /* Instance of ruby.dll */ /* @@ -301,17 +336,33 @@ static struct {"rb_str_concat", (RUBY_PROC*)&dll_rb_str_concat}, {"rb_str_new", (RUBY_PROC*)&dll_rb_str_new}, {"rb_str_new2", (RUBY_PROC*)&dll_rb_str_new2}, -#if defined(RUBY_VERSION) && RUBY_VERSION >= 19 +#if defined(RUBY_VERSION) && RUBY_VERSION >= 19 \ + || defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 {"rb_errinfo", (RUBY_PROC*)&dll_rb_errinfo}, #else {"ruby_errinfo", (RUBY_PROC*)&dll_ruby_errinfo}, #endif {"ruby_init", (RUBY_PROC*)&dll_ruby_init}, {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath}, - {"NtInitialize", (RUBY_PROC*)&dll_NtInitialize}, + { +#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 19 + "NtInitialize", +#else + "ruby_sysinit", +#endif + (RUBY_PROC*)&dll_NtInitialize}, #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf}, #endif +#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + {"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr}, + {"rb_float_new", (RUBY_PROC*)&dll_rb_float_new}, + {"rb_ary_new", (RUBY_PROC*)&dll_rb_ary_new}, + {"rb_ary_push", (RUBY_PROC*)&dll_rb_ary_push}, +#endif +#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 + {"rb_int2big", (RUBY_PROC*)&dll_rb_int2big}, +#endif #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 {"ruby_script", (RUBY_PROC*)&dll_ruby_script}, {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index}, @@ -569,7 +620,8 @@ static int ensure_ruby_initialized(void) static void error_print(int state) { #ifndef DYNAMIC_RUBY -#if !(defined(RUBY_VERSION) && RUBY_VERSION >= 19) +#if !(defined(RUBY_VERSION) && RUBY_VERSION >= 19) \ + && !(defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19) RUBYEXTERN VALUE ruby_errinfo; #endif #endif @@ -605,7 +657,8 @@ static void error_print(int state) break; case TAG_RAISE: case TAG_FATAL: -#if defined(RUBY_VERSION) && RUBY_VERSION >= 19 +#if defined(RUBY_VERSION) && RUBY_VERSION >= 19 \ + || defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 eclass = CLASS_OF(rb_errinfo()); einfo = rb_obj_as_string(rb_errinfo()); #else diff --git a/src/if_xcmdsrv.c b/src/if_xcmdsrv.c index 4b291399..5412b35d 100644 --- a/src/if_xcmdsrv.c +++ b/src/if_xcmdsrv.c @@ -21,21 +21,6 @@ # include # endif -# if defined(HAVE_SYS_SELECT_H) && \ - (!defined(HAVE_SYS_TIME_H) || defined(SYS_SELECT_WITH_SYS_TIME)) -# include -# endif - -# ifndef HAVE_SELECT -# ifdef HAVE_SYS_POLL_H -# include -# else -# ifdef HAVE_POLL_H -# include -# endif -# endif -# endif - /* * This file provides procedures that implement the command server * functionality of Vim when in contact with an X11 server. diff --git a/src/memline.c b/src/memline.c index 29a6e5cc..102b61e3 100644 --- a/src/memline.c +++ b/src/memline.c @@ -2113,12 +2113,12 @@ errorret: if (buf->b_ml.ml_mfp == NULL) /* there are no lines */ return (char_u *)""; -/* - * See if it is the same line as requested last time. - * Otherwise may need to flush last used line. - * Don't use the last used line when 'swapfile' is reset, need to load all - * blocks. - */ + /* + * See if it is the same line as requested last time. + * Otherwise may need to flush last used line. + * Don't use the last used line when 'swapfile' is reset, need to load all + * blocks. + */ if (buf->b_ml.ml_line_lnum != lnum || mf_dont_release) { ml_flush_line(buf); diff --git a/src/netbeans.c b/src/netbeans.c index 87e0edd1..ed0cd05b 100644 --- a/src/netbeans.c +++ b/src/netbeans.c @@ -736,6 +736,14 @@ messageFromNetbeans(gpointer clientData UNUSED, #ifndef FEAT_GUI_GTK static int level = 0; #endif +#ifdef HAVE_SELECT + struct timeval tval; + fd_set rfds; +#else +# ifdef HAVE_POLL + struct pollfd fds; +# endif +#endif if (sd < 0) { @@ -755,9 +763,26 @@ messageFromNetbeans(gpointer clientData UNUSED, return; /* out of memory! */ } - /* Keep on reading for as long as there is something to read. */ + /* Keep on reading for as long as there is something to read. + * Use select() or poll() to avoid blocking on a message that is exactly + * MAXMSGSIZE long. */ for (;;) { +#ifdef HAVE_SELECT + FD_ZERO(&rfds); + FD_SET(sd, &rfds); + tval.tv_sec = 0; + tval.tv_usec = 0; + if (select(sd + 1, &rfds, NULL, NULL, &tval) <= 0) + break; +#else +# ifdef HAVE_POLL + fds.fd = sd; + fds.events = POLLIN; + if (poll(&fds, 1, 0) <= 0) + break; +# endif +#endif len = sock_read(sd, buf, MAXMSGSIZE); if (len <= 0) break; /* error or nothing more to read */ diff --git a/src/os_unixx.h b/src/os_unixx.h index 3dd254e9..e46edcf5 100644 --- a/src/os_unixx.h +++ b/src/os_unixx.h @@ -28,11 +28,6 @@ # include # endif -# if defined(HAVE_SYS_SELECT_H) && \ - (!defined(HAVE_SYS_TIME_H) || defined(SYS_SELECT_WITH_SYS_TIME)) -# include -# endif - # ifndef WEXITSTATUS # ifdef HAVE_UNION_WAIT # define WEXITSTATUS(stat_val) ((stat_val).w_T.w_Retcode) @@ -65,16 +60,6 @@ # include #endif -#ifndef HAVE_SELECT -# ifdef HAVE_SYS_POLL_H -# include -# else -# ifdef HAVE_POLL_H -# include -# endif -# endif -#endif - #ifdef HAVE_SYS_STREAM_H # include #endif diff --git a/src/syntax.c b/src/syntax.c index 8d976ea4..3f502b70 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -8326,7 +8326,7 @@ highlight_has_attr(id, flag, modec) char_u * highlight_color(id, what, modec) int id; - char_u *what; /* "fg", "bg", "sp", "fg#", "bg#" or "sp#" */ + char_u *what; /* "font", "fg", "bg", "sp", "fg#", "bg#" or "sp#" */ int modec; /* 'g' for GUI, 'c' for cterm, 't' for term */ { static char_u name[20]; @@ -8334,20 +8334,30 @@ highlight_color(id, what, modec) int fg = FALSE; # ifdef FEAT_GUI int sp = FALSE; + int font = FALSE; # endif if (id <= 0 || id > highlight_ga.ga_len) return NULL; - if (TOLOWER_ASC(what[0]) == 'f') + if (TOLOWER_ASC(what[0]) == 'f' && TOLOWER_ASC(what[1]) == 'g') fg = TRUE; # ifdef FEAT_GUI - else if (TOLOWER_ASC(what[0]) == 's') + else if (TOLOWER_ASC(what[0]) == 'f' && TOLOWER_ASC(what[1]) == 'o' + && TOLOWER_ASC(what[2]) == 'n' && TOLOWER_ASC(what[3]) == 't') + font = TRUE; + else if (TOLOWER_ASC(what[0]) == 's' && TOLOWER_ASC(what[1]) == 'p') sp = TRUE; + else if (!(TOLOWER_ASC(what[0]) == 'b' && TOLOWER_ASC(what[1]) == 'g')) + return NULL; if (modec == 'g') { + /* return font name */ + if (font) + return HL_TABLE()[id - 1].sg_font_name; + /* return #RRGGBB form (only possible when GUI is running) */ - if (gui.in_use && what[1] && what[2] == '#') + if (gui.in_use && what[2] == '#') { guicolor_T color; long_u rgb; @@ -8374,6 +8384,8 @@ highlight_color(id, what, modec) return (HL_TABLE()[id - 1].sg_gui_sp_name); return (HL_TABLE()[id - 1].sg_gui_bg_name); } + if (font || sp) + return NULL; # endif if (modec == 'c') { diff --git a/src/version.c b/src/version.c index b4f67367..c799bd8a 100644 --- a/src/version.c +++ b/src/version.c @@ -682,6 +682,24 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 394, +/**/ + 393, +/**/ + 392, +/**/ + 391, +/**/ + 390, +/**/ + 389, +/**/ + 388, +/**/ + 387, +/**/ + 386, +/**/ 385, /**/ 384, diff --git a/src/vim.h b/src/vim.h index d22227cf..b6b4e1e9 100644 --- a/src/vim.h +++ b/src/vim.h @@ -477,6 +477,23 @@ typedef unsigned long u8char_T; /* long should be 32 bits or more */ # include #endif +# if defined(HAVE_SYS_SELECT_H) && \ + (!defined(HAVE_SYS_TIME_H) || defined(SYS_SELECT_WITH_SYS_TIME)) +# include +# endif + +# ifndef HAVE_SELECT +# ifdef HAVE_SYS_POLL_H +# include +# define HAVE_POLL +# else +# ifdef HAVE_POLL_H +# include +# define HAVE_POLL +# endif +# endif +# endif + /* ================ end of the header file puzzle =============== */ /*