Compare commits

...

16 Commits

Author SHA1 Message Date
Bram Moolenaar
25153e127d updated for version 7.2.371
Problem:    Build problems on Tandem NonStop.
Solution:   A few changes to #ifdefs (Joachim Schmitz)
2010-02-24 14:47:08 +01:00
Bram Moolenaar
f4d7f944ba updated for version 7.2.370
Problem:    A redraw may cause folds to be closed.
Solution:   Revert part of the previous patch.  Add a test. (Lech Lorens)
2010-02-24 14:34:19 +01:00
Bram Moolenaar
54c1b4965b updated for version 7.2.369
Problem:    Error message is not easy to understand.
Solution:   Add quotes. (SungHyun Nam)
2010-02-24 14:01:28 +01:00
Bram Moolenaar
83bac8b756 updated for version 7.2.368
Problem:    Ruby interface: Appending line doesn't work. (Michael Henry)
Solution:   Reverse check for NULL line. (James Vega)
2010-02-18 15:53:29 +01:00
Bram Moolenaar
8a33e74dd2 updated for version 7.2.367
Problem:    "xxd -r -p" doesn't work as documented.
Solution:   Skip white space. (James Vega)
2010-02-17 18:28:41 +01:00
Bram Moolenaar
bacd9da40e updated for version 7.2.366
Problem:    CTRL-B doesn't go back to the first line of the buffer.
Solution:   Avoid an overflow when adding MAXCOL.
2010-02-17 18:20:37 +01:00
Bram Moolenaar
8c83ac3d83 updated for version 7.2.365
Problem:    MS-Windows with MingW: "File->Save As" does not work. (John
            Marriott)
Solution:   Correctly fill in structure size. (Andy Kittner)
2010-02-17 17:34:43 +01:00
Bram Moolenaar
175aa24846 updated for version 7.2.364
Problem:    Can't build gvimext.dll on Win 7 x64 using MinGW (John Marriott)
Solution:   Check if _MSC_VER is defined. (Andy Kittner)
2010-02-17 17:24:27 +01:00
Bram Moolenaar
3a0573acae updated for version 7.2.363
Problem:    Can't dynamically load Perl 5.10.
Solution:   Add the function Perl_croak_xs_usage. (Sergey Khorev)
2010-02-17 16:40:58 +01:00
Bram Moolenaar
33d0b69ab8 updated for version 7.2.362
Problem:    Win64: Vim doesn't work when cross-compiled with MingW libraries.
Solution:   Instead of handling WM_NCCREATE, create wide text area window
            class if the parent window iw side. (Sergey Khorev)
2010-02-17 16:31:32 +01:00
Bram Moolenaar
165641da25 updated for version 7.2.361
Problem:    Ruby 1.9 is not supported.
Solution:   Add Ruby 1.9 support. (Msaki Suketa)
2010-02-17 16:23:09 +01:00
Bram Moolenaar
0b69c73411 updated for version 7.2.360
Problem:    Ruby on MS-Windows: can't use sockets.
Solution:   Call NtInitialize() during initialization. (Ariya Mizutani)
2010-02-17 15:11:50 +01:00
Bram Moolenaar
0ca4b350f0 updated for version 7.2.359
Problem:    Crash when using the Netbeans join command.
Solution:   Make sure the ml_flush_line() function is not used recursively.
            (Xavier de Gaye)
2010-02-11 18:54:43 +01:00
Bram Moolenaar
b4990bf90b updated for version 7.2.358
Problem:    Compiler warnings on VMS. (Zoltan Arpadffy)
Solution:   Pass array itself instead its address.  Return a value.
2010-02-11 18:19:38 +01:00
Bram Moolenaar
0413d48711 updated for version 7.2.357
Problem:    When changing 'fileformat' from/to "mac" and there is a CR in the
            text the display is wrong.
Solution:   Redraw the text when 'fileformat' is changed. (Ben Schmidt)
2010-02-11 17:02:11 +01:00
Bram Moolenaar
6dfc28be25 Updated runtime files. 2010-02-11 14:19:15 +01:00
38 changed files with 555 additions and 150 deletions

View File

@@ -1,10 +1,15 @@
" Vim completion script
" Language: All languages, uses existing syntax highlighting rules
" Maintainer: David Fishburn <dfishburn.vim@gmail.com>
" Version: 4.0
" Last Change: Fri 26 Oct 2007 05:27:03 PM Eastern Daylight Time
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
" Version: 5.0
" Last Change: 2010 Jan 31
" Usage: For detailed help, ":help ft-syntax-omni"
" History
" Version 5.0
" When processing a list of syntax groups, the final group
" was missed in function SyntaxCSyntaxGroupItems.
"
" Set completion with CTRL-X CTRL-O to autoloaded function.
" This check is in place in case this script is
" sourced directly instead of using the autoload feature.
@@ -312,9 +317,13 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
" \zs - start the match
" .\{-} - everything ...
" \ze - end the match
" \( - start a group or 2 potential matches
" \n\w - at the first newline starting with a character
" \| - 2nd potential match
" \%$ - matches end of the file or string
" \) - end a group
let syntax_group = matchstr(a:syntax_full,
\ "\n".a:group_name.'\s\+xxx\s\+\zs.\{-}\ze'."\n".'\w'
\ "\n".a:group_name.'\s\+xxx\s\+\zs.\{-}\ze\(\n\w\|\%$\)'
\ )
if syntax_group != ""

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.2. Last change: 2010 Jan 05
*eval.txt* For Vim version 7.2. Last change: 2010 Jan 19
VIM REFERENCE MANUAL by Bram Moolenaar

View File

@@ -1,4 +1,4 @@
*indent.txt* For Vim version 7.2. Last change: 2009 Nov 12
*indent.txt* For Vim version 7.2. Last change: 2010 Jan 27
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -437,7 +437,7 @@ assume a 'shiftwidth' of 4.
*N Vim searches for unclosed comments at most N lines away. This
limits the time needed to search for the start of a comment.
(default 30 lines).
(default 70 lines).
#N When N is non-zero recognize shell/Perl comments, starting with
'#'. Default N is zero: don't recognizes '#' comments. Note

View File

@@ -482,7 +482,7 @@ example: >
{shellpipe} is the 'shellpipe' option.
{errorfile} is the 'makeef' option, with ## replaced to make it unique.
The placeholder "$*" can be used for the argument list in {makeprog} if the
The placeholder "$*" can be used for the argument list in {makeprg} if the
command needs some additional characters after its arguments. The $* is
replaced then by all arguments. Example: >
:set makeprg=latex\ \\\\nonstopmode\ \\\\input\\{$*}
@@ -1212,7 +1212,7 @@ Maintaining the correct directory is more complicated if you don't use
GNU-make. AIX-make for example doesn't print any information about its
working directory. Then you need to enhance the makefile. In the makefile of
LessTif there is a command which echoes "Making {target} in {dir}". The
special problem here is that it doesn't print informations on leaving the
special problem here is that it doesn't print information on leaving the
directory and that it doesn't print the absolute path.
To solve the problem with relative paths and missing "leave directory"

View File

@@ -340,7 +340,7 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
this to get 'compatible', even though a .vimrc file exists.
Keep in mind that the command ":set nocompatible" in some
plugin or startup script overrules this, so you may end up
with 'nocmpatible' anyway. To find out, use: >
with 'nocompatible' anyway. To find out, use: >
:verbose set compatible?
< Several plugins won't work with 'compatible' set. You may
want to set it after startup this way: >

View File

@@ -6486,11 +6486,13 @@ mysql ft_sql.txt /*mysql*
mysyntaxfile syntax.txt /*mysyntaxfile*
mysyntaxfile-add syntax.txt /*mysyntaxfile-add*
mysyntaxfile-replace syntax.txt /*mysyntaxfile-replace*
mzeval() eval.txt /*mzeval()*
mzscheme if_mzsch.txt /*mzscheme*
mzscheme-buffer if_mzsch.txt /*mzscheme-buffer*
mzscheme-commands if_mzsch.txt /*mzscheme-commands*
mzscheme-dynamic if_mzsch.txt /*mzscheme-dynamic*
mzscheme-examples if_mzsch.txt /*mzscheme-examples*
mzscheme-mzeval if_mzsch.txt /*mzscheme-mzeval*
mzscheme-sandbox if_mzsch.txt /*mzscheme-sandbox*
mzscheme-threads if_mzsch.txt /*mzscheme-threads*
mzscheme-vim if_mzsch.txt /*mzscheme-vim*

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.2. Last change: 2010 Jan 14
*todo.txt* For Vim version 7.2. Last change: 2010 Feb 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -30,49 +30,39 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs*
-------------------- Known bugs and current work -----------------------
Patch from Dominique Pelle, documentation fixes. (2010 Jan 9)
Another patch for README files.
Patch for crash in netbeans on join command. (Xavier de Gaye, 2010 Feb 5)
Patch from Dominique Pelle for buffer reload when fixing spell mistake.
(2010 Jan 14)
Patch for mzscheme docs. (Sergey Khorev, 2010 Jan 29)
Extention for MzScheme interface. (Sergey Khorev, 2009 Dec 21, update Dec 26)
Patch to support netbeans in Unix console Vim. (Xavier de Gaye, 2009 Apr 26)
Now with Mercurial repository (2010 Jan 2)
patch from Sergey Khorev for "*" command escaping. (2010 Jan 5)
Warnings for Python 2.6.4. (Dominique Pelle, 2010 Jan 31)
Patch: :compiler command doesn't function properly when invoked in a function
(Yukihiro Nakadaira)
Patch for better fix for Win64. (Sergey Khorev, 2010 Feb 4)
Patch for error messages. (Dominique Pelle, 2010 Feb 5)
Patch for visual-operators text (Dominique Pelle, 2010 Feb 6)
Patch for Win64 MingW struct size. (Andy Kittner, 2010 Feb 7)
Patch for Perl interface with Perl 5.10. (Sergey Khorev, 2010 Feb 5)
Patch for xxd to support "-r -p" as documented. (James Vega, 2010 Feb 8)
Win32: patch for cross compile xxd and GvimExt. (Markus Heidelberg, 2009 Mar
18) Also update INSTALLpc.txt?
Patch for xxd/Make_cyg.mak. (Chris Sutcliffe, 2009 Jun 10) Included in the
above?
iconv() doesn't fail on an illegal character, as documented. (Yongwei Wu, 2009
Nov 15, example Nov 26) Add argument to specify whether iconv() should fail
or replace with a character and continue?
Problem with window jumping to other screen when changing font. (patch by
Michael Wookey, 2009 Oct 16)
Better: if the window offset was negative before changing something, then
don't change it.
Patch to make CTRL-] work on scheme keywords. (Sergey Khorev, 2010 Jan 5)
Gcc warning for condition that can never be true, fold.c line 3242. (James
Vega, 2010 Jan 13)
Omni menu position one column too far to the right, double-wide chars split to
next line. (Jiang Ma, 2010 Jan 10)
Explicit example from Dominique.
Need to check that the last character fits?
Patch from Dominique Pelle. (2010 Jan 12) One more (2010 Jan 12)
has("win64") returns zero. Patch from Sergey Khorev, 2009 Jan 5.
Or define WIN64 when _WIN64 is defined, change all _WIN64 to WIN64.
Add local time at start of --startuptime output.
Requires configure check for localtime().
Use format year-month-day hr:min:sec.
Patch to support netbeans in Unix console Vim. (Xaview de Gaye, 2009 Apr 26)
Now with Mercurial repository (2010 Jan 2)
Shell not recognized properly if it ends in "csh -f". (James Vega, 2009 Nov 3)
Find tail? Might have a / in argument. Find space? Might have space in
path.
@@ -177,7 +167,7 @@ Problem with <script> mappings (Andy Wokula, 2009 Mar 8)
Patch to support netbeans for Mac. (Kazuki Sakamoto, 2009 Jun 25)
Patch to support clibpoard for Mac terminal. (Jjgod Jiang, 2009 Aug 1)
Patch to support clipboard for Mac terminal. (Jjgod Jiang, 2009 Aug 1)
When starting Vim with "gvim -f -u non_existent_file > foo.txt" there are a
few control characters in the output. (Dale Wiles, 2009 May 28)
@@ -191,6 +181,7 @@ J. Wang, 2009 Mar 31)
Patch for vertical line at certain column position, 'guidecolumn' option.
(Pankaj Garg, 2009 Apr 14, aka Lone, Apr 15)
Update 2009 May 2, 'margincolumn'
Alternative patch. (2010 Feb 2, Gregor Uhlenheuer)
Add different highlighting for a fold line depending on the fold level.
Patch. (Noel Henson, 2009 Sep 13)
@@ -258,11 +249,6 @@ Kondakoff, 2009 May 13)
Win32 GUI: Changing manifest helps for dpi changes (Joe Castro, 2009 Mar 27)
Win32: patch for cross compile xxd and GvimExt. (Markus Heidelberg, 2009 Mar
18) Also update INSTALLpc.txt?
Patch for xxd/Make_cyg.mak. (Chris Sutcliffe, 2009 Jun 10) Included in the
above?
Win32: patch for better font scaling. (George Reilly, 2009 Mar 26)
Win32 GUI: last message from startup doesn't show up when there is an echoerr
@@ -856,6 +842,9 @@ When 'backupskip' is set from $TEMP special characters need to be escaped.
Another problem is that file_pat_to_reg_pat() doesn't recognize "\\", so "\\("
will be seen as a path separator plus "\(".
gvim d:\path\path\(FILE).xml should not remove the \ before the (.
This also fails with --remote.
When doing ":quit" the Netbeans "killed" event isn't sent. (Xavier de Gaye,
2008 Nov 10) call netbeans_file_closed() at the end of buf_freeall(), or in
all places where buf_freeall() is called?
@@ -920,7 +909,7 @@ Win32: When 'autochdir' is on and 'encoding' is changed, files on the command
line are opened again, but from the wrong directory. Apply 'autochdir' only
after starting up?
When showing a diff between a non-existant file and an existing one, with the
When showing a diff between a non-existent file and an existing one, with the
cursor in the empty buffer, the other buffer only shows the last line. Change
the "insert" into a change from one line to many? (Yakov Lerner, 2008 May 27)
@@ -1046,7 +1035,7 @@ visible.
GTK: when setting 'columns' in a startup script and doing ":vertical diffsplit"
the window isn't redrawn properly, see two vertical bars.
GTK: file choser is disabled. Patch by Tim Starling, 2009 Nov 13.
GTK: file chooser is disabled. Patch by Tim Starling, 2009 Nov 13.
The magic clipboard format "VimClipboard2" appears in several places. Should
be only one.
@@ -2315,7 +2304,7 @@ Spell checking:
Is COMPLEXPREFIXES necessary when we have flags for affixes?
- Support spelling words in CamelCase as if they were two separate words.
Requires some option to enable it. (Timothy Knox)
- There is no Finnish spell checking file. For openoffic Voikko is now
- There is no Finnish spell checking file. For openoffice Voikko is now
used, which is based on Malaga: http://home.arcor.de/bjoern-beutel/malaga/
(Teemu Likonen)
8 ":mkspell" still takes much too long in Hungarian dictionary from

View File

@@ -11170,7 +11170,7 @@ Files: runtime/doc/help.txt, runtime/doc/sponsor.txt, runtime/doc/tags,
runtime/menu.vim, src/version.c
Patch 6.2.192
Problem: Using CTRL-T and CTRL-D with "gR" messes up the text. (Jonahtan
Problem: Using CTRL-T and CTRL-D with "gR" messes up the text. (Jonathan
Hankins)
Solution: Avoid calling change_indent() recursively.
Files: src/edit.c

View File

@@ -4734,7 +4734,7 @@ New keymap files:
Other new runtime files:
Esperanto menu and message translations. (Dominique Pelle)
Finnish menu and message translations. (Flammie Pirinen)
Brazilian Portugese message translations. (Eduardo Dobay)
Brazilian Portuguese message translations. (Eduardo Dobay)
Added floating point support. |Float|
@@ -4925,7 +4925,7 @@ Files: src/fileio.c, src/os_unix.h
Patch 7.1.028
Problem: Can't use last search pattern for ":sort". (Brian McKee)
Solution: When the pattern is emtpy use the last search pattern. (Martin
Solution: When the pattern is empty use the last search pattern. (Martin
Toft)
Files: runtime/doc/change.txt, src/ex_cmds.c
@@ -5463,7 +5463,7 @@ Solution: Remove the replacement with a question mark when UNICODE16 is not
Files: src/screen.c
Patch 7.1.117
Problem: Can't check wether Vim was compiled with Gnome. (Tony Mechelynck)
Problem: Can't check whether Vim was compiled with Gnome. (Tony Mechelynck)
Solution: Add gui_gnome to the has() list.
Files: src/eval.c

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" Language: indent(1) configuration file
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2007-06-17
" Latest Revision: 2010-01-23
" indent_is_bsd: If exists, will change somewhat to match BSD implementation
"
" TODO: is the deny-all (a la lilo.vim nice or no?)...
@@ -27,7 +27,7 @@ syn region indentComment start='//' skip='\\$' end='$'
\ contains=indentTodo,@Spell
if !exists("indent_is_bsd")
syn match indentOptions '-i\|--indentation-level'
syn match indentOptions '-i\|--indentation-level\|-il\|--indent-level'
\ nextgroup=indentNumber skipwhite skipempty
endif
syn match indentOptions '-\%(bli\|c\%([bl]i\|[dip]\)\=\|di\=\|ip\=\|lc\=\|pp\=i\|sbi\|ts\|-\%(brace-indent\|comment-indentation\|case-brace-indentation\|declaration-comment-column\|continuation-indentation\|case-indentation\|else-endif-column\|line-comments-indentation\|declaration-indentation\|indent-level\|parameter-indentation\|line-length\|comment-line-length\|paren-indentation\|preprocessor-indentation\|struct-brace-indentation\|tab-size\)\)'
@@ -123,6 +123,7 @@ syn keyword indentOptions -bacc --blank-lines-after-ifdefs
\ -ut --use-tabs
\ -v --verbose
\ -version --version
\ -linux --linux-style
if exists("indent_is_bsd")
syn keyword indentOptions -ip -ei -nei

View File

@@ -1,8 +1,8 @@
" Vim syntax file
" Language: lilo configuration (lilo.conf)
" Maintainer: help wanted!
" Maintainer: Niels Horn <niels.horn@gmail.com>
" Previous Maintainer: David Necas (Yeti) <yeti@physics.muni.cz>
" Last Change: 2009-01-27
" Last Change: 2010-02-03
" Setup
if version >= 600

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" Language: reStructuredText documentation format
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2009-05-25
" Latest Revision: 2010-01-23
if exists("b:current_syntax")
finish
@@ -137,7 +137,7 @@ syn match rstStandaloneHyperlink contains=@NoSpell
" TODO: Use better syncing. I dont know the specifics of syncing well enough,
" though.
syn sync minlines=50
syn sync minlines=50 linebreaks=1
hi def link rstTodo Todo
hi def link rstComment Comment

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Zsh shell script
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-17
" Latest Revision: 2010-01-23
if exists("b:current_syntax")
finish
@@ -14,7 +14,7 @@ setlocal iskeyword+=-
syn keyword zshTodo contained TODO FIXME XXX NOTE
syn region zshComment display oneline start='\%(^\|\s\)#' end='$'
syn region zshComment oneline start='\%(^\|\s\)#' end='$'
\ contains=zshTodo,@Spell
syn match zshPreProc '^\%1l#\%(!\|compdef\|autoload\).*$'

View File

@@ -14,9 +14,9 @@
#if !defined(AFX_STDAFX_H__3389658B_AD83_11D3_9C1E_0090278BBD99__INCLUDED_)
#define AFX_STDAFX_H__3389658B_AD83_11D3_9C1E_0090278BBD99__INCLUDED_
#if _MSC_VER > 1000
#if defined(_MSC_VER) && _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#endif
// Insert your headers here
// #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
@@ -34,7 +34,7 @@
#define INC_OLE2 // WIN32, get ole2 from windows.h
/* Visual Studio 2005 has 'deprecated' many of the standard CRT functions */
#if _MSC_VER >= 1400
#if defined(_MSC_VER) && _MSC_VER >= 1400
# define _CRT_SECURE_NO_DEPRECATE
# define _CRT_NONSTDC_NO_DEPRECATE
#endif
@@ -44,7 +44,7 @@
#include <shlobj.h>
/* Accommodate old versions of VC that don't have a modern Platform SDK */
#if _MSC_VER < 1300
#if defined(_MSC_VER) && _MSC_VER < 1300
# undef UINT_PTR
# define UINT_PTR UINT
#endif

View File

@@ -395,7 +395,9 @@ CClink = $(CC)
# RUBY
# Uncomment this when you want to include the Ruby interface.
#CONF_OPT_RUBY = --enable-rubyinterp
# Note: you need the development package (e.g., ruby1.9.1-dev on Ubuntu).
# CONF_OPT_RUBY = --enable-rubyinterp
# CONF_OPT_RUBY = --enable-rubyinterp --with-ruby-command=ruby1.9.1
# MZSCHEME
# Uncomment this when you want to include the MzScheme interface.

166
src/auto/configure vendored
View File

@@ -793,6 +793,7 @@ with_python_config_dir
enable_tclinterp
with_tclsh
enable_rubyinterp
with_ruby_command
enable_cscope
enable_workshop
enable_netbeans
@@ -1503,6 +1504,7 @@ Optional Packages:
--with-plthome=PLTHOME Use PLTHOME.
--with-python-config-dir=PATH Python's config directory
--with-tclsh=PATH which tclsh to use (default: tclsh8.0)
--with-ruby-command=RUBY name of the Ruby command (default: ruby)
--with-x use the X Window System
--with-gtk-prefix=PFX Prefix where GTK is installed (optional)
--with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)
@@ -5703,9 +5705,21 @@ fi
{ $as_echo "$as_me:$LINENO: result: $enable_rubyinterp" >&5
$as_echo "$enable_rubyinterp" >&6; }
if test "$enable_rubyinterp" = "yes"; then
{ $as_echo "$as_me:$LINENO: checking --with-ruby-command argument" >&5
$as_echo_n "checking --with-ruby-command argument... " >&6; }
# Extract the first word of "ruby", so it can be a program name with args.
set dummy ruby; ac_word=$2
# Check whether --with-ruby-command was given.
if test "${with_ruby_command+set}" = set; then
withval=$with_ruby_command; RUBY_CMD="$withval"; { $as_echo "$as_me:$LINENO: result: $RUBY_CMD" >&5
$as_echo "$RUBY_CMD" >&6; }
else
RUBY_CMD="ruby"; { $as_echo "$as_me:$LINENO: result: defaulting to $RUBY_CMD" >&5
$as_echo "defaulting to $RUBY_CMD" >&6; }
fi
# Extract the first word of "$RUBY_CMD", so it can be a program name with args.
set dummy $RUBY_CMD; 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_vi_cv_path_ruby+set}" = set; then
@@ -5752,11 +5766,17 @@ $as_echo_n "checking Ruby version... " >&6; }
$as_echo "OK" >&6; }
{ $as_echo "$as_me:$LINENO: checking Ruby header files" >&5
$as_echo_n "checking Ruby header files... " >&6; }
rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG["archdir"] || $hdrdir' 2>/dev/null`
rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG["rubyhdrdir"] || Config::CONFIG["archdir"] || $hdrdir' 2>/dev/null`
if test "X$rubyhdrdir" != "X"; then
{ $as_echo "$as_me:$LINENO: result: $rubyhdrdir" >&5
$as_echo "$rubyhdrdir" >&6; }
RUBY_CFLAGS="-I$rubyhdrdir"
rubyarch=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["arch"]'`
if test -d "$rubyhdrdir/$rubyarch"; then
RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyhdrdir/$rubyarch"
fi
rubyversion=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["ruby_version"].gsub(/\./, "")[0,2]'`
RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion"
rubylibs=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["LIBS"]'`
if test "X$rubylibs" != "X"; then
RUBY_LIBS="$rubylibs"
@@ -5793,8 +5813,8 @@ $as_echo "$rubyhdrdir" >&6; }
_ACEOF
else
{ $as_echo "$as_me:$LINENO: result: not found" >&5
$as_echo "not found" >&6; }
{ $as_echo "$as_me:$LINENO: result: not found; disabling Ruby" >&5
$as_echo "not found; disabling Ruby" >&6; }
fi
else
{ $as_echo "$as_me:$LINENO: result: too old; need Ruby version 1.6.0 or later" >&5
@@ -14018,9 +14038,7 @@ fi
for ac_func in bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \
for ac_func in bcmp fchdir fchown fsync getcwd getpseudotty \
getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
@@ -14126,6 +14144,138 @@ _ACEOF
fi
done
{ $as_echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5
$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
if test "${ac_cv_sys_largefile_source+set}" = set; then
$as_echo_n "(cached) " >&6
else
while :; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h> /* for off_t */
#include <stdio.h>
int
main ()
{
int (*fp) (FILE *, off_t, int) = fseeko;
return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_sys_largefile_source=no; break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#define _LARGEFILE_SOURCE 1
#include <sys/types.h> /* for off_t */
#include <stdio.h>
int
main ()
{
int (*fp) (FILE *, off_t, int) = fseeko;
return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_sys_largefile_source=1; break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
ac_cv_sys_largefile_source=unknown
break
done
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5
$as_echo "$ac_cv_sys_largefile_source" >&6; }
case $ac_cv_sys_largefile_source in #(
no | unknown) ;;
*)
cat >>confdefs.h <<_ACEOF
#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
_ACEOF
;;
esac
rm -rf conftest*
# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
# in glibc 2.1.3, but that breaks too many other things.
# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
if test $ac_cv_sys_largefile_source != unknown; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_FSEEKO 1
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for st_blksize" >&5
$as_echo_n "checking for st_blksize... " >&6; }

View File

@@ -144,7 +144,6 @@
#undef HAVE_FCHOWN
#undef HAVE_FSEEKO
#undef HAVE_FSYNC
#undef HAVE_FTELLO
#undef HAVE_GETCWD
#undef HAVE_GETPSEUDOTTY
#undef HAVE_GETPWNAM

View File

@@ -949,17 +949,27 @@ AC_ARG_ENABLE(rubyinterp,
[enable_rubyinterp="no"])
AC_MSG_RESULT($enable_rubyinterp)
if test "$enable_rubyinterp" = "yes"; then
AC_MSG_CHECKING(--with-ruby-command argument)
AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)],
RUBY_CMD="$withval"; AC_MSG_RESULT($RUBY_CMD),
RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD))
AC_SUBST(vi_cv_path_ruby)
AC_PATH_PROG(vi_cv_path_ruby, ruby)
AC_PATH_PROG(vi_cv_path_ruby, $RUBY_CMD)
if test "X$vi_cv_path_ruby" != "X"; then
AC_MSG_CHECKING(Ruby version)
if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then
AC_MSG_RESULT(OK)
AC_MSG_CHECKING(Ruby header files)
rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG[["archdir"]] || $hdrdir' 2>/dev/null`
rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG[["rubyhdrdir"]] || Config::CONFIG[["archdir"]] || $hdrdir' 2>/dev/null`
if test "X$rubyhdrdir" != "X"; then
AC_MSG_RESULT($rubyhdrdir)
RUBY_CFLAGS="-I$rubyhdrdir"
rubyarch=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["arch"]]'`
if test -d "$rubyhdrdir/$rubyarch"; then
RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyhdrdir/$rubyarch"
fi
rubyversion=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["ruby_version"]].gsub(/\./, "")[[0,2]]'`
RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion"
rubylibs=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LIBS"]]'`
if test "X$rubylibs" != "X"; then
RUBY_LIBS="$rubylibs"
@@ -997,7 +1007,7 @@ if test "$enable_rubyinterp" = "yes"; then
RUBY_PRO="if_ruby.pro"
AC_DEFINE(FEAT_RUBY)
else
AC_MSG_RESULT(not found, disabling Ruby)
AC_MSG_RESULT(not found; disabling Ruby)
fi
else
AC_MSG_RESULT(too old; need Ruby version 1.6.0 or later)
@@ -2632,14 +2642,16 @@ if test "x$vim_cv_getcwd_broken" = "xyes" ; then
AC_DEFINE(BAD_GETCWD)
fi
dnl Check for functions in one big call, to reduce the size of configure
AC_CHECK_FUNCS(bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \
dnl Check for functions in one big call, to reduce the size of configure.
dnl Can only be used for functions that do not require any include.
AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \
getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
sigvec strcasecmp strerror strftime stricmp strncasecmp \
strnicmp strpbrk strtol tgetent towlower towupper iswupper \
usleep utime utimes)
AC_FUNC_FSEEKO
dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
AC_MSG_CHECKING(for st_blksize)

View File

@@ -1117,26 +1117,31 @@ diff_win_options(wp, addbuf)
win_T *wp;
int addbuf; /* Add buffer to diff. */
{
# ifdef FEAT_FOLDING
win_T *old_curwin = curwin;
/* close the manually opened folds */
curwin = wp;
newFoldLevel();
curwin = old_curwin;
# endif
wp->w_p_diff = TRUE;
wp->w_p_scb = TRUE;
wp->w_p_wrap = FALSE;
# ifdef FEAT_FOLDING
{
win_T *old_curwin = curwin;
curwin = wp;
curbuf = curwin->w_buffer;
set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff",
curwin = wp;
curbuf = curwin->w_buffer;
set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff",
OPT_LOCAL|OPT_FREE, 0);
curwin = old_curwin;
curbuf = curwin->w_buffer;
wp->w_p_fdc = diff_foldcolumn;
wp->w_p_fen = TRUE;
wp->w_p_fdl = 0;
foldUpdateAll(wp);
/* make sure topline is not halfway a fold */
changed_window_setting_win(wp);
}
curwin = old_curwin;
curbuf = curwin->w_buffer;
wp->w_p_fdc = diff_foldcolumn;
wp->w_p_fen = TRUE;
wp->w_p_fdl = 0;
foldUpdateAll(wp);
/* make sure topline is not halfway a fold */
changed_window_setting_win(wp);
# endif
#ifdef FEAT_SCROLLBIND
if (vim_strchr(p_sbo, 'h') == NULL)

View File

@@ -1092,7 +1092,7 @@ ex_profile(eap)
set_vim_var_nr(VV_PROFILING, 1L);
}
else if (do_profiling == PROF_NONE)
EMSG(_("E750: First use :profile start <fname>"));
EMSG(_("E750: First use \":profile start {fname}\""));
else if (STRCMP(eap->arg, "pause") == 0)
{
if (do_profiling == PROF_YES)

View File

@@ -854,12 +854,6 @@ foldUpdate(wp, top, bot)
&& fp->fd_top < bot)
{
fp->fd_small = MAYBE;
/* Not sure if this is the right place to reset fd_flags (suggested by
* Lech Lorens). */
if (wp->w_foldinvalid)
fp->fd_flags = FD_LEVEL;
++fp;
}

View File

@@ -6190,7 +6190,7 @@ gui_mch_draw_string(int row, int col, char_u *s, int len, int flags)
int pcc[MAX_MCO];
/* TODO: use the composing characters */
c = utfc_ptr2char_len(p, &pcc, len - (p - s));
c = utfc_ptr2char_len(p, pcc, len - (p - s));
if (c >= 0x10000) /* show chars > 0xffff as ? */
c = 0xbf;
buf[textlen].byte1 = c >> 8;

View File

@@ -1329,6 +1329,7 @@ gui_mch_init(void)
WNDCLASS wndclass;
#ifdef FEAT_MBYTE
const WCHAR szVimWndClassW[] = VIM_CLASSW;
const WCHAR szTextAreaClassW[] = L"VimTextArea";
WNDCLASSW wndclassw;
#endif
#ifdef GLOBAL_IME
@@ -1479,6 +1480,28 @@ gui_mch_init(void)
#endif
/* Create the text area window */
#ifdef FEAT_MBYTE
if (wide_WindowProc)
{
if (GetClassInfoW(s_hinst, szTextAreaClassW, &wndclassw) == 0)
{
wndclassw.style = CS_OWNDC;
wndclassw.lpfnWndProc = _TextAreaWndProc;
wndclassw.cbClsExtra = 0;
wndclassw.cbWndExtra = 0;
wndclassw.hInstance = s_hinst;
wndclassw.hIcon = NULL;
wndclassw.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclassw.hbrBackground = NULL;
wndclassw.lpszMenuName = NULL;
wndclassw.lpszClassName = szTextAreaClassW;
if (RegisterClassW(&wndclassw) == 0)
return FAIL;
}
}
else
#endif
if (GetClassInfo(s_hinst, szTextAreaClass, &wndclass) == 0)
{
wndclass.style = CS_OWNDC;

View File

@@ -1084,13 +1084,6 @@ _TextAreaWndProc(
case WM_NOTIFY: Handle_WM_Notify(hwnd, (LPNMHDR)lParam);
return TRUE;
#endif
/* Workaround for the problem that MyWindowProc() returns FALSE on 64
* bit windows when cross-compiled using Mingw libraries. (Andy
* Kittner) */
case WM_NCCREATE:
MyWindowProc(hwnd, uMsg, wParam, lParam);
return TRUE;
default:
return MyWindowProc(hwnd, uMsg, wParam, lParam);
}
@@ -3352,7 +3345,7 @@ gui_mch_browseW(
#ifdef OPENFILENAME_SIZE_VERSION_400
/* be compatible with Windows NT 4.0 */
/* TODO: what to use for OPENFILENAMEW??? */
fileStruct.lStructSize = sizeof(OPENFILENAME_SIZE_VERSION_400);
fileStruct.lStructSize = OPENFILENAME_SIZE_VERSION_400;
#else
fileStruct.lStructSize = sizeof(fileStruct);
#endif
@@ -3513,7 +3506,7 @@ gui_mch_browse(
memset(&fileStruct, 0, sizeof(OPENFILENAME));
#ifdef OPENFILENAME_SIZE_VERSION_400
/* be compatible with Windows NT 4.0 */
fileStruct.lStructSize = sizeof(OPENFILENAME_SIZE_VERSION_400);
fileStruct.lStructSize = OPENFILENAME_SIZE_VERSION_400;
#else
fileStruct.lStructSize = sizeof(fileStruct);
#endif

View File

@@ -2278,7 +2278,11 @@ cs_release_csp(i, freefnpp)
/* Use sigaction() to limit the waiting time to two seconds. */
sigemptyset(&sa.sa_mask);
sa.sa_handler = sig_handler;
# ifdef SA_NODEFER
sa.sa_flags = SA_NODEFER;
# else
sa.sa_flags = 0;
# endif
sigaction(SIGALRM, &sa, &old);
alarm(2); /* 2 sec timeout */

View File

@@ -93,6 +93,9 @@ EXTERN_C void boot_DynaLoader __ARGS((pTHX_ CV*));
# define perl_free dll_perl_free
# define Perl_get_context dll_Perl_get_context
# define Perl_croak dll_Perl_croak
# if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
# define Perl_croak_xs_usage dll_Perl_croak_xs_usage
# endif
# ifndef PROTO
# define Perl_croak_nocontext dll_Perl_croak_nocontext
# define Perl_call_argv dll_Perl_call_argv
@@ -202,6 +205,9 @@ static int (*perl_run)(PerlInterpreter*);
static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**);
static void* (*Perl_get_context)(void);
static void (*Perl_croak)(pTHX_ const char*, ...);
#if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
static void (*Perl_croak_xs_usage)(pTHX_ const CV *const, const char *const params);
#endif
static void (*Perl_croak_nocontext)(const char*, ...);
static I32 (*Perl_dowantarray)(pTHX);
static void (*Perl_free_tmps)(pTHX);
@@ -306,6 +312,9 @@ static struct {
{"perl_parse", (PERL_PROC*)&perl_parse},
{"Perl_get_context", (PERL_PROC*)&Perl_get_context},
{"Perl_croak", (PERL_PROC*)&Perl_croak},
#if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
{"Perl_croak_xs_usage", (PERL_PROC*)&Perl_croak_xs_usage},
#endif
{"Perl_croak_nocontext", (PERL_PROC*)&Perl_croak_nocontext},
{"Perl_dowantarray", (PERL_PROC*)&Perl_dowantarray},
{"Perl_free_tmps", (PERL_PROC*)&Perl_free_tmps},

View File

@@ -48,7 +48,15 @@
# endif
#endif
/* suggested by Ariya Mizutani */
#if (_MSC_VER == 1200)
# undef _WIN32_WINNT
#endif
#include <ruby.h>
#if defined(RUBY_VERSION) && RUBY_VERSION >= 19
# include <ruby/encoding.h>
#endif
#undef EXTERN
#undef _
@@ -60,6 +68,28 @@
# define __OPENTRANSPORTPROVIDERS__
#endif
/*
* Backward compatiblity for Ruby 1.8 and earlier.
* Ruby 1.9 does not provide STR2CSTR, instead StringValuePtr is provided.
* Ruby 1.9 does not provide RXXX(s)->len and RXXX(s)->ptr, instead
* RXXX_LEN(s) and RXXX_PTR(s) are provided.
*/
#ifndef StringValuePtr
# define StringValuePtr(s) STR2CSTR(s)
#endif
#ifndef RARRAY_LEN
# define RARRAY_LEN(s) RARRAY(s)->len
#endif
#ifndef RARRAY_PTR
# define RARRAY_PTR(s) RARRAY(s)->ptr
#endif
#ifndef RSTRING_LEN
# define RSTRING_LEN(s) RSTRING(s)->len
#endif
#ifndef RSTRING_PTR
# define RSTRING_PTR(s) RSTRING(s)->ptr
#endif
#include "vim.h"
#include "version.h"
@@ -129,13 +159,26 @@ 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
#define ruby_errinfo (*dll_ruby_errinfo)
#if defined(RUBY_VERSION) && RUBY_VERSION >= 19
# define rb_errinfo dll_rb_errinfo
#else
# define ruby_errinfo (*dll_ruby_errinfo)
#endif
#define ruby_init dll_ruby_init
#define ruby_init_loadpath dll_ruby_init_loadpath
#define NtInitialize dll_NtInitialize
#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
# define rb_w32_snprintf dll_rb_w32_snprintf
#endif
#if defined(RUBY_VERSION) && RUBY_VERSION >= 19
# define ruby_script dll_ruby_script
# define rb_enc_find_index dll_rb_enc_find_index
# define rb_enc_find dll_rb_enc_find
# define rb_enc_str_new dll_rb_enc_str_new
# define rb_sprintf dll_rb_sprintf
#endif
/*
* Pointers for dynamic link
*/
@@ -183,13 +226,26 @@ 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
static VALUE (*dll_rb_errinfo) (void);
#else
static VALUE *dll_ruby_errinfo;
#endif
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 int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...);
#endif
#if defined(RUBY_VERSION) && RUBY_VERSION >= 19
static void (*dll_ruby_script) (const char*);
static int (*dll_rb_enc_find_index) (const char*);
static rb_encoding* (*dll_rb_enc_find) (const char*);
static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*);
static VALUE (*dll_rb_sprintf) (const char*, ...);
#endif
static HINSTANCE hinstRuby = 0; /* Instance of ruby.dll */
/*
@@ -245,11 +301,23 @@ 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
{"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 >= 18
{"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf},
#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},
{"rb_enc_find", (RUBY_PROC*)&dll_rb_enc_find},
{"rb_enc_str_new", (RUBY_PROC*)&dll_rb_enc_str_new},
{"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf},
#endif
{"", NULL},
};
@@ -340,6 +408,58 @@ void ex_ruby(exarg_T *eap)
vim_free(script);
}
/*
* In Ruby 1.9 or later, ruby String object has encoding.
* conversion buffer string of vim to ruby String object using
* VIM encoding option.
*/
static VALUE
vim_str2rb_enc_str(const char *s)
{
#if defined(RUBY_VERSION) && RUBY_VERSION >= 19
int isnum;
long lval;
char_u *sval;
rb_encoding *enc;
isnum = get_option_value((char_u *)"enc", &lval, &sval, 0);
if (isnum == 0)
{
enc = rb_enc_find((char *)sval);
vim_free(sval);
if (enc) {
return rb_enc_str_new(s, strlen(s), enc);
}
}
#endif
return rb_str_new2(s);
}
static VALUE
eval_enc_string_protect(const char *str, int *state)
{
#if defined(RUBY_VERSION) && RUBY_VERSION >= 19
int isnum;
long lval;
char_u *sval;
rb_encoding *enc;
VALUE v;
isnum = get_option_value((char_u *)"enc", &lval, &sval, 0);
if (isnum == 0)
{
enc = rb_enc_find((char *)sval);
vim_free(sval);
if (enc)
{
v = rb_sprintf("#-*- coding:%s -*-\n%s", rb_enc_name(enc), str);
return rb_eval_string_protect(StringValuePtr(v), state);
}
}
#endif
return rb_eval_string_protect(str, state);
}
void ex_rubydo(exarg_T *eap)
{
int state;
@@ -352,9 +472,9 @@ void ex_rubydo(exarg_T *eap)
for (i = eap->line1; i <= eap->line2; i++) {
VALUE line, oldline;
line = oldline = rb_str_new2((char *)ml_get(i));
line = oldline = vim_str2rb_enc_str((char *)ml_get(i));
rb_lastline_set(line);
rb_eval_string_protect((char *) eap->arg, &state);
eval_enc_string_protect((char *) eap->arg, &state);
if (state) {
error_print(state);
break;
@@ -365,7 +485,7 @@ void ex_rubydo(exarg_T *eap)
EMSG(_("E265: $_ must be an instance of String"));
return;
}
ml_replace(i, (char_u *) STR2CSTR(line), 1);
ml_replace(i, (char_u *) StringValuePtr(line), 1);
changed();
#ifdef SYNTAX_HL
syn_changed(i); /* recompute syntax hl. for this line */
@@ -413,10 +533,25 @@ static int ensure_ruby_initialized(void)
#ifdef DYNAMIC_RUBY
if (ruby_enabled(TRUE))
{
#endif
#ifdef _WIN32
/* suggested by Ariya Mizutani */
int argc = 1;
char *argv[] = {"gvim.exe"};
NtInitialize(&argc, &argv);
#endif
#if defined(RUBY_VERSION) && RUBY_VERSION >= 19
RUBY_INIT_STACK;
#endif
ruby_init();
#if defined(RUBY_VERSION) && RUBY_VERSION >= 19
ruby_script("vim-ruby");
#endif
ruby_init_loadpath();
ruby_io_init();
#if defined(RUBY_VERSION) && RUBY_VERSION >= 19
rb_enc_find_index("encdb");
#endif
ruby_vim_init();
ruby_initialized = 1;
#ifdef DYNAMIC_RUBY
@@ -434,7 +569,9 @@ static int ensure_ruby_initialized(void)
static void error_print(int state)
{
#ifndef DYNAMIC_RUBY
#if !(defined(RUBY_VERSION) && RUBY_VERSION >= 19)
RUBYEXTERN VALUE ruby_errinfo;
#endif
#endif
VALUE eclass;
VALUE einfo;
@@ -468,9 +605,14 @@ static void error_print(int state)
break;
case TAG_RAISE:
case TAG_FATAL:
#if defined(RUBY_VERSION) && RUBY_VERSION >= 19
eclass = CLASS_OF(rb_errinfo());
einfo = rb_obj_as_string(rb_errinfo());
#else
eclass = CLASS_OF(ruby_errinfo);
einfo = rb_obj_as_string(ruby_errinfo);
if (eclass == rb_eRuntimeError && RSTRING(einfo)->len == 0) {
#endif
if (eclass == rb_eRuntimeError && RSTRING_LEN(einfo) == 0) {
EMSG(_("E272: unhandled exception"));
}
else {
@@ -479,7 +621,7 @@ static void error_print(int state)
epath = rb_class_path(eclass);
vim_snprintf(buff, BUFSIZ, "%s: %s",
RSTRING(epath)->ptr, RSTRING(einfo)->ptr);
RSTRING_PTR(epath), RSTRING_PTR(einfo));
p = strchr(buff, '\n');
if (p) *p = '\0';
EMSG(buff);
@@ -497,8 +639,8 @@ static VALUE vim_message(VALUE self UNUSED, VALUE str)
char *buff, *p;
str = rb_obj_as_string(str);
buff = ALLOCA_N(char, RSTRING(str)->len);
strcpy(buff, RSTRING(str)->ptr);
buff = ALLOCA_N(char, RSTRING_LEN(str));
strcpy(buff, RSTRING_PTR(str));
p = strchr(buff, '\n');
if (p) *p = '\0';
MSG(buff);
@@ -507,21 +649,21 @@ static VALUE vim_message(VALUE self UNUSED, VALUE str)
static VALUE vim_set_option(VALUE self UNUSED, VALUE str)
{
do_set((char_u *)STR2CSTR(str), 0);
do_set((char_u *)StringValuePtr(str), 0);
update_screen(NOT_VALID);
return Qnil;
}
static VALUE vim_command(VALUE self UNUSED, VALUE str)
{
do_cmdline_cmd((char_u *)STR2CSTR(str));
do_cmdline_cmd((char_u *)StringValuePtr(str));
return Qnil;
}
static VALUE vim_evaluate(VALUE self UNUSED, VALUE str)
{
#ifdef FEAT_EVAL
char_u *value = eval_to_string((char_u *)STR2CSTR(str), NULL, TRUE);
char_u *value = eval_to_string((char_u *)StringValuePtr(str), NULL, TRUE);
if (value != NULL)
{
@@ -626,9 +768,9 @@ static VALUE get_buffer_line(buf_T *buf, linenr_T n)
if (n > 0 && n <= buf->b_ml.ml_line_count)
{
char *line = (char *)ml_get_buf(buf, n, FALSE);
return line ? rb_str_new2(line) : Qnil;
return line ? vim_str2rb_enc_str(line) : Qnil;
}
rb_raise(rb_eIndexError, "index %d out of buffer", n);
rb_raise(rb_eIndexError, "line number %ld out of range", (long)n);
#ifndef __GNUC__
return Qnil; /* For stop warning */
#endif
@@ -645,7 +787,7 @@ static VALUE buffer_aref(VALUE self, VALUE num)
static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str)
{
char *line = STR2CSTR(str);
char *line = StringValuePtr(str);
aco_save_T aco;
if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL)
@@ -669,7 +811,7 @@ static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str)
}
else
{
rb_raise(rb_eIndexError, "index %d out of buffer", n);
rb_raise(rb_eIndexError, "line number %ld out of range", (long)n);
#ifndef __GNUC__
return Qnil; /* For stop warning */
#endif
@@ -715,7 +857,7 @@ static VALUE buffer_delete(VALUE self, VALUE num)
}
else
{
rb_raise(rb_eIndexError, "index %d out of buffer", n);
rb_raise(rb_eIndexError, "line number %ld out of range", n);
}
return Qnil;
}
@@ -723,11 +865,14 @@ static VALUE buffer_delete(VALUE self, VALUE num)
static VALUE buffer_append(VALUE self, VALUE num, VALUE str)
{
buf_T *buf = get_buf(self);
char *line = STR2CSTR(str);
char *line = StringValuePtr(str);
long n = NUM2LONG(num);
aco_save_T aco;
if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL)
if (line == NULL) {
rb_raise(rb_eIndexError, "NULL line");
}
else if (n >= 0 && n <= buf->b_ml.ml_line_count)
{
/* set curwin/curbuf for "buf" and save some things */
aucmd_prepbuf(&aco, buf);
@@ -749,7 +894,7 @@ static VALUE buffer_append(VALUE self, VALUE num, VALUE str)
update_curbuf(NOT_VALID);
}
else {
rb_raise(rb_eIndexError, "index %d out of buffer", n);
rb_raise(rb_eIndexError, "line number %ld out of range", n);
}
return str;
}
@@ -890,10 +1035,10 @@ static VALUE window_set_cursor(VALUE self, VALUE pos)
win_T *win = get_win(self);
Check_Type(pos, T_ARRAY);
if (RARRAY(pos)->len != 2)
if (RARRAY_LEN(pos) != 2)
rb_raise(rb_eArgError, "array length must be 2");
lnum = RARRAY(pos)->ptr[0];
col = RARRAY(pos)->ptr[1];
lnum = RARRAY_PTR(pos)[0];
col = RARRAY_PTR(pos)[1];
win->w_cursor.lnum = NUM2LONG(lnum);
win->w_cursor.col = NUM2UINT(col);
check_cursor(); /* put cursor on an existing line */
@@ -910,7 +1055,7 @@ static VALUE f_p(int argc, VALUE *argv, VALUE self UNUSED)
if (i > 0) rb_str_cat(str, ", ", 2);
rb_str_concat(str, rb_inspect(argv[i]));
}
MSG(RSTRING(str)->ptr);
MSG(RSTRING_PTR(str));
return Qnil;
}

View File

@@ -3087,12 +3087,19 @@ ml_flush_line(buf)
int start;
int count;
int i;
static int entered = FALSE;
if (buf->b_ml.ml_line_lnum == 0 || buf->b_ml.ml_mfp == NULL)
return; /* nothing to do */
if (buf->b_ml.ml_flags & ML_LINE_DIRTY)
{
/* This code doesn't work recursively, but Netbeans may call back here
* when obtaining the cursor position. */
if (entered)
return;
entered = TRUE;
lnum = buf->b_ml.ml_line_lnum;
new_line = buf->b_ml.ml_line_ptr;
@@ -3160,6 +3167,8 @@ ml_flush_line(buf)
}
}
vim_free(new_line);
entered = FALSE;
}
buf->b_ml.ml_line_lnum = 0;

View File

@@ -1610,7 +1610,7 @@ scrollup_clamp()
* Add one line above "lp->lnum". This can be a filler line, a closed fold or
* a (wrapped) text line. Uses and sets "lp->fill".
* Returns the height of the added line in "lp->height".
* Lines above the first one are incredibly high.
* Lines above the first one are incredibly high: MAXCOL.
*/
static void
topline_back(lp)
@@ -1942,7 +1942,7 @@ scroll_cursor_bot(min_scroll, set_topbot)
{
loff.lnum = curwin->w_topline;
topline_back(&loff);
if (used + loff.height > curwin->w_height)
if (loff.height == MAXCOL || used + loff.height > curwin->w_height)
break;
used += loff.height;
#ifdef FEAT_DIFF
@@ -2021,7 +2021,10 @@ scroll_cursor_bot(min_scroll, set_topbot)
/* Add one line above */
topline_back(&loff);
used += loff.height;
if (loff.height == MAXCOL)
used = MAXCOL;
else
used += loff.height;
if (used > curwin->w_height)
break;
if (loff.lnum >= curwin->w_botline
@@ -2175,7 +2178,10 @@ scroll_cursor_halfway(atend)
if (below > above) /* add a line above the cursor */
{
topline_back(&loff);
used += loff.height;
if (loff.height == MAXCOL)
used = MAXCOL;
else
used += loff.height;
if (used > curwin->w_height)
break;
above += loff.height;
@@ -2472,9 +2478,12 @@ onepage(dir, count)
while (n <= curwin->w_height && loff.lnum >= 1)
{
topline_back(&loff);
n += loff.height;
if (loff.height == MAXCOL)
n = MAXCOL;
else
n += loff.height;
}
if (n <= curwin->w_height) /* at begin of file */
if (loff.lnum < 1) /* at begin of file */
{
curwin->w_topline = 1;
#ifdef FEAT_DIFF

View File

@@ -5867,6 +5867,10 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
#endif
/* update flag in swap file */
ml_setflags(curbuf);
/* Redraw needed when switching to/from "mac": a CR in the text
* will be displayed differently. */
if (get_fileformat(curbuf) == EOL_MAC || *oldval == 'm')
redraw_curbuf_later(NOT_VALID);
}
}
@@ -6582,7 +6586,11 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
|| *curwin->w_p_fdm == NUL)
errmsg = e_invarg;
else
{
foldUpdateAll(curwin);
if (foldmethodIsDiff(curwin))
newFoldLevel();
}
}
# ifdef FEAT_EVAL
/* 'foldexpr' */

View File

@@ -1471,6 +1471,9 @@ x_IOerror_check(dpy)
{
/* This function should not return, it causes exit(). Longjump instead. */
LONGJMP(lc_jump_env, 1);
# ifdef VMS
return 0; /* avoid the compiler complains about missing return value */
# endif
}
# endif
@@ -1490,6 +1493,9 @@ x_IOerror_handler(dpy)
/* This function should not return, it causes exit(). Longjump instead. */
LONGJMP(x_jump_env, 1);
# ifdef VMS
return 0; /* avoid the compiler complains about missing return value */
# endif
}
#endif

View File

@@ -25,7 +25,7 @@ extern int fseek __ARGS((FILE *, long, int));
extern int fseeko __ARGS((FILE *, off_t, int));
#endif
extern long ftell __ARGS((FILE *));
#ifdef HAVE_FTELLO
#ifdef HAVE_FSEEKO
extern off_t ftello __ARGS((FILE *));
#endif
extern void rewind __ARGS((FILE *));

View File

@@ -90,8 +90,9 @@ static char_u *tagmatchname = NULL; /* name of last used tag */
/*
* We use ftello() here, if available. It returns off_t instead of long,
* which helps if long is 32 bit and off_t is 64 bit.
* We assume that when fseeko() is available then ftello() is too.
*/
#ifdef HAVE_FTELLO
#ifdef HAVE_FSEEKO
# define ftell ftello
#endif

View File

@@ -36,6 +36,8 @@ Gzk:call append("$", "folding " . getline("."))
k:call append("$", getline("."))
jAcommentstart Acommentend:set fdl=1
3j:call append("$", getline("."))
:set fdl=0
zO j:call append("$", getline("."))
:" test expression folding
:fun Flvl()
let l = getline(v:lnum)

View File

@@ -11,6 +11,7 @@ indent 2
folding 9 ii
3 cc
7 gg
8 hh
expr 2
1
2

View File

@@ -681,6 +681,36 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
371,
/**/
370,
/**/
369,
/**/
368,
/**/
367,
/**/
366,
/**/
365,
/**/
364,
/**/
363,
/**/
362,
/**/
361,
/**/
360,
/**/
359,
/**/
358,
/**/
357,
/**/
356,
/**/

View File

@@ -52,7 +52,9 @@
/* user ID of root is usually zero, but not for everybody */
#ifdef __TANDEM
# define _TANDEM_SOURCE
# ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE
# endif
# include <floss.h>
# define ROOT_UID 65535
#else

View File

@@ -231,7 +231,7 @@ char *pname;
fprintf(stderr, " or\n %s -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]\n", pname);
fprintf(stderr, "Options:\n");
fprintf(stderr, " -a toggle autoskip: A single '*' replaces nul-lines. Default off.\n");
fprintf(stderr, " -b binary digit dump (incompatible with -p,-i,-r). Default hex.\n");
fprintf(stderr, " -b binary digit dump (incompatible with -ps,-i,-r). Default hex.\n");
fprintf(stderr, " -c cols format <cols> octets per line. Default 16 (-i: 12, -ps: 30).\n");
fprintf(stderr, " -E show characters in EBCDIC. Default ASCII.\n");
fprintf(stderr, " -g number of octets per group in normal output. Default 2.\n");
@@ -276,11 +276,11 @@ long base_off;
if (c == '\r') /* Doze style input file? */
continue;
#if 0 /* this doesn't work when there is normal text after the hex codes in
the last line that looks like hex */
if (c == ' ' || c == '\n' || c == '\t') /* allow multiple spaces */
/* Allow multiple spaces. This doesn't work when there is normal text
* after the hex codes in the last line that looks like hex, thus only
* use it for PostScript format. */
if (hextype == HEX_POSTSCRIPT && (c == ' ' || c == '\n' || c == '\t'))
continue;
#endif
n3 = n2;
n2 = n1;