Compare commits

...

14 Commits

Author SHA1 Message Date
Bram Moolenaar
3ee0229f64 updated for version 7.2.340
Problem:    Gcc warning for condition that can never be true. (James Vega)
Solution:   Use start_lvl instead flp->lvl.
2010-01-19 17:24:25 +01:00
Bram Moolenaar
c4e4198730 updated for version 7.2.339
Problem:    Part of --startuptime patch is missing.
Solution:   Add check for time_fd.
2010-01-19 16:31:47 +01:00
Bram Moolenaar
6b29b0e809 updated for version 7.2.338
Problem:    Part of FD_CLOEXEC change is missing.
Solution:   Include source file skipped because of typo.
2010-01-19 16:22:03 +01:00
Bram Moolenaar
3d63e3f160 updated for version 7.2.337
Problem:    The :compiler command doesn't function properly when invoked in a
            function.
Solution:   Add "g:" before "current_compiler". (Yukihiro Nakadaira)
2010-01-19 16:13:50 +01:00
Bram Moolenaar
7e506b6a42 updated for version 7.2.336
Problem:    MzScheme interface can't evaluate an expression.
Solution:   Add mzeval(). (Sergey Khorev)
2010-01-19 15:55:06 +01:00
Bram Moolenaar
6d8027a6c2 updated for version 7.2.335
Problem:    The CTRL-] command escapes too many characters.
Solution:   Use a different list of characters to be escaped. (Sergey Khorev)
2010-01-19 15:24:27 +01:00
Bram Moolenaar
8065d7fd9c updated for version 7.2.334
Problem:    Postponing keys in Netbeans interface does not work properly.
Solution:   Store the key string instead of the number.  Avoid an infinite
            loop. (Mostly by Xavier de Gaye)
2010-01-19 15:13:14 +01:00
Bram Moolenaar
2660c0ea9b updated for version 7.2.333
Problem:    Warnings from static code analysis.
Solution:   Small changes to various lines. (Dominique Pelle)
2010-01-19 14:59:56 +01:00
Bram Moolenaar
3ea38ef239 updated for version 7.2.332
Problem:    Crash when spell correcting triggers an autocommand that reloads
            the buffer.
Solution:   Make a copy of the line to be modified. (Dominique Pelle)
2010-01-19 13:08:42 +01:00
Bram Moolenaar
f68f656213 updated for version 7.2.331
Problem:    Can't interrupt "echo list" for a very long list.
Solution:   Call line_breakcheck() in list_join().
2010-01-19 12:48:05 +01:00
Bram Moolenaar
c0880db674 Add a few missing runtime files. 2010-01-17 14:38:06 +01:00
Bram Moolenaar
9db9d9ce05 Updated runtime files. 2010-01-16 14:29:14 +01:00
Bram Moolenaar
555cdc2f8c Updated runtime files. 2010-01-12 21:31:21 +01:00
Bram Moolenaar
3e8cb58725 updated for version 7.2.330
Problem:    Tables for Unicode case operators are outdated.
Solution:   Add a Vim script for generating the tables.  Include tables for
            Unicode 5.2.
2010-01-12 19:52:03 +01:00
46 changed files with 2199 additions and 401 deletions

View File

@@ -681,6 +681,11 @@ LANG_GEN = \
runtime/spell/README.txt \
runtime/spell/??/*.diff \
runtime/spell/??/main.aap \
runtime/spell/tet/*.diff \
runtime/spell/tet/main.aap \
runtime/spell/check/main.aap \
runtime/spell/check/*.aff \
runtime/spell/check/*.dic \
runtime/spell/yi/README.txt \
runtime/spell/main.aap \
runtime/spell/*.vim \

View File

@@ -1826,6 +1826,7 @@ min( {list}) Number minimum value of items in {list}
mkdir( {name} [, {path} [, {prot}]])
Number create directory {name}
mode( [expr]) String current editing mode
mzeval( {expr}) any evaluate |MzScheme| expression
nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum}
nr2char( {expr}) String single char with ASCII value {expr}
pathshorten( {expr}) String shorten directory names in a path
@@ -4102,6 +4103,23 @@ mode([expr]) Return a string that indicates the current mode.
"c" or "n".
Also see |visualmode()|.
mzeval({expr}) *mzeval()*
Evaluate MzScheme expression {expr} and return its result
convert to Vim data structures.
Numbers and strings are returned as they are.
Pairs (including lists and improper lists) and vectors are
returned as Vim |Lists|.
Hash tables are represented as Vim |Dictionary| type with keys
converted to strings.
All other types are converted to string with display function.
Examples: >
:mz (define l (list 1 2 3))
:mz (define h (make-hash)) (hash-set! h "list" l)
:echo mzeval("l")
:echo mzeval("h")
<
{only available when compiled with the |+mzscheme| feature}
nextnonblank({lnum}) *nextnonblank()*
Return the line number of the first line at or below {lnum}
that is not blank. Example: >

View File

@@ -1,4 +1,4 @@
*if_mzsch.txt* For Vim version 7.2. Last change: 2009 Jun 24
*if_mzsch.txt* For Vim version 7.2. Last change: 2010 Jan 19
VIM REFERENCE MANUAL by Sergey Khorev
@@ -9,8 +9,9 @@ The MzScheme Interface to Vim *mzscheme* *MzScheme*
1. Commands |mzscheme-commands|
2. Examples |mzscheme-examples|
3. Threads |mzscheme-threads|
4. The Vim access procedures |mzscheme-vim|
5. Dynamic loading |mzscheme-dynamic|
4. Vim access from MzScheme |mzscheme-vim|
5. mzeval() Vim function |mzscheme-mzeval|
6. Dynamic loading |mzscheme-dynamic|
{Vi does not have any of these commands}
@@ -142,7 +143,7 @@ Thread scheduling in the console version of Vim is less reliable than in the
GUI version.
==============================================================================
5. VIM Functions *mzscheme-vim*
4. Vim access from MzScheme *mzscheme-vim*
*mzscheme-vimext*
The 'vimext' module provides access to procedures defined in the MzScheme
@@ -231,7 +232,13 @@ Windows *mzscheme-window*
(set-cursor (line . col) [window]) Set cursor position.
==============================================================================
5. Dynamic loading *mzscheme-dynamic* *E815*
5. mzeval() Vim function *mzscheme-mzeval*
To facilitate bi-directional interface, you can use |mzeval| function to
evaluate MzScheme expressions and pass their values to VimL.
==============================================================================
6. Dynamic loading *mzscheme-dynamic* *E815*
On MS-Windows the MzScheme libraries can be loaded dynamically. The |:version|
output then includes |+mzscheme/dyn|.

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.2. Last change: 2010 Jan 06
*todo.txt* For Vim version 7.2. Last change: 2010 Jan 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -30,10 +30,16 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs*
-------------------- Known bugs and current work -----------------------
Patch from Dominique Pelle to comment out unused functions. (2009 Dec 25)
Patch from Dominique Pelle, documentation fixes. (2010 Jan 9)
Another patch for README files.
Patch from Dominique Pelle for buffer reload when fixing spell mistake.
(2010 Jan 14)
Extention for MzScheme interface. (Sergey Khorev, 2009 Dec 21, update Dec 26)
patch from Sergey Khorev for "*" command escaping. (2010 Jan 5)
Patch: :compiler command doesn't function properly when invoked in a function
(Yukihiro Nakadaira)
@@ -48,6 +54,15 @@ 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.
@@ -1134,7 +1149,7 @@ restored. (Luc St-Louis)
Vim 7.3:
- Use latest autoconf (3.64)
- Use latest autoconf (2.65)
- Use NSIS 2.45, it includes Windows 7 support.
- Include all files in distro, no "extra" and "lang" package.
- Create Mercurial repository.

View File

@@ -868,6 +868,8 @@ Various:
taglist() get list of matching tags
tagfiles() get a list of tags files
mzeval() evaluate |MzScheme| expression
==============================================================================
*41.7* Defining a function

View File

@@ -0,0 +1,50 @@
SET ISO8859-1
TRY esianrtolcdugmphbyfvkwjkqxz-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'ESIANRTOLCDUGMPHBYFVKWJKQXZ
FOL <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
LOW <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPP <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ<59><5A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޿
SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep?
MIDWORD '-
PFXPOSTPONE
COMPOUNDFLAG x
COMPOUNDMIN 5
KEEPCASE =
RARE ?
BAD !
MAP 9
MAP a<><61><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
MAP e<><65><EFBFBD><EFBFBD>
MAP i<><69><EFBFBD><EFBFBD>
MAP o<><6F><EFBFBD><EFBFBD><EFBFBD>
MAP u<><75><EFBFBD><EFBFBD>
MAP n<>
MAP c<>
MAP y<><79>
MAP s<>
PFX A Y 1
PFX A 0 aan .
PFX B N 1
PFX B 0 be .
PFX C Y 1
PFX C a in aa
SFX J N 1
SFX J 0 tje [aeiou][aeiou]
SFX Z N 1
SFX Z af ven aaf
REP 2
REP g ch
REP cht gd

View File

@@ -0,0 +1,12 @@
1234
#Some Comment that isn't supposed to matter
/Another Comment that isn't supposed to matter
's-Graveland
A4
AagJe
Aalburg/xZBCJZ
Aals'meer/x
Aal-ten/x
Aalburgers/x
Aalsmeer/x
Aalten/x

View File

@@ -0,0 +1,50 @@
SET ISO8859-1
TRY esianrtolcdugmphbyfvkwjkqxz-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'ESIANRTOLCDUGMPHBYFVKWJKQXZ
FOL <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
LOW <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPP <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ<59><5A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޿
SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep?
MIDWORD '-
PFXPOSTPONE
COMPOUNDFLAG x
COMPOUNDMIN 5
KEEPCASE =
RARE ?
BAD !
MAP 9
MAP a<><61><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
MAP e<><65><EFBFBD><EFBFBD>
MAP i<><69><EFBFBD><EFBFBD>
MAP o<><6F><EFBFBD><EFBFBD><EFBFBD>
MAP u<><75><EFBFBD><EFBFBD>
MAP n<>
MAP c<>
MAP y<><79>
MAP s<>
PFX A Y 1
PFX A 0 aan .
PFX B N 1
PFX B 0 be .
PFX C Y 1
PFX C a in aa
SFX J N 1
SFX J 0 tje [aeiou][aeiou]
SFX Z N 1
SFX Z af ven aaf
REP 2
REP g ch
REP cht gd

View File

@@ -0,0 +1,12 @@
1234
#Some Comment that isn't supposed to matter
/Another Comment that isn't supposed to matter
's-Graveland
A4
AagJe
Aalburg/xZBCJZ
Aals'meer/x
Aal-ten/x
foobar/=
rare/?
Emacs/!

View File

@@ -0,0 +1,15 @@
# Aap recipe for a dummy spell file.
# This is used to check if the .spl file format changes.
# Use a freshly compiled Vim if it exists.
@if os.path.exists('../../../src/vim'):
VIM = ../../../src/vim
@else:
:progsearch VIM vim
all: check.latin1.spl
check.latin1.spl : $VIM check_aa.aff check_aa.dic check_bb.aff check_bb.dic
:sys $VIM -u NONE -e -c "mkspell! check check_aa check_bb" -c q
# vim: set sts=4 sw=4 :

View File

@@ -0,0 +1,79 @@
# Aap recipe for Tetum Vim spell files.
# Use a freshly compiled Vim if it exists.
@if os.path.exists('../../../src/vim'):
VIM = ../../../src/vim
@else:
:progsearch VIM vim
SPELLDIR = ..
FILES = tet_ID.aff tet_ID.dic
# I don't hava a Tetum locale, use the Dutch one instead.
all: $SPELLDIR/tet.latin1.spl $SPELLDIR/tet.utf-8.spl ../README_tet.txt
$SPELLDIR/tet.latin1.spl : $FILES
:sys env LANG=nl_NL.ISO8859-1
$VIM -u NONE -e -c "mkspell! $SPELLDIR/tet tet_ID" -c q
$SPELLDIR/tet.utf-8.spl : $FILES
:sys env LANG=nl_NL.UTF-8
$VIM -u NONE -e -c "mkspell! $SPELLDIR/tet tet_ID" -c q
../README_tet.txt : README_tet_ID.txt
:copy $source $target
#
# Fetching the files from OpenOffice.org.
#
OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
:attr {fetch = $OODIR/%file%} tet_ID.zip
# The files don't depend on the .zip file so that we can delete it.
# Only download the zip file if the targets don't exist.
tet_ID.aff tet_ID.dic: {buildcheck=}
:assertpkg unzip patch
:fetch tet_ID.zip
:sys $UNZIP tet_ID.zip
:delete tet_ID.zip
@if not os.path.exists('tet_ID.orig.aff'):
:copy tet_ID.aff tet_ID.orig.aff
@if not os.path.exists('tet_ID.orig.dic'):
:copy tet_ID.dic tet_ID.orig.dic
@if os.path.exists('tet_ID.diff'):
:sys patch <tet_ID.diff
# Generate diff files, so that others can get the OpenOffice files and apply
# the diffs to get the Vim versions.
diff:
:assertpkg diff
:sys {force} diff -a -C 1 tet_ID.orig.aff tet_ID.aff >tet_ID.diff
:sys {force} diff -a -C 1 tet_ID.orig.dic tet_ID.dic >>tet_ID.diff
# Check for updated OpenOffice spell files. When there are changes the
# ".new.aff" and ".new.dic" files are left behind for manual inspection.
check:
:assertpkg unzip diff
:fetch tet_ID.zip
:mkdir tmp
:cd tmp
@try:
@import stat
:sys $UNZIP ../tet_ID.zip
:sys {force} diff ../tet_ID.orig.aff tet_ID.aff >d
@if os.stat('d')[stat.ST_SIZE] > 0:
:copy tet_ID.aff ../tet_ID.new.aff
:sys {force} diff ../tet_ID.orig.dic tet_ID.dic >d
@if os.stat('d')[stat.ST_SIZE] > 0:
:copy tet_ID.dic ../tet_ID.new.dic
@finally:
:cd ..
:delete {r}{f}{q} tmp
:delete tet_ID.zip
# vim: set sts=4 sw=4 :

View File

@@ -0,0 +1,26 @@
*** tet_ID.orig.aff Wed Aug 31 21:14:37 2005
--- tet_ID.aff Wed Aug 31 21:15:15 2005
***************
*** 19 ****
--- 19,39 ----
TRY aineousrthlkmdbp'fTvgzLAINjSPEM<45>D-KH<4B><48>FRUBGJ<47>Oc<4F>wxCWXV<58><56><EFBFBD>q<EFBFBD><71>Z<EFBFBD>Qy<51><79>
+
+ FOL <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ LOW <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ UPP <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+
+ SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ<59><5A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޿
+ SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep?
+
+ MIDWORD '-
+
+ MAP 9
+ MAP a<><61><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ MAP e<><65><EFBFBD><EFBFBD>
+ MAP i<><69><EFBFBD><EFBFBD>
+ MAP o<><6F><EFBFBD><EFBFBD><EFBFBD>
+ MAP u<><75><EFBFBD><EFBFBD>
+ MAP n<>
+ MAP c<>
+ MAP y<><79>
+ MAP s<>

View File

@@ -1,10 +1,12 @@
" Vim syntax file
" Language: GNU Assembler
" Maintainer: Kevin Dahlhausen <kdahlhaus@yahoo.com>
" Last Change: 2002 Sep 19
" Maintainer: Erik Wognsen <erik.wognsen@gmail.com>
" Previous maintainer:
" Kevin Dahlhausen <kdahlhaus@yahoo.com>
" Last Change: 2010 Jan 9
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
" For version 6.0 and later: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
@@ -13,7 +15,6 @@ endif
syn case ignore
" storage types
syn match asmType "\.long"
syn match asmType "\.ascii"
@@ -44,9 +45,8 @@ syn match octNumber "0[0-7][0-7]\+"
syn match hexNumber "0[xX][0-9a-fA-F]\+"
syn match binNumber "0[bB][0-1]*"
syn match asmSpecialComment ";\*\*\*.*"
syn match asmComment ";.*"hs=s+1
syn match asmComment "#.*"
syn region asmComment start="/\*" end="\*/"
syn match asmInclude "\.include"
syn match asmCond "\.if"
@@ -86,15 +86,9 @@ if version >= 508 || !exists("did_asm_syntax_inits")
HiLink octNumber Number
HiLink binNumber Number
HiLink asmSpecialComment Comment
HiLink asmIdentifier Identifier
HiLink asmType Type
" My default color overrides:
" hi asmSpecialComment ctermfg=red
" hi asmIdentifier ctermfg=lightcyan
" hi asmType ctermbg=black ctermfg=brown
delcommand HiLink
endif

View File

@@ -1,29 +1,44 @@
" Vim syntax file for the D programming language (version 0.149).
" Vim syntax file for the D programming language (version 1.053 and 2.039).
"
" Language: D
" Maintainer: Jason Mills<jmills@cs.mun.ca>
" When emailing me, please put the word vim somewhere in the subject
" to ensure the email does not get marked as spam.
" Last Change: 2006 Apr 30
" Version: 0.15
" Maintainer: Jason Mills<jasonmills@nf.sympatico.ca>
" Last Change: 2010 Jan 07
" Version: 0.18
"
" Contributors:
" - Kirk McDonald: version 0.17 updates, with minor modifications
" (http://paste.dprogramming.com/dplmb7qx?view=hidelines)
" - Jesse K. Phillips: patch for some keywords and attributes (annotations), with modifications
" - Tim Keating: patch to fix a bug in highlighting the `\` literal
" - Frank Benoit: Fixed a bug that caused some identifiers and numbers to highlight as octal number errors.
"
" Please email me with bugs, comments, and suggestions.
"
" Options:
" d_comment_strings - set to highlight strings and numbers in comments
" d_comment_strings - Set to highlight strings and numbers in comments.
"
" d_hl_operator_overload - set to highlight D's specially named functions
" that when overloaded implement unary and binary operators (e.g. cmp).
" d_hl_operator_overload - Set to highlight D's specially named functions
" that when overloaded implement unary and binary operators (e.g. opCmp).
"
" Todo:
" - Must determine a better method of sync'ing than simply setting minlines
" to a large number for /+ +/.
" - Determine a better method of sync'ing than simply setting minlines
" to a large number.
"
" - Several keywords (namely, in and out) are both storage class and
" statements, depending on their context. Must use some matching to figure
" out which and highlight appropriately. For now I have made such keywords
" statements.
" - Several keywords (e.g., in, out, inout) are both storage class and
" statements, depending on their context. Perhaps use pattern matching to
" figure out which and highlight appropriately. For now I have made such
" keywords storage classes so their highlighting is consistent with other
" keywords that are commonly used with them, but are true storage classes,
" such as lazy. Similarly, I made some statement keywords (e.g. body) storage
" classes.
"
" - Mark contents of the asm statement body as special
"
" - Maybe highlight the 'exit', 'failure', and 'success' parts of the
" scope() statement.
"
" - Highlighting DDoc comments.
"
" Quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -33,46 +48,59 @@ endif
" Keyword definitions
"
syn keyword dExternal import package module extern
syn keyword dConditional if else switch iftype
syn keyword dConditional if else switch
syn keyword dBranch goto break continue
syn keyword dRepeat while for do foreach
syn keyword dRepeat while for do foreach foreach_reverse
syn keyword dBoolean true false
syn keyword dConstant null
syn keyword dConstant __FILE__ __LINE__ __DATE__ __TIME__ __TIMESTAMP__
syn keyword dConstant __FILE__ __LINE__ __EOF__ __VERSION__
syn keyword dConstant __DATE__ __TIME__ __TIMESTAMP__ __VENDOR__
syn keyword dTypedef alias typedef
syn keyword dStructure template interface class enum struct union
syn keyword dStructure template interface class struct union
syn keyword dEnum enum
syn keyword dOperator new delete typeof typeid cast align is
syn keyword dOperator this super
if exists("d_hl_operator_overload")
syn keyword dOpOverload opNeg opCom opPostInc opPostDec opCast opAdd opSub opSub_r
syn keyword dOpOverload opMul opDiv opDiv_r opMod opMod_r opAnd opOr opXor
syn keyword dOpOverload opShl opShl_r opShr opShr_r opUShr opUShr_r opCat
syn keyword dOpOverload opCat_r opEquals opEquals opCmp opCmp opCmp opCmp
syn keyword dOpOverload opAddAssign opSubAssign opMulAssign opDivAssign
syn keyword dOpOverload opCat_r opEquals opEquals opCmp
syn keyword dOpOverload opAssign opAddAssign opSubAssign opMulAssign opDivAssign
syn keyword dOpOverload opModAssign opAndAssign opOrAssign opXorAssign
syn keyword dOpOverload opShlAssign opShrAssign opUShrAssign opCatAssign
syn keyword dOpOverload opIndex opIndexAssign opCall opSlice opSliceAssign opPos
syn keyword dOpOverload opAdd_r opMul_r opAnd_r opOr_r opXor_r
syn keyword dOpOverload opAdd_r opMul_r opAnd_r opOr_r opXor_r opIn opIn_r
syn keyword dOpOverload opPow opDispatch opStar opDot opApply opApplyReverse
endif
syn keyword dType ushort int uint long ulong float
syn keyword dType void byte ubyte double bit char wchar ucent cent
syn keyword dType short bool dchar
syn keyword dType short bool dchar string wstring dstring
syn keyword dType real ireal ifloat idouble creal cfloat cdouble
syn keyword dDebug deprecated unittest
syn keyword dExceptions throw try catch finally
syn keyword dScopeDecl public protected private export
syn keyword dStatement version debug return with invariant body scope
syn keyword dStatement in out inout asm mixin
syn keyword dStatement function delegate
syn keyword dStorageClass auto static override final const abstract volatile
syn keyword dStorageClass synchronized
syn keyword dStatement version debug return with
syn keyword dStatement function delegate __traits asm mixin macro
syn keyword dStorageClass in out inout ref lazy scope body
syn keyword dStorageClass pure nothrow
syn keyword dStorageClass auto static override final abstract volatile __gshared __thread
syn keyword dStorageClass synchronized immutable shared const invariant lazy
syn keyword dPragma pragma
" Attributes/annotations
syn match dAnnotation "@[_$a-zA-Z][_$a-zA-Z0-9_]*\>"
" Assert is a statement and a module name.
syn match dAssert "^assert\>"
syn match dAssert "[^.]\s*\<assert\>"ms=s+1
" dTokens is used by the token string highlighting
syn cluster dTokens contains=dExternal,dConditional,dBranch,dRepeat,dBoolean
syn cluster dTokens add=dConstant,dTypedef,dStructure,dOperator,dOpOverload
syn cluster dTokens add=dType,dDebug,dExceptions,dScopeDecl,dStatement
syn cluster dTokens add=dStorageClass,dPragma,dAssert,dAnnotation
" Marks contents of the asm statment body as special
"
" TODO
@@ -85,12 +113,14 @@ syn match dAssert "[^.]\s*\<assert\>"ms=s+1
" Labels
"
" We contain dScopeDecl so public: private: etc. are not highlighted like labels
syn match dUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=dLabel,dScopeDecl
syn match dUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=dLabel,dScopeDecl,dEnum
syn keyword dLabel case default
syn cluster dTokens add=dUserLabel,dLabel
" Comments
"
syn keyword dTodo contained TODO FIXME TEMP XXX
syn keyword dTodo contained TODO FIXME TEMP REFACTOR REVIEW HACK BUG XXX
syn match dCommentStar contained "^\s*\*[^/]"me=e-1
syn match dCommentStar contained "^\s*\*$"
syn match dCommentPlus contained "^\s*+[^/]"me=e-1
@@ -114,6 +144,8 @@ hi link dNestedCommentString dString
hi link dCommentStar dBlockComment
hi link dCommentPlus dNestedComment
syn cluster dTokens add=dBlockComment,dNestedComment,dLineComment
" /+ +/ style comments and strings that span multiple lines can cause
" problems. To play it safe, set minlines to a large number.
syn sync minlines=200
@@ -125,24 +157,55 @@ syn sync ccomment dBlockComment
syn match dSpecialCharError contained "[^']"
" Escape sequences (oct,specal char,hex,wchar, character entities \&xxx;)
" These are not contained because they are considered string litterals
" These are not contained because they are considered string literals.
syn match dEscSequence "\\\(\o\{1,3}\|[\"\\'\\?ntbrfva]\|u\x\{4}\|U\x\{8}\|x\x\x\)"
syn match dEscSequence "\\&[^;& \t]\+;"
syn match dEscSequence "\\&[^;& \t]\+;"
syn match dCharacter "'[^']*'" contains=dEscSequence,dSpecialCharError
syn match dCharacter "'\\''" contains=dEscSequence
syn match dCharacter "'[^\\]'"
syn cluster dTokens add=dEscSequence,dCharacter
" Unicode characters
"
syn match dUnicode "\\u\d\{4\}"
" String.
"
syn region dString start=+"+ end=+"[cwd]\=+ contains=dEscSequence,@Spell
syn region dRawString start=+`+ skip=+\\`+ end=+`[cwd]\=+ contains=@Spell
syn region dRawString start=+r"+ skip=+\\"+ end=+"[cwd]\=+ contains=@Spell
syn region dHexString start=+x"+ skip=+\\"+ end=+"[cwd]\=+ contains=@Spell
syn region dString start=+"+ end=+"[cwd]\=+ skip=+\\\\\|\\"+ contains=dEscSequence,@Spell
syn region dRawString start=+`+ end=+`[cwd]\=+ contains=@Spell
syn region dRawString start=+r"+ end=+"[cwd]\=+ contains=@Spell
syn region dHexString start=+x"+ end=+"[cwd]\=+ contains=@Spell
syn region dDelimString start=+q"\z(.\)+ end=+\z1"+ contains=@Spell
syn region dHereString start=+q"\z(\I\i*\)\n+ end=+\n\z1"+ contains=@Spell
" Nesting delimited string contents
"
syn region dNestParenString start=+(+ end=+)+ contained transparent contains=dNestParenString,@Spell
syn region dNestBrackString start=+\[+ end=+\]+ contained transparent contains=dNestBrackString,@Spell
syn region dNestAngleString start=+<+ end=+>+ contained transparent contains=dNestAngleString,@Spell
syn region dNestCurlyString start=+{+ end=+}+ contained transparent contains=dNestCurlyString,@Spell
" Nesting delimited strings
"
syn region dParenString matchgroup=dParenString start=+q"(+ end=+)"+ contains=dNestParenString,@Spell
syn region dBrackString matchgroup=dBrackString start=+q"\[+ end=+\]"+ contains=dNestBrackString,@Spell
syn region dAngleString matchgroup=dAngleString start=+q"<+ end=+>"+ contains=dNestAngleString,@Spell
syn region dCurlyString matchgroup=dCurlyString start=+q"{+ end=+}"+ contains=dNestCurlyString,@Spell
hi link dParenString dNestString
hi link dBrackString dNestString
hi link dAngleString dNestString
hi link dCurlyString dNestString
syn cluster dTokens add=dString,dRawString,dHexString,dDelimString,dNestString
" Token strings
"
syn region dNestTokenString start=+{+ end=+}+ contained contains=dNestTokenString,@dTokens
syn region dTokenString matchgroup=dTokenStringBrack transparent start=+q{+ end=+}+ contains=dNestTokenString,@dTokens
syn cluster dTokens add=dTokenString
" Numbers
"
@@ -177,6 +240,8 @@ syn match dHexFloat display "\<0x[0-9a-f_]\+\.[0-9a-f_]*\(p[-+]\=[0-9_]\+\)\=[fl
"floating point number, without dot, with exponent
syn match dHexFloat display "\<0x[0-9a-f_]\+p[-+]\=[0-9_]\+[fl]\=i\=\>"
syn cluster dTokens add=dDec,dHex,dOctal,dOctalError,dBinary,dFloat,dHexFloat
syn case match
" Pragma (preprocessor) support
@@ -205,6 +270,10 @@ hi def link dScopeDecl dStorageClass
hi def link dStorageClass StorageClass
hi def link dBoolean Boolean
hi def link dUnicode Special
hi def link dTokenStringBrack String
hi def link dHereString String
hi def link dNestString String
hi def link dDelimString String
hi def link dRawString String
hi def link dString String
hi def link dHexString String
@@ -213,9 +282,10 @@ hi def link dEscSequence SpecialChar
hi def link dSpecialCharError Error
hi def link dOctalError Error
hi def link dOperator Operator
hi def link dOpOverload Operator
hi def link dOpOverload Identifier
hi def link dConstant Constant
hi def link dTypedef Typedef
hi def link dEnum Structure
hi def link dStructure Structure
hi def link dTodo Todo
hi def link dType Type
@@ -224,7 +294,8 @@ hi def link dBlockComment Comment
hi def link dNestedComment Comment
hi def link dExternal Include
hi def link dPragma PreProc
hi def link dAnnotation PreProc
let b:current_syntax = "d"
" vim: ts=8 noet

View File

@@ -1,15 +1,10 @@
" Vim syntax file
" Language: Matlab
" Maintainer: Maurizio Tranchero - maurizio.tranchero@gmail.com
" Maintainer: Maurizio Tranchero - maurizio(.)tranchero(@)gmail(.)com
" Credits: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
" Original author: Mario Eusebio
" Change History:
" Sat Jul 25 16:14:55 CEST 2009
" - spell check enabled only for comments (thanks to James Vega)
"
" Tue Apr 21 10:03:31 CEST 2009
" - added object oriented support
" - added multi-line comments %{ ...\n... %}
" Last Change: Wed Jan 13 11:12:34 CET 2010
" - 'global' and 'persistent' keyword are now recognized
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -28,6 +23,7 @@ syn keyword matlabExceptions try catch
syn keyword matlabOO classdef properties events methods
syn keyword matlabTodo contained TODO
syn keyword matlabScope global persistent
" If you do not want these operators lit, uncommment them and the "hi link" below
syn match matlabArithmeticOperator "[-+]"
@@ -42,7 +38,7 @@ syn match matlabLineContinuation "\.\{3}"
" String
" MT_ADDON - added 'skip' in order to deal with 'tic' escaping sequence
syn region matlabString start=+'+ end=+'+ oneline skip=+''+ contains=@Spell
syn region matlabString start=+'+ end=+'+ oneline skip=+''+
" If you don't like tabs
syn match matlabTab "\t"
@@ -61,10 +57,10 @@ syn match matlabTransposeOperator "[])a-zA-Z0-9.]'"lc=1
syn match matlabSemicolon ";"
syn match matlabComment "%.*$" contains=matlabTodo,matlabTab,@Spell
syn match matlabComment "%.*$" contains=matlabTodo,matlabTab
" MT_ADDON - correctly highlights words after '...' as comments
syn match matlabComment "\.\.\..*$" contains=matlabTodo,matlabTab,@Spell
syn region matlabMultilineComment start=+%{+ end=+%}+ contains=matlabTodo,matlabTab,@Spell
syn match matlabComment "\.\.\..*$" contains=matlabTodo,matlabTab
syn region matlabMultilineComment start=+%{+ end=+%}+ contains=matlabTodo,matlabTab
syn keyword matlabOperator break zeros default margin round ones rand
syn keyword matlabOperator ceil floor size clear zeros eye mean std cov
@@ -109,6 +105,7 @@ if version >= 508 || !exists("did_matlab_syntax_inits")
HiLink matlabSemicolon SpecialChar
HiLink matlabComment Comment
HiLink matlabMultilineComment Comment
HiLink matlabScope Type
HiLink matlabArithmeticOperator matlabOperator
HiLink matlabRelationalOperator matlabOperator

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" Language: screen(1) configuration file
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19
" Latest Revision: 2010-01-03
if exists("b:current_syntax")
finish
@@ -15,54 +15,219 @@ syn match screenEscape '\\.'
syn keyword screenTodo contained TODO FIXME XXX NOTE
syn region screenComment display oneline start='#' end='$'
\ contains=screenTodo,@Spell
\ contains=screenTodo,@Spell
syn region screenString display oneline start=+"+ skip=+\\"+ end=+"+
\ contains=screenVariable,screenSpecial
\ contains=screenVariable,screenSpecial
syn region screenLiteral display oneline start=+'+ skip=+\\'+ end=+'+
syn match screenVariable contained display '$\(\h\w*\|{\h\w*}\)'
syn match screenVariable contained display '$\%(\h\w*\|{\h\w*}\)'
syn keyword screenBoolean on off
syn match screenNumbers display '\<\d\+\>'
syn match screenSpecials contained
\ '%\([%aAdDhlmMstuwWyY?:{]\|[0-9]*n\|0?cC\)'
\ '%\%([%aAdDhlmMstuwWyY?:{]\|[0-9]*n\|0?cC\)'
syn keyword screenCommands acladd aclchg acldel aclgrp aclumask activity
\ addacl allpartial at attrcolor autodetach
\ bell_msg bind bindkey bufferfile caption chacl
\ chdir clear colon command compacthist console
\ copy copy_regcrlf debug detach digraph dinfo
\ crlf displays dumptermcap echo exec fit focus
\ height help history info kill lastmsg license
\ lockscreen markkeys meta msgminwait msgwait
\ multiuser nethack next nonblock number only
\ other partial_state password paste pastefont
\ pow_break pow_detach_msg prev printcmd process
\ quit readbuf readreg redisplay register
\ remove removebuf reset resize screen select
\ sessionname setenv shelltitle silencewait
\ verbose sleep sorendition split startup_message
\ stuff su suspend time title umask version wall
\ width writebuf xoff xon defmode hardstatus
\ altscreen break breaktype copy_reg defbreaktype
\ defencoding deflog encoding eval ignorecase
\ ins_reg maxwin partial pow_detach setsid source
\ unsetenv windowlist windows defautonuke autonuke
\ defbce bce defc1 c1 defcharset charset defescape
\ escape defflow flow defkanji kanji deflogin
\ login defmonitor monitor defhstatus hstatus
\ defobuflimit obuflimit defscrollback scrollback
\ defshell shell defsilence silence defslowpaste
\ slowpaste defutf8 utf8 defwrap wrap defwritelock
\ writelock defzombie zombie defgr gr hardcopy
\ hardcopy_append hardcopydir hardstatus log
\ logfile login logtstamp mapdefault mapnotnext
\ maptimeout term termcap terminfo termcapinfo
\ vbell vbell_msg vbellwait
syn keyword screenCommands
\ acladd
\ aclchg
\ acldel
\ aclgrp
\ aclumask
\ activity
\ addacl
\ allpartial
\ altscreen
\ at
\ attrcolor
\ autodetach
\ autonuke
\ backtick
\ bce
\ bd_bc_down
\ bd_bc_left
\ bd_bc_right
\ bd_bc_up
\ bd_bell
\ bd_braille_table
\ bd_eightdot
\ bd_info
\ bd_link
\ bd_lower_left
\ bd_lower_right
\ bd_ncrc
\ bd_port
\ bd_scroll
\ bd_skip
\ bd_start_braille
\ bd_type
\ bd_upper_left
\ bd_upper_right
\ bd_width
\ bell
\ bell_msg
\ bind
\ bindkey
\ blanker
\ blankerprg
\ break
\ breaktype
\ bufferfile
\ c1
\ caption
\ chacl
\ charset
\ chdir
\ clear
\ colon
\ command
\ compacthist
\ console
\ copy
\ crlf
\ debug
\ defautonuke
\ defbce
\ defbreaktype
\ defc1
\ defcharset
\ defencoding
\ defescape
\ defflow
\ defgr
\ defhstatus
\ defkanji
\ deflog
\ deflogin
\ defmode
\ defmonitor
\ defnonblock
\ defobuflimit
\ defscrollback
\ defshell
\ defsilence
\ defslowpaste
\ defutf8
\ defwrap
\ defwritelock
\ detach
\ digraph
\ dinfo
\ displays
\ dumptermcap
\ echo
\ encoding
\ escape
\ eval
\ exec
\ fit
\ flow
\ focus
\ gr
\ hardcopy
\ hardcopy_append
\ hardcopydir
\ hardstatus
\ height
\ help
\ history
\ hstatus
\ idle
\ ignorecase
\ info
\ kanji
\ kill
\ lastmsg
\ layout
\ license
\ lockscreen
\ log
\ logfile
\ login
\ logtstamp
\ mapdefault
\ mapnotnext
\ maptimeout
\ markkeys
\ maxwin
\ meta
\ monitor
\ msgminwait
\ msgwait
\ multiuser
\ nethack
\ next
\ nonblock
\ number
\ obuflimit
\ only
\ other
\ partial
\ password
\ paste
\ pastefont
\ pow_break
\ pow_detach
\ pow_detach_msg
\ prev
\ printcmd
\ process
\ quit
\ readbuf
\ readreg
\ redisplay
\ register
\ remove
\ removebuf
\ reset
\ resize
\ screen
\ scrollback
\ select
\ sessionname
\ setenv
\ setsid
\ shell
\ shelltitle
\ silence
\ silencewait
\ sleep
\ slowpaste
\ sorendition
\ source
\ split
\ startup_message
\ stuff
\ su
\ suspend
\ term
\ termcap
\ termcapinfo
\ terminfo
\ time
\ title
\ umask
\ unsetenv
\ utf8
\ vbell
\ vbell_msg
\ vbellwait
\ verbose
\ version
\ wall
\ width
\ windowlist
\ windows
\ wrap
\ writebuf
\ writelock
\ xoff
\ xon
\ zmodem
\ zombie
hi def link screenEscape Special
hi def link screenComment Comment

View File

@@ -32,4 +32,6 @@ vim_vs_net.cmd: MS-Windows command file to use Vim with MS Visual Studio 7 and
xcmdsrv_client.c: Example for a client program that communicates with a Vim
server through the X-Windows interface.
unicode.vim Vim script to generate tables for src/mbyte.c.
[xxd (and tee for OS/2) can be found in the src directory]

280
runtime/tools/unicode.vim Normal file
View File

@@ -0,0 +1,280 @@
" Script to extract tables from Unicode .txt files, to be used in src/mbyte.c.
" The format of the UnicodeData.txt file is explained here:
" http://www.unicode.org/Public/5.1.0/ucd/UCD.html
" For the other files see the header.
"
" Usage: Vim -S <this-file>
"
" Author: Bram Moolenaar
" Last Update: 2010 Jan 12
" Parse lines of UnicodeData.txt. Creates a list of lists in s:dataprops.
func! ParseDataToProps()
let s:dataprops = []
let lnum = 1
while lnum <= line('$')
let l = split(getline(lnum), '\s*;\s*', 1)
if len(l) != 15
echoerr 'Found ' . len(l) . ' items in line ' . lnum . ', expected 15'
return
endif
call add(s:dataprops, l)
let lnum += 1
endwhile
endfunc
" Parse lines of CaseFolding.txt. Creates a list of lists in s:foldprops.
func! ParseFoldProps()
let s:foldprops = []
let lnum = 1
while lnum <= line('$')
let line = getline(lnum)
if line !~ '^#' && line !~ '^\s*$'
let l = split(line, '\s*;\s*', 1)
if len(l) != 4
echoerr 'Found ' . len(l) . ' items in line ' . lnum . ', expected 4'
return
endif
call add(s:foldprops, l)
endif
let lnum += 1
endwhile
endfunc
" Parse lines of EastAsianWidth.txt. Creates a list of lists in s:widthprops.
func! ParseWidthProps()
let s:widthprops = []
let lnum = 1
while lnum <= line('$')
let line = getline(lnum)
if line !~ '^#' && line !~ '^\s*$'
let l = split(line, '\s*;\s*', 1)
if len(l) != 2
echoerr 'Found ' . len(l) . ' items in line ' . lnum . ', expected 2'
return
endif
call add(s:widthprops, l)
endif
let lnum += 1
endwhile
endfunc
" Build the toLower or toUpper table in a new buffer.
" Uses s:dataprops.
func! BuildCaseTable(name, index)
let start = -1
let end = -1
let step = 0
let add = -1
let ranges = []
for p in s:dataprops
if p[a:index] != ''
let n = ('0x' . p[0]) + 0
let nl = ('0x' . p[a:index]) + 0
if start >= 0 && add == nl - n && (step == 0 || n - end == step)
" continue with same range.
let step = n - end
let end = n
else
if start >= 0
" produce previous range
call Range(ranges, start, end, step, add)
endif
let start = n
let end = n
let step = 0
let add = nl - n
endif
endif
endfor
if start >= 0
call Range(ranges, start, end, step, add)
endif
" New buffer to put the result in.
new
exe "file to" . a:name
call setline(1, "static convertStruct to" . a:name . "[] =")
call setline(2, "{")
call append('$', ranges)
call setline('$', getline('$')[:-2]) " remove last comma
call setline(line('$') + 1, "};")
wincmd p
endfunc
" Build the foldCase table in a new buffer.
" Uses s:foldprops.
func! BuildFoldTable()
let start = -1
let end = -1
let step = 0
let add = -1
let ranges = []
for p in s:foldprops
if p[1] == 'C' || p[1] == 'S'
let n = ('0x' . p[0]) + 0
let nl = ('0x' . p[2]) + 0
if start >= 0 && add == nl - n && (step == 0 || n - end == step)
" continue with same range.
let step = n - end
let end = n
else
if start >= 0
" produce previous range
call Range(ranges, start, end, step, add)
endif
let start = n
let end = n
let step = 0
let add = nl - n
endif
endif
endfor
if start >= 0
call Range(ranges, start, end, step, add)
endif
" New buffer to put the result in.
new
file foldCase
call setline(1, "static convertStruct foldCase[] =")
call setline(2, "{")
call append('$', ranges)
call setline('$', getline('$')[:-2]) " remove last comma
call setline(line('$') + 1, "};")
wincmd p
endfunc
func! Range(ranges, start, end, step, add)
let s = printf("\t{0x%x,0x%x,%d,%d},", a:start, a:end, a:step == 0 ? -1 : a:step, a:add)
call add(a:ranges, s)
endfunc
" Build the combining table.
" Uses s:dataprops.
func! BuildCombiningTable()
let start = -1
let end = -1
let ranges = []
for p in s:dataprops
if p[2] == 'Mn' || p[2] == 'Mc' || p[2] == 'Me'
let n = ('0x' . p[0]) + 0
if start >= 0 && end + 1 == n
" continue with same range.
let end = n
else
if start >= 0
" produce previous range
call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end))
endif
let start = n
let end = n
endif
endif
endfor
if start >= 0
call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end))
endif
" New buffer to put the result in.
new
file combining
call setline(1, " static struct interval combining[] =")
call setline(2, " {")
call append('$', ranges)
call setline('$', getline('$')[:-2]) " remove last comma
call setline(line('$') + 1, " };")
wincmd p
endfunc
" Build the ambiguous table in a new buffer.
" Uses s:widthprops and s:dataprops.
func! BuildAmbiguousTable()
let start = -1
let end = -1
let ranges = []
let dataidx = 0
for p in s:widthprops
if p[1][0] == 'A'
let n = ('0x' . p[0]) + 0
" Find this char in the data table.
while 1
let dn = ('0x' . s:dataprops[dataidx][0]) + 0
if dn >= n
break
endif
let dataidx += 1
endwhile
if dn != n
echoerr "Cannot find character " . n . " in data table"
endif
" Only use the char when it's not a composing char.
let dp = s:dataprops[dataidx]
if dp[2] != 'Mn' && dp[2] != 'Mc' && dp[2] != 'Me'
if start >= 0 && end + 1 == n
" continue with same range.
let end = n
else
if start >= 0
" produce previous range
call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end))
endif
let start = n
if p[0] =~ '\.\.'
let end = ('0x' . substitute(p[0], '.*\.\.', '', '')) + 0
else
let end = n
endif
endif
endif
endif
endfor
if start >= 0
call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end))
endif
" New buffer to put the result in.
new
file ambiguous
call setline(1, " static struct interval ambiguous[] =")
call setline(2, " {")
call append('$', ranges)
call setline('$', getline('$')[:-2]) " remove last comma
call setline(line('$') + 1, " };")
wincmd p
endfunc
" Edit the Unicode text file. Requires the netrw plugin.
edit http://unicode.org/Public/UNIDATA/UnicodeData.txt
" Parse each line, create a list of lists.
call ParseDataToProps()
" Build the toLower table.
call BuildCaseTable("Lower", 13)
" Build the toUpper table.
call BuildCaseTable("Upper", 12)
" Build the ranges of composing chars.
call BuildCombiningTable()
" Edit the case folding text file. Requires the netrw plugin.
edit http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
" Parse each line, create a list of lists.
call ParseFoldProps()
" Build the foldCase table.
call BuildFoldTable()
" Edit the width text file. Requires the netrw plugin.
edit http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt
" Parse each line, create a list of lists.
call ParseWidthProps()
" Build the ambiguous table.
call BuildAmbiguousTable()

View File

@@ -315,7 +315,7 @@ close_buffer(win, buf, action)
{
#ifdef FEAT_AUTOCMD
int is_curbuf;
int nwindows = buf->b_nwindows;
int nwindows;
#endif
int unload_buf = (action != 0);
int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);

View File

@@ -4048,7 +4048,7 @@ ins_compl_get_exp(ini)
save_p_ic = p_ic;
p_ic = ignorecase(compl_pattern);
/* Find up to TAG_MANY matches. Avoids that an enourmous number
/* Find up to TAG_MANY matches. Avoids that an enormous number
* of matches is found when compl_pattern is empty */
if (find_tags(compl_pattern, &num_matches, &matches,
TAG_REGEXP | TAG_NAMES | TAG_NOIC |
@@ -4219,7 +4219,7 @@ ins_compl_get_exp(ini)
|| IObuff[len - 2] == '!'))))
IObuff[len++] = ' ';
}
/* copy as much as posible of the new word */
/* copy as much as possible of the new word */
if (tmp_ptr - ptr >= IOSIZE - len)
tmp_ptr = ptr + IOSIZE - len - 1;
STRNCPY(IObuff + len, ptr, tmp_ptr - ptr);
@@ -5827,10 +5827,7 @@ internal_format(textwidth, second_indent, flags, format_only, c)
#endif
&& !has_format_option(FO_WRAP))
{
textwidth = 0;
break;
}
if ((startcol = curwin->w_cursor.col) == 0)
break;

View File

@@ -433,7 +433,6 @@ static listitem_T *list_find __ARGS((list_T *l, long n));
static long list_find_nr __ARGS((list_T *l, long idx, int *errorp));
static long list_idx_of_item __ARGS((list_T *l, listitem_T *item));
static void list_append __ARGS((list_T *l, listitem_T *item));
static int list_append_tv __ARGS((list_T *l, typval_T *tv));
static int list_append_number __ARGS((list_T *l, varnumber_T n));
static int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item));
static int list_extend __ARGS((list_T *l1, list_T *l2, listitem_T *bef));
@@ -448,12 +447,9 @@ static void set_ref_in_list __ARGS((list_T *l, int copyID));
static void set_ref_in_item __ARGS((typval_T *tv, int copyID));
static void dict_unref __ARGS((dict_T *d));
static void dict_free __ARGS((dict_T *d, int recurse));
static dictitem_T *dictitem_alloc __ARGS((char_u *key));
static dictitem_T *dictitem_copy __ARGS((dictitem_T *org));
static void dictitem_remove __ARGS((dict_T *dict, dictitem_T *item));
static void dictitem_free __ARGS((dictitem_T *item));
static dict_T *dict_copy __ARGS((dict_T *orig, int deep, int copyID));
static int dict_add __ARGS((dict_T *d, dictitem_T *item));
static long dict_len __ARGS((dict_T *d));
static dictitem_T *dict_find __ARGS((dict_T *d, char_u *key, int len));
static char_u *dict2string __ARGS((typval_T *tv, int copyID));
@@ -628,6 +624,9 @@ static void f_min __ARGS((typval_T *argvars, typval_T *rettv));
static void f_mkdir __ARGS((typval_T *argvars, typval_T *rettv));
#endif
static void f_mode __ARGS((typval_T *argvars, typval_T *rettv));
#ifdef FEAT_MZSCHEME
static void f_mzeval __ARGS((typval_T *argvars, typval_T *rettv));
#endif
static void f_nextnonblank __ARGS((typval_T *argvars, typval_T *rettv));
static void f_nr2char __ARGS((typval_T *argvars, typval_T *rettv));
static void f_pathshorten __ARGS((typval_T *argvars, typval_T *rettv));
@@ -764,7 +763,6 @@ static void set_var __ARGS((char_u *name, typval_T *varp, int copy));
static int var_check_ro __ARGS((int flags, char_u *name));
static int var_check_fixed __ARGS((int flags, char_u *name));
static int tv_check_lock __ARGS((int lock, char_u *name));
static void copy_tv __ARGS((typval_T *from, typval_T *to));
static int item_copy __ARGS((typval_T *from, typval_T *to, int deep, int copyID));
static char_u *find_option_end __ARGS((char_u **arg, int *opt_flags));
static char_u *trans_function_name __ARGS((char_u **pp, int skip, int flags, funcdict_T *fd));
@@ -6155,7 +6153,7 @@ list_append(l, item)
* Append typval_T "tv" to the end of list "l".
* Return FAIL when out of memory.
*/
static int
int
list_append_tv(l, tv)
list_T *l;
typval_T *tv;
@@ -6475,6 +6473,7 @@ list_join(gap, l, sep, echo, copyID)
vim_free(tofree);
if (s == NULL)
return FAIL;
line_breakcheck();
}
return OK;
}
@@ -6811,7 +6810,7 @@ dict_free(d, recurse)
* Note that the value of the item "di_tv" still needs to be initialized!
* Returns NULL when out of memory.
*/
static dictitem_T *
dictitem_T *
dictitem_alloc(key)
char_u *key;
{
@@ -6867,7 +6866,7 @@ dictitem_remove(dict, item)
/*
* Free a dict item. Also clears the value.
*/
static void
void
dictitem_free(item)
dictitem_T *item;
{
@@ -6947,7 +6946,7 @@ dict_copy(orig, deep, copyID)
* Add item "item" to Dictionary "d".
* Returns FAIL when out of memory and when key already existed.
*/
static int
int
dict_add(d, item)
dict_T *d;
dictitem_T *item;
@@ -7698,6 +7697,9 @@ static struct fst
{"mkdir", 1, 3, f_mkdir},
#endif
{"mode", 0, 1, f_mode},
#ifdef FEAT_MZSCHEME
{"mzeval", 1, 1, f_mzeval},
#endif
{"nextnonblank", 1, 1, f_nextnonblank},
{"nr2char", 1, 1, f_nr2char},
{"pathshorten", 1, 1, f_pathshorten},
@@ -13590,6 +13592,23 @@ f_mode(argvars, rettv)
rettv->v_type = VAR_STRING;
}
#ifdef FEAT_MZSCHEME
/*
* "mzeval()" function
*/
static void
f_mzeval(argvars, rettv)
typval_T *argvars;
typval_T *rettv;
{
char_u *str;
char_u buf[NUMBUFLEN];
str = get_tv_string_buf(&argvars[0], buf);
do_mzeval(str, rettv);
}
#endif
/*
* "nextnonblank()" function
*/
@@ -19273,7 +19292,7 @@ tv_check_lock(lock, name)
* It is OK for "from" and "to" to point to the same item. This is used to
* make a copy later.
*/
static void
void
copy_tv(from, to)
typval_T *from;
typval_T *to;

View File

@@ -2496,14 +2496,15 @@ ex_compiler(eap)
* To remain backwards compatible "current_compiler" is always
* used. A user's compiler plugin may set it, the distributed
* plugin will then skip the settings. Afterwards set
* "b:current_compiler" and restore "current_compiler". */
old_cur_comp = get_var_value((char_u *)"current_compiler");
* "b:current_compiler" and restore "current_compiler".
* Explicitly prepend "g:" to make it work in a function. */
old_cur_comp = get_var_value((char_u *)"g:current_compiler");
if (old_cur_comp != NULL)
old_cur_comp = vim_strsave(old_cur_comp);
do_cmdline_cmd((char_u *)
"command -nargs=* CompilerSet setlocal <args>");
}
do_unlet((char_u *)"current_compiler", TRUE);
do_unlet((char_u *)"g:current_compiler", TRUE);
do_unlet((char_u *)"b:current_compiler", TRUE);
sprintf((char *)buf, "compiler/%s.vim", eap->arg);
@@ -2514,7 +2515,7 @@ ex_compiler(eap)
do_cmdline_cmd((char_u *)":delcommand CompilerSet");
/* Set "b:current_compiler" from "current_compiler". */
p = get_var_value((char_u *)"current_compiler");
p = get_var_value((char_u *)"g:current_compiler");
if (p != NULL)
set_internal_string_var((char_u *)"b:current_compiler", p);
@@ -2523,12 +2524,12 @@ ex_compiler(eap)
{
if (old_cur_comp != NULL)
{
set_internal_string_var((char_u *)"current_compiler",
set_internal_string_var((char_u *)"g:current_compiler",
old_cur_comp);
vim_free(old_cur_comp);
}
else
do_unlet((char_u *)"current_compiler", TRUE);
do_unlet((char_u *)"g:current_compiler", TRUE);
}
}
}
@@ -2801,20 +2802,35 @@ source_level(cookie)
static char_u *get_one_sourceline __ARGS((struct source_cookie *sp));
#if defined(WIN32) && defined(FEAT_CSCOPE)
#if (defined(WIN32) && defined(FEAT_CSCOPE)) || defined(HAVE_FD_CLOEXEC)
# define USE_FOPEN_NOINH
static FILE *fopen_noinh_readbin __ARGS((char *filename));
/*
* Special function to open a file without handle inheritance.
* When possible the handle is closed on exec().
*/
static FILE *
fopen_noinh_readbin(filename)
char *filename;
{
int fd_tmp = mch_open(filename, O_RDONLY | O_BINARY | O_NOINHERIT, 0);
int fd_tmp = mch_open(filename, O_RDONLY
# ifdef WIN32
O_BINARY | O_NOINHERIT
# endif
, 0);
if (fd_tmp == -1)
return NULL;
# ifdef HAVE_FD_CLOEXEC
{
int fdflags = fcntl(fd_tmp, F_GETFD);
if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0)
fcntl(fd_tmp, F_SETFD, fdflags | FD_CLOEXEC);
}
# endif
return fdopen(fd_tmp, READBIN);
}
#endif
@@ -2894,7 +2910,7 @@ do_source(fname, check_other, is_vimrc)
apply_autocmds(EVENT_SOURCEPRE, fname_exp, fname_exp, FALSE, curbuf);
#endif
#if defined(WIN32) && defined(FEAT_CSCOPE)
#ifdef USE_FOPEN_NOINH
cookie.fp = fopen_noinh_readbin((char *)fname_exp);
#else
cookie.fp = mch_fopen((char *)fname_exp, READBIN);
@@ -2915,7 +2931,7 @@ do_source(fname, check_other, is_vimrc)
*p = '.';
else
*p = '_';
#if defined(WIN32) && defined(FEAT_CSCOPE)
#ifdef USE_FOPEN_NOINH
cookie.fp = fopen_noinh_readbin((char *)fname_exp);
#else
cookie.fp = mch_fopen((char *)fname_exp, READBIN);
@@ -3020,7 +3036,8 @@ do_source(fname, check_other, is_vimrc)
#endif
#ifdef STARTUPTIME
time_push(&tv_rel, &tv_start);
if (time_fd != NULL)
time_push(&tv_rel, &tv_start);
#endif
#ifdef FEAT_EVAL
@@ -3146,9 +3163,12 @@ do_source(fname, check_other, is_vimrc)
verbose_leave();
}
#ifdef STARTUPTIME
vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname);
time_msg((char *)IObuff, &tv_start);
time_pop(&tv_rel);
if (time_fd != NULL)
{
vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname);
time_msg((char *)IObuff, &tv_start);
time_pop(&tv_rel);
}
#endif
#ifdef FEAT_EVAL

View File

@@ -2193,7 +2193,6 @@ getexmodeline(promptc, cookie, indent)
{
if (ga_grow(&line_ga, 40) == FAIL)
break;
pend = (char_u *)line_ga.ga_data + line_ga.ga_len;
/* Get one character at a time. Don't use inchar(), it can't handle
* special characters. */
@@ -3314,7 +3313,7 @@ nextwild(xp, type, options)
WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE
|options, type);
vim_free(p1);
/* longest match: make sure it is not shorter (happens with :help */
/* longest match: make sure it is not shorter, happens with :help */
if (p2 != NULL && type == WILD_LONGEST)
{
for (j = 0; j < xp->xp_pattern_len; ++j)

View File

@@ -7072,8 +7072,8 @@ vim_tempname(extra_char)
*/
for (i = 0; i < (int)(sizeof(tempdirs) / sizeof(char *)); ++i)
{
size_t itmplen;
# ifndef HAVE_MKDTEMP
size_t itmplen;
long nr;
long off;
# endif
@@ -7091,7 +7091,6 @@ vim_tempname(extra_char)
else
# endif
add_pathsep(itmp);
itmplen = STRLEN(itmp);
# ifdef HAVE_MKDTEMP
/* Leave room for filename */
@@ -7104,6 +7103,7 @@ vim_tempname(extra_char)
* otherwise it doesn't matter. The use of mkdir() avoids any
* security problems because of the predictable number. */
nr = (mch_get_pid() + (long)time(NULL)) % 1000000L;
itmplen = STRLEN(itmp);
/* Try up to 10000 different values until we find a name that
* doesn't exist. */

View File

@@ -3239,8 +3239,8 @@ foldlevelMarker(flp)
flp->lvl = n;
flp->lvl_next = n - 1;
/* never start a fold with an end marker */
if (flp->lvl_next > flp->lvl)
flp->lvl_next = flp->lvl;
if (flp->lvl_next > start_lvl)
flp->lvl_next = start_lvl;
}
}
else

View File

@@ -2069,7 +2069,7 @@ cs_print_tags_priv(matches, cntxts, num_matches)
continue;
(void)strcpy(tbuf, matches[idx]);
if ((fname = strtok(tbuf, (const char *)"\t")) == NULL)
if (strtok(tbuf, (const char *)"\t") == NULL)
continue;
if ((fname = strtok(NULL, (const char *)"\t")) == NULL)
continue;

View File

@@ -170,6 +170,8 @@ static int mzscheme_init(void);
#ifdef FEAT_EVAL
static Scheme_Object *vim_to_mzscheme(typval_T *vim_value, int depth,
Scheme_Hash_Table *visited);
static int mzscheme_to_vim(Scheme_Object *obj, typval_T *tv, int depth,
Scheme_Hash_Table *visited);
#endif
#ifdef MZ_PRECISE_GC
@@ -2733,6 +2735,225 @@ vim_to_mzscheme(typval_T *vim_value, int depth, Scheme_Hash_Table *visited)
MZ_GC_UNREG();
return result;
}
static int
mzscheme_to_vim(Scheme_Object *obj, typval_T *tv, int depth,
Scheme_Hash_Table *visited)
{
int status = OK;
typval_T *found;
MZ_GC_CHECK();
if (depth > 100) /* limit the deepest recursion level */
{
tv->v_type = VAR_NUMBER;
tv->vval.v_number = 0;
return FAIL;
}
found = (typval_T *)scheme_hash_get(visited, obj);
if (found != NULL)
copy_tv(found, tv);
else if (SCHEME_VOIDP(obj))
{
tv->v_type = VAR_NUMBER;
tv->vval.v_number = 0;
}
else if (SCHEME_INTP(obj))
{
tv->v_type = VAR_NUMBER;
tv->vval.v_number = SCHEME_INT_VAL(obj);
}
else if (SCHEME_BOOLP(obj))
{
tv->v_type = VAR_NUMBER;
tv->vval.v_number = SCHEME_TRUEP(obj);
}
# ifdef FEAT_FLOAT
else if (SCHEME_DBLP(obj))
{
tv->v_type = VAR_FLOAT;
tv->vval.v_float = SCHEME_DBL_VAL(obj);
}
# endif
else if (SCHEME_STRINGP(obj))
{
tv->v_type = VAR_STRING;
tv->vval.v_string = vim_strsave((char_u *)SCHEME_STR_VAL(obj));
}
else if (SCHEME_VECTORP(obj) || SCHEME_NULLP(obj)
|| SCHEME_PAIRP(obj) || SCHEME_MUTABLE_PAIRP(obj))
{
list_T *list = list_alloc();
if (list == NULL)
status = FAIL;
else
{
int i;
Scheme_Object *curr = NULL;
Scheme_Object *cval = NULL;
/* temporary var to hold current element of vectors and pairs */
typval_T *v;
MZ_GC_DECL_REG(2);
MZ_GC_VAR_IN_REG(0, curr);
MZ_GC_VAR_IN_REG(1, cval);
MZ_GC_REG();
tv->v_type = VAR_LIST;
tv->vval.v_list = list;
++list->lv_refcount;
v = (typval_T *)alloc(sizeof(typval_T));
if (v == NULL)
status = FAIL;
else
{
/* add the value in advance to allow handling of self-referencial
* data structures */
typval_T *visited_tv = (typval_T *)alloc(sizeof(typval_T));
copy_tv(tv, visited_tv);
scheme_hash_set(visited, obj, (Scheme_Object *)visited_tv);
if (SCHEME_VECTORP(obj))
{
for (i = 0; i < SCHEME_VEC_SIZE(obj); ++i)
{
cval = SCHEME_VEC_ELS(obj)[i];
status = mzscheme_to_vim(cval, v, depth + 1, visited);
if (status == FAIL)
break;
status = list_append_tv(list, v);
clear_tv(v);
if (status == FAIL)
break;
}
}
else if (SCHEME_PAIRP(obj) || SCHEME_MUTABLE_PAIRP(obj))
{
for (curr = obj;
SCHEME_PAIRP(curr) || SCHEME_MUTABLE_PAIRP(curr);
curr = SCHEME_CDR(curr))
{
cval = SCHEME_CAR(curr);
status = mzscheme_to_vim(cval, v, depth + 1, visited);
if (status == FAIL)
break;
status = list_append_tv(list, v);
clear_tv(v);
if (status == FAIL)
break;
}
/* impoper list not terminated with null
* need to handle the last element */
if (status == OK && !SCHEME_NULLP(curr))
{
status = mzscheme_to_vim(cval, v, depth + 1, visited);
if (status == OK)
{
status = list_append_tv(list, v);
clear_tv(v);
}
}
}
/* nothing to do for scheme_null */
vim_free(v);
}
MZ_GC_UNREG();
}
}
else if (SCHEME_HASHTP(obj))
{
int i;
dict_T *dict;
Scheme_Object *key = NULL;
Scheme_Object *val = NULL;
MZ_GC_DECL_REG(2);
MZ_GC_VAR_IN_REG(0, key);
MZ_GC_VAR_IN_REG(1, val);
MZ_GC_REG();
dict = dict_alloc();
if (dict == NULL)
status = FAIL;
else
{
typval_T *visited_tv = (typval_T *)alloc(sizeof(typval_T));
tv->v_type = VAR_DICT;
tv->vval.v_dict = dict;
++dict->dv_refcount;
copy_tv(tv, visited_tv);
scheme_hash_set(visited, obj, (Scheme_Object *)visited_tv);
for (i = 0; i < ((Scheme_Hash_Table *)obj)->size; ++i)
{
if (((Scheme_Hash_Table *) obj)->vals[i] != NULL)
{
/* generate item for `diplay'ed Scheme key */
dictitem_T *item = dictitem_alloc((char_u *)string_to_line(
((Scheme_Hash_Table *) obj)->keys[i]));
/* convert Scheme val to Vim and add it to the dict */
if (mzscheme_to_vim(((Scheme_Hash_Table *) obj)->vals[i],
&item->di_tv, depth + 1, visited) == FAIL
|| dict_add(dict, item) == FAIL)
{
dictitem_free(item);
status = FAIL;
break;
}
}
}
}
MZ_GC_UNREG();
}
else
{
/* `display' any other value to string */
tv->v_type = VAR_STRING;
tv->vval.v_string = (char_u *)string_to_line(obj);
}
return status;
}
void
do_mzeval(char_u *str, typval_T *rettv)
{
int i;
Scheme_Object *ret = NULL;
Scheme_Hash_Table *visited = NULL;
MZ_GC_DECL_REG(2);
MZ_GC_VAR_IN_REG(0, ret);
MZ_GC_VAR_IN_REG(0, visited);
MZ_GC_REG();
if (mzscheme_init())
{
MZ_GC_UNREG();
return;
}
MZ_GC_CHECK();
visited = scheme_make_hash_table(SCHEME_hash_ptr);
MZ_GC_CHECK();
if (eval_with_exn_handling(str, do_eval, &ret) == OK)
mzscheme_to_vim(ret, rettv, 1, visited);
for (i = 0; i < visited->size; ++i)
{
/* free up remembered objects */
if (visited->vals[i] != NULL)
{
free_tv((typval_T *)visited->vals[i]);
}
}
MZ_GC_UNREG();
}
#endif
/*

File diff suppressed because it is too large Load Diff

View File

@@ -70,7 +70,8 @@ static long pos2off __ARGS((buf_T *, pos_T *));
static pos_T *off2pos __ARGS((buf_T *, long));
static pos_T *get_off_or_lnum __ARGS((buf_T *buf, char_u **argp));
static long get_buf_size __ARGS((buf_T *));
static void netbeans_keystring __ARGS((int key, char *keystr));
static int netbeans_keystring __ARGS((char_u *keystr));
static void postpone_keycommand __ARGS((char_u *keystr));
static void special_keys __ARGS((char_u *args));
static void netbeans_connect __ARGS((void));
@@ -502,7 +503,7 @@ getConnInfo(char *file, char **host, char **port, char **auth)
struct keyqueue
{
int key;
char_u *keystr;
struct keyqueue *next;
struct keyqueue *prev;
};
@@ -514,13 +515,17 @@ static keyQ_T keyHead; /* dummy node, header for circular queue */
/*
* Queue up key commands sent from netbeans.
* We store the string, because it may depend on the global mod_mask and
* :nbkey doesn't have a key number.
*/
static void
postpone_keycommand(int key)
postpone_keycommand(char_u *keystr)
{
keyQ_T *node;
node = (keyQ_T *)alloc(sizeof(keyQ_T));
if (node == NULL)
return; /* out of memory, drop the key */
if (keyHead.next == NULL) /* initialize circular queue */
{
@@ -534,7 +539,7 @@ postpone_keycommand(int key)
keyHead.prev->next = node;
keyHead.prev = node;
node->key = key;
node->keystr = vim_strsave(keystr);
}
/*
@@ -543,15 +548,20 @@ postpone_keycommand(int key)
static void
handle_key_queue(void)
{
while (keyHead.next && keyHead.next != &keyHead)
int postponed = FALSE;
while (!postponed && keyHead.next && keyHead.next != &keyHead)
{
/* first, unlink the node */
keyQ_T *node = keyHead.next;
keyHead.next = node->next;
node->next->prev = node->prev;
/* now, send the keycommand */
netbeans_keycommand(node->key);
/* Now, send the keycommand. This may cause it to be postponed again
* and change keyHead. */
if (node->keystr != NULL)
postponed = !netbeans_keystring(node->keystr);
vim_free(node->keystr);
/* Finally, dispose of the node */
vim_free(node);
@@ -873,7 +883,7 @@ nb_parse_cmd(char_u *cmd)
{
#ifdef NBDEBUG
/*
* This happens because the ExtEd can send a cammand or 2 after
* This happens because the ExtEd can send a command or 2 after
* doing a stopDocumentListen command. It doesn't harm anything
* so I'm disabling it except for debugging.
*/
@@ -1174,7 +1184,7 @@ nb_quote(char_u *txt)
break;
}
}
*q++ = '\0';
*q = '\0';
return buf;
}
@@ -2495,7 +2505,7 @@ nb_do_cmd(
}
else
{
nbdebug((" Buffer has no changes!\n"));
nbdebug((" Buffer has no changes!\n"));
}
/* =====================================================================*/
}
@@ -2658,7 +2668,7 @@ special_keys(char_u *args)
ex_nbkey(eap)
exarg_T *eap;
{
netbeans_keystring(0, (char *)eap->arg);
(void)netbeans_keystring(eap->arg);
}
@@ -2680,7 +2690,7 @@ nb_init_graphics(void)
}
/*
* Convert key to netbeans name.
* Convert key to netbeans name. This uses the global "mod_mask".
*/
static void
netbeans_keyname(int key, char *buf)
@@ -3070,7 +3080,7 @@ netbeans_removed(
}
/*
* Send netbeans an unmodufied command.
* Send netbeans an unmodified command.
*/
void
netbeans_unmodified(buf_T *bufp UNUSED)
@@ -3127,23 +3137,27 @@ netbeans_button_release(int button)
/*
* Send a keypress event back to netbeans. This usually simulates some
* kind of function key press. This function operates on a key code.
* Return TRUE when the key was sent, FALSE when the command has been
* postponed.
*/
void
int
netbeans_keycommand(int key)
{
char keyName[60];
netbeans_keyname(key, keyName);
netbeans_keystring(key, keyName);
return netbeans_keystring((char_u *)keyName);
}
/*
* Send a keypress event back to netbeans. This usually simulates some
* kind of function key press. This function operates on a key string.
* Return TRUE when the key was sent, FALSE when the command has been
* postponed.
*/
static void
netbeans_keystring(int key, char *keyName)
static int
netbeans_keystring(char_u *keyName)
{
char buf[2*MAXPATHL];
int bufno = nb_getbufno(curbuf);
@@ -3151,7 +3165,7 @@ netbeans_keystring(int key, char *keyName)
char_u *q;
if (!haveConnection)
return;
return TRUE;
if (bufno == -1)
@@ -3160,7 +3174,7 @@ netbeans_keystring(int key, char *keyName)
q = curbuf->b_ffname == NULL ? (char_u *)""
: nb_quote(curbuf->b_ffname);
if (q == NULL)
return;
return TRUE;
vim_snprintf(buf, sizeof(buf), "0:fileOpened=%d \"%s\" %s %s\n", 0,
q,
"T", /* open in NetBeans */
@@ -3170,9 +3184,8 @@ netbeans_keystring(int key, char *keyName)
nbdebug(("EVT: %s", buf));
nb_send(buf, "netbeans_keycommand");
if (key > 0)
postpone_keycommand(key);
return;
postpone_keycommand(keyName);
return FALSE;
}
/* sync the cursor position */
@@ -3198,6 +3211,7 @@ netbeans_keystring(int key, char *keyName)
off, (long)curwin->w_cursor.lnum, (long)curwin->w_cursor.col);
nbdebug(("EVT: %s", buf));
nb_send(buf, "netbeans_keycommand");
return TRUE;
}
@@ -3366,7 +3380,7 @@ netbeans_gutter_click(linenr_T lnum)
/*
* Add a sign of the reqested type at the requested location.
* Add a sign of the requested type at the requested location.
*
* Reverse engineering:
* Apparently an annotation is defined the first time it is used in a buffer.

View File

@@ -5406,6 +5406,7 @@ nv_ident(cap)
int n = 0; /* init for GCC */
int cmdchar;
int g_cmd; /* "g" command */
int tag_cmd = FALSE;
char_u *aux_ptr;
int isman;
int isman_s;
@@ -5515,6 +5516,7 @@ nv_ident(cap)
break;
case ']':
tag_cmd = TRUE;
#ifdef FEAT_CSCOPE
if (p_cst)
STRCPY(buf, "cstag ");
@@ -5526,10 +5528,14 @@ nv_ident(cap)
default:
if (curbuf->b_help)
STRCPY(buf, "he! ");
else if (g_cmd)
STRCPY(buf, "tj ");
else
sprintf((char *)buf, "%ldta ", cap->count0);
{
tag_cmd = TRUE;
if (g_cmd)
STRCPY(buf, "tj ");
else
sprintf((char *)buf, "%ldta ", cap->count0);
}
}
/*
@@ -5562,8 +5568,10 @@ nv_ident(cap)
aux_ptr = (char_u *)(p_magic ? "/.*~[^$\\" : "/^$\\");
else if (cmdchar == '#')
aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\");
else
else if (tag_cmd)
/* Don't escape spaces and Tabs in a tag with a backslash */
aux_ptr = (char_u *)"\\|\"\n[";
else
aux_ptr = (char_u *)"\\|\"\n*?[";
p = buf + STRLEN(buf);

View File

@@ -5591,13 +5591,13 @@ x11_export_final_selection()
*/
if (has_mbyte)
{
char_u *conv_str = str;
vimconv_T vc;
vc.vc_type = CONV_NONE;
if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK)
{
int intlen = len;
int intlen = len;
char_u *conv_str;
conv_str = string_convert(&vc, str, &intlen);
len = intlen;

View File

@@ -47,10 +47,14 @@ void list_unref __ARGS((list_T *l));
void list_free __ARGS((list_T *l, int recurse));
dictitem_T *dict_lookup __ARGS((hashitem_T *hi));
char_u *list_find_str __ARGS((list_T *l, long idx));
int list_append_tv __ARGS((list_T *l, typval_T *tv));
int list_append_dict __ARGS((list_T *list, dict_T *dict));
int list_append_string __ARGS((list_T *l, char_u *str, int len));
int garbage_collect __ARGS((void));
dict_T *dict_alloc __ARGS((void));
dictitem_T *dictitem_alloc __ARGS((char_u *key));
void dictitem_free __ARGS((dictitem_T *item));
int dict_add __ARGS((dict_T *d, dictitem_T *item));
int dict_add_nr_str __ARGS((dict_T *d, char *key, long nr, char_u *str));
char_u *get_dict_string __ARGS((dict_T *d, char_u *key, int save));
long get_dict_number __ARGS((dict_T *d, char_u *key));
@@ -77,6 +81,7 @@ char_u *get_var_value __ARGS((char_u *name));
void new_script_vars __ARGS((scid_T id));
void init_var_dict __ARGS((dict_T *dict, dictitem_T *dict_var));
void vars_clear __ARGS((hashtab_T *ht));
void copy_tv __ARGS((typval_T *from, typval_T *to));
void ex_echo __ARGS((exarg_T *eap));
void ex_echohl __ARGS((exarg_T *eap));
void ex_execute __ARGS((exarg_T *eap));

View File

@@ -15,4 +15,5 @@ void mzvim_reset_timer __ARGS((void));
void *mzvim_eval_string __ARGS((char_u *str));
int mzthreads_allowed __ARGS((void));
void mzscheme_main __ARGS((void));
void do_mzeval __ARGS((char_u *str, typval_T *rettv));
/* vim: set ft=c : */

View File

@@ -16,7 +16,7 @@ void netbeans_inserted __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, char_u
void netbeans_removed __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, long len));
void netbeans_unmodified __ARGS((buf_T *bufp));
void netbeans_button_release __ARGS((int button));
void netbeans_keycommand __ARGS((int key));
int netbeans_keycommand __ARGS((int key));
void netbeans_save_buffer __ARGS((buf_T *bufp));
void netbeans_deleted_all_lines __ARGS((buf_T *bufp));
int netbeans_is_guarded __ARGS((linenr_T top, linenr_T bot));

View File

@@ -1899,7 +1899,6 @@ qf_list(eap)
int i;
int idx1 = 1;
int idx2 = -1;
int need_return = TRUE;
char_u *arg = eap->arg;
int all = eap->forceit; /* if not :cl!, only show
recognised errors */
@@ -1939,13 +1938,9 @@ qf_list(eap)
{
if ((qfp->qf_valid || all) && idx1 <= i && i <= idx2)
{
if (need_return)
{
msg_putchar('\n');
if (got_int)
break;
need_return = FALSE;
}
msg_putchar('\n');
if (got_int)
break;
fname = NULL;
if (qfp->qf_fnum != 0
@@ -1988,7 +1983,6 @@ qf_list(eap)
IObuff, IOSIZE);
msg_prt_line(IObuff, FALSE);
out_flush(); /* show one line at a time */
need_return = TRUE;
}
qfp = qfp->qf_next;

View File

@@ -10306,7 +10306,10 @@ spell_suggest(count)
/* Figure out if the word should be capitalised. */
need_cap = check_need_cap(curwin->w_cursor.lnum, curwin->w_cursor.col);
line = ml_get_curline();
/* Make a copy of current line since autocommands may free the line. */
line = vim_strsave(ml_get_curline());
if (line == NULL)
goto skip;
/* Get the list of suggestions. Limit to 'lines' - 2 or the number in
* 'spellsuggest', whatever is smaller. */
@@ -10470,6 +10473,8 @@ spell_suggest(count)
curwin->w_cursor = prev_cursor;
spell_find_cleanup(&sug);
skip:
vim_free(line);
}
/*
@@ -10931,7 +10936,7 @@ spell_suggest_intern(su, interactive)
rescore_suggestions(su);
/*
* While going throught the soundfold tree "su_maxscore" is the score
* While going through the soundfold tree "su_maxscore" is the score
* for the soundfold word, limits the changes that are being tried,
* and "su_sfmaxscore" the rescored score, which is set by
* cleanup_suggestions().
@@ -11415,7 +11420,7 @@ suggest_trie_walk(su, lp, fword, soundfold)
char_u tword[MAXWLEN]; /* good word collected so far */
trystate_T stack[MAXWLEN];
char_u preword[MAXWLEN * 3]; /* word found with proper case;
* concatanation of prefix compound
* concatenation of prefix compound
* words and split word. NUL terminated
* when going deeper but not when coming
* back. */

View File

@@ -4167,7 +4167,6 @@ clear_keywtab(ht)
if (!HASHITEM_EMPTY(hi))
{
--todo;
kp = HI2KE(hi);
for (kp = HI2KE(hi); kp != NULL; kp = kp_next)
{
kp_next = kp->ke_next;

View File

@@ -29,7 +29,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test42.out test52.out test65.out test66.out test67.out \
test68.out test69.out
SCRIPTS32 = test50.out
SCRIPTS32 = test50.out test70.out
SCRIPTS_GUI = test16.out

View File

@@ -48,7 +48,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test42.out test52.out test65.out test66.out test67.out \
test68.out test69.out
SCRIPTS32 = test50.out
SCRIPTS32 = test50.out test70.out
SCRIPTS_GUI = test16.out
@@ -78,6 +78,7 @@ clean:
-$(DEL) small.vim
-$(DEL) tiny.vim
-$(DEL) mbyte.vim
-$(DEL) mzscheme.vim
-$(DEL) X*
-$(DEL) viminfo

View File

@@ -23,7 +23,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test54.out test55.out test56.out test57.out test58.out \
test59.out test60.out test61.out test62.out test63.out \
test64.out test65.out test66.out test67.out test68.out \
test69.out
test69.out test70.out
SCRIPTS_GUI = test16.out
@@ -44,10 +44,10 @@ report:
$(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
clean:
-rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim test.ok X* valgrind.pid* viminfo
-rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* valgrind.pid* viminfo
test1.out: test1.in
-rm -f $*.failed tiny.vim small.vim mbyte.vim test.ok X* viminfo
-rm -f $*.failed tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* viminfo
$(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in
@/bin/sh -c "if diff test.out $*.ok; \
then mv -f test.out $*.out; \

View File

@@ -32,11 +32,11 @@ gui: newlog $Scripts $ScriptsGUI
$Scripts $ScriptsGUI: $VimProg
clean:
:del {r}{force} *.out test.log tiny.vim small.vim mbyte.vim test.ok X*
:del {r}{force} *.out test.log tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X*
# test1 is special, it checks for features
test1.out: test1.in
:del {force} test1.failed tiny.vim small.vim mbyte.vim
:del {force} test1.failed tiny.vim small.vim mbyte.vim mzscheme.vim
:sys {i} $VimProg -u unix.vim -U NONE --noplugin -s dotest.in test1.in
@if os.system("diff test.out test1.ok") != 0:
:error test1 FAILED - Something basic is wrong

View File

@@ -13,6 +13,7 @@ set like small.vim above. tiny.vim is sourced by tests that require the
If Vim was not compiled with the +multi_byte feature, the mbyte.vim script will be set like small.vim above. mbyte.vim is sourced by tests that require the
+multi_byte feature.
Similar logic is applied to the +mzscheme feature, using mzscheme.vim.
STARTTEST
:" Write a single line to test.out to check if testing works at all.
@@ -25,8 +26,11 @@ ae! test.ok
w! test.out
qa!
:w! mbyte.vim
:w! mzscheme.vim
:" If +multi_byte feature supported, make mbyte.vim empty.
:if has("multi_byte") | sp another | w! mbyte.vim | q | endif
:" If +mzscheme feature supported, make mzscheme.vim empty.
:if has("mzscheme") | sp another | w! mzscheme.vim | q | endif
:" If +eval feature supported quit here, leaving tiny.vim and small.vim empty.
:" Otherwise write small.vim to skip the test.
:if 1 | q! | endif

53
src/testdir/test70.in Normal file
View File

@@ -0,0 +1,53 @@
Smoke test for MzScheme interface and mzeval() function
STARTTEST
:so mzscheme.vim
:set nocompatible viminfo+=nviminfo
:function! MzRequire()
:redir => l:mzversion
:mz (version)
:redir END
:if strpart(l:mzversion, 1, 1) < "4"
:" MzScheme versions < 4.x:
:mz (require (prefix vim- vimext))
:else
:" newer versions:
:mz (require (prefix-in vim- 'vimext))
:mz (require r5rs)
:endif
:endfunction
:silent call MzRequire()
:mz (define l '("item0" "dictionary with list OK" "item2"))
:mz (define h (make-hash))
:mz (hash-set! h "list" l)
/^1
:" change buffer contents
:mz (vim-set-buff-line (vim-eval "line('.')") "1 changed line 1")
:" scalar test
:let tmp_string = mzeval('"string"')
:let tmp_1000 = mzeval('1000')
:if tmp_string . tmp_1000 == "string1000"
:let scalar_res = "OK"
:else
:let scalar_res = "FAILED"
:endif
:call append(search("^1"), "scalar test " . scalar_res)
:" dictionary containing a list
:let tmp = mzeval("h")["list"][1]
:/^2/put =tmp
:" circular list (at the same time test lists containing lists)
:mz (set-car! (cddr l) l)
:let l2 = mzeval("h")["list"]
:if l2[2] == l2
:let res = "OK"
:else
:let res = "FAILED"
:endif
:call setline(search("^3"), "circular test " . res)
:?^1?,$w! test.out
:qa!
ENDTEST
1 line 1
2 line 2
3 line 3

5
src/testdir/test70.ok Normal file
View File

@@ -0,0 +1,5 @@
1 changed line 1
scalar test OK
2 line 2
dictionary with list OK
circular test OK

View File

@@ -2383,7 +2383,7 @@ yank_cut_buffer0(dpy, cbd)
* 'enc' anyway. */
if (has_mbyte)
{
char_u *conv_buf = buffer;
char_u *conv_buf;
vimconv_T vc;
vc.vc_type = CONV_NONE;

View File

@@ -681,6 +681,28 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
340,
/**/
339,
/**/
338,
/**/
337,
/**/
336,
/**/
335,
/**/
334,
/**/
333,
/**/
332,
/**/
331,
/**/
330,
/**/
329,
/**/