1
0
forked from aniani/vim

updated for version 7.0g02

This commit is contained in:
Bram Moolenaar
2006-05-03 21:26:49 +00:00
parent c05f93ffba
commit 9c102387af
21 changed files with 328 additions and 228 deletions

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.0g. Last change: 2006 May 01 *eval.txt* For Vim version 7.0g. Last change: 2006 May 03
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2345,9 +2345,14 @@ exists({expr}) The result is a Number, which is non-zero if {expr} is
< There must be no space between the symbol (&/$/*/#) and the < There must be no space between the symbol (&/$/*/#) and the
name. name.
Trailing characters that can't be part of the name are often Trailing characters that can't be part of the name are often
ignored, but don't depend on it. ignored, but don't depend on it, it may change in the future!
Note that the argument must be a string, not the name of the Example: >
variable itself! For example: > exists("*strftime()")
< This currently works, but it should really be: >
exists("*strftime")
< Note that the argument must be a string, not the name of the
variable itself. For example: >
exists(bufcount) exists(bufcount)
< This doesn't check for existence of the "bufcount" variable, < This doesn't check for existence of the "bufcount" variable,
but gets the value of "bufcount", and checks if that exists. but gets the value of "bufcount", and checks if that exists.

View File

@@ -1,4 +1,4 @@
*gui.txt* For Vim version 7.0g. Last change: 2006 Apr 02 *gui.txt* For Vim version 7.0g. Last change: 2006 May 03
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -588,12 +588,21 @@ The ":set ic" will not be echoed when using this menu. Messages from the
executed command are still given though. To shut them up too, add a ":silent" executed command are still given though. To shut them up too, add a ":silent"
in the executed command: > in the executed command: >
:menu <silent> Search.Header :exe ":silent normal /Header\r"<CR> :menu <silent> Search.Header :exe ":silent normal /Header\r"<CR>
< "<silent>" may also appear just after "<special>" or "<script>".
*:menu-<special>* *:menu-special*
Define a menu with <> notation for special keys, even though the "<" flag
may appear in 'cpoptions'. This is useful if the side effect of setting
'cpoptions' is not desired. Example: >
:menu <special> Search.Header /Header<CR>
"<special>" must appear as the very first argument to the ":menu" command or
just after "<silent>" or "<script>".
*:menu-<script>* *:menu-script* *:menu-<script>* *:menu-script*
The "to" part of the menu will be inspected for mappings. If you don't want The "to" part of the menu will be inspected for mappings. If you don't want
this, use the ":noremenu" command (or the similar one for a specific mode). this, use the ":noremenu" command (or the similar one for a specific mode).
If you do want to use script-local mappings, add "<script>" as the very first If you do want to use script-local mappings, add "<script>" as the very first
argument to the ":menu" command or after "<silent>". argument to the ":menu" command or just after "<silent>" or "<special>".
*menu-priority* *menu-priority*
You can give a priority to a menu. Menus with a higher priority go more to You can give a priority to a menu. Menus with a higher priority go more to

View File

@@ -1,4 +1,4 @@
*insert.txt* For Vim version 7.0g. Last change: 2006 May 01 *insert.txt* For Vim version 7.0g. Last change: 2006 May 03
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -919,6 +919,8 @@ Completion is done by a function that can be defined by the user with the
See below for how the function is called and an example |complete-functions|. See below for how the function is called and an example |complete-functions|.
For remarks about specific filetypes see |compl-omni-filetypes|. For remarks about specific filetypes see |compl-omni-filetypes|.
More completion scripts will appear, check www.vim.org. Currently there is a
first version for C++.
*i_CTRL-X_CTRL-O* *i_CTRL-X_CTRL-O*
CTRL-X CTRL-O Guess what kind of item is in front of the cursor and CTRL-X CTRL-O Guess what kind of item is in front of the cursor and
@@ -1272,32 +1274,21 @@ run |:make| command to detect formatting problems.
HTML flavor *html-flavor* HTML flavor *html-flavor*
Default HTML completion depends on filetype. For HTML files it is HTML The default HTML completion depends on the filetype. For HTML files it is
4.01 Transitional (&ft=='html'), for XHTML it is XHTML 1.0 Strict HTML 4.01 Transitional ('filetype' is "html"), for XHTML it is XHTML 1.0
(&ft=='xhtml'). Strict ('filetype' is "xhtml").
These are not the only HTML versions. To use another data file and still When doing completion outside of any other tag you will have possibility to
have benefits of custom completion for class, style, etc. attributes set choose DOCTYPE and the appropriate data file will be loaded and used for all
b:html_omni_flavor variable. Example (in .vimrc or filetype plugin next completions.
file): >
let g:html_omni_flavor = 'xhtml10s' More about format of data file in |xml-omni-datafile|. Some of the data files
may be found on the Vim website (|www|).
(Completion data file for HTML 4.01 Strict is also provided by Vim Note that b:html_omni_flavor may point to a file with any XML data. This
distribution.) makes possible to mix PHP (|ft-php-omni|) completion with any XML dialect
(assuming you have data file for it). Without setting that variable XHTML 1.0
Data for HTML completion will be read from 'autoload/xml/html10s.vim' file Strict will be used.
located somewhere in 'runtimepath'.
Note: HTML completion files are also located in 'autoload/xml'
directory.
More about format of data file in |xml-omni-datafile|. Some of data
files may in future be found on vim-online site (|www|).
Note that b:html_omni_flavor may point to file with any XML data. This
makes possible to mix PHP (|ft-php-omni|) completion with whatever XML
dialect (assuming you have data file for it).
JAVASCRIPT *ft-javascript-omni* JAVASCRIPT *ft-javascript-omni*
@@ -1486,86 +1477,100 @@ PHP code and SQL code at the same time.
XML *ft-xml-omni* XML *ft-xml-omni*
Vim 7 provides mechanism to context aware completion of XML files. It depends Vim 7 provides a mechanism for context aware completion of XML files. It
on special |xml-omni-datafile| and two commands: |:XMLns| and |:XMLent|. depends on a special |xml-omni-datafile| and two commands: |:XMLns| and
Features are: |:XMLent|. Features are:
- after "<" complete tag name depending on context (no div suggest - after "<" complete the tag name, depending on context
inside of an a tag) - inside of a tag complete proper attributes
- inside of tag complete proper attributes (no width attribute for an - when an attribute has a limited number of possible values help to complete
a tag)
- when attribute has limited number of possible values help to complete
them them
- complete names of entities (defined in |xml-omni-datafile| and in current - complete names of entities (defined in |xml-omni-datafile| and in the
file with "<!ENTITY" declarations current file with "<!ENTITY" declarations)
- when used after "</" CTRL-X CTRL-O will close the last opened tag - when used after "</" CTRL-X CTRL-O will close the last opened tag
Format of XML data file *xml-omni-datafile* Format of XML data file *xml-omni-datafile*
Vim distribution provides two data files as examples (xhtml10s.vim, xsl.vim) XML data files are stored in the "autoload/xml" directory in 'runtimepath'.
Vim distribution provides examples of data files in the
"$VIMRUNTIME/autoload/xml" directory. They have a meaningful name which will
be used in commands. It should be a unique name which will not create
conflicts. For example, the name xhtml10s.vim means it is the data file for
XHTML 1.0 Strict.
XML data files are stored in "autoload/xml" directory in 'runtimepath'. They Each file contains a variable with a name like g:xmldata_xhtml10s . It is
have meaningful name which will be used in commands. It should be unique name a compound from two parts:
which will not create conflicts in future. For example name xhtml10s.vim means
it is data file for XHTML 1.0 Strict.
File contains one variable with fixed name: g:xmldata_xhtml10s . It is 1. "g:xmldata_" general prefix, constant for all data files
compound from two parts: 2. "xhtml10s" the name of the file and the name of the described XML
dialect; it will be used as an argument for the |:XMLns|
1. "g:xmldata_" general prefix command
2. "xhtml10s" name of file and name of described XML dialect
Part two must be exactly the same as name of file. Part two must be exactly the same as name of file.
Variable is data structure in form of |Dictionary|. Keys are tag names and The variable is a |Dictionary|. Keys are tag names and each value is a two
values are two element |List|. First element of List is also List with names element |List|. The first element of the List is also a List with the names
of possible children, second element is |Dictionary| with names of attributes of possible children. The second element is a |Dictionary| with the names of
as keys and possible values of attributes as values. Example: > attributes as keys and the possible values of attributes as values. Example: >
let g:xmldata_crippledhtml = { let g:xmldata_crippled = {
\ "html": \ "vimxmlentities": ["amp", "lt", "gt", "apos", "quot"],
\ [ ["body", "head"], {"id": [], "xmlns": ["http://www.w3.org/1999/xhtml"], \ 'vimxmlroot': ['tag1'],
\ "lang": [], "xml:lang": [], "dir": ["ltr", "rtl"]}], \ 'tag1':
\ "script": \ [ ['childoftag1a', 'childoftag1b'], {'attroftag1a': [],
\ [ [], {"id": [], "charset": [], "type": ["text/javascript"], "src": [], \ 'attroftag1b': ['valueofattr1', 'valueofattr2']}],
\ "defer": ["BOOL"], "xml:space": ["preserve"]}], \ 'childoftag1a':
\ "meta": \ [ [], {'attrofchild': ['attrofchild']}],
\ [ [], {"id": [], "http-equiv": [], "name": [], "content": [], "scheme": \ 'childoftag1b':
\ [], "lang": [], "xml:lang": [], "dir": ["ltr", "rtl"]}] \ [ ['childoftag1a'], {'attrofchild': []}],
\ "vimxmlentities": ["amp", "lt", "gt", "apos", "quot"]},
\ "vimxmltaginfo": { \ "vimxmltaginfo": {
\ 'meta': ['/>', '']}, \ 'tag1': ['Menu info', 'Long information visible in preview window']},
\ "vimxmlattrinfo": { \ 'vimxmlattrinfo': {
\ 'http-equiv': ['ContentType', '']} \ 'attrofchild': ['Menu info', 'Long information visible in preview window']}}
This example should be put in "autoload/xml/crippledhtml.vim" file. This example would be put in the "autoload/xml/crippled.vim" file and could
help to write this file: >
In example are visible four special elements: <tag1 attroftag1b="valueofattr1">
<childoftag1a attrofchild>
&amp; &lt;
</childoftag1a>
<childoftag1b attrofchild="5">
<childoftag1a>
&gt; &apos; &quot;
</childoftag1a>
</childoftag1b>
</tag1>
1. "vimxmlentities" - special key with List containing entities of this XML In the example four special elements are visible:
1. "vimxmlentities" - a special key with List containing entities of this XML
dialect. dialect.
2. "BOOL" - value of attribute key showing if attribute should be inserted 2. If the list containing possible values of attributes has one element and
bare ("defer" vs. 'defer="'). It can be the only element of List of this element is equal to the name of the attribute this attribute will be
attribute values. treated as boolean and inserted as 'attrname' and not as 'attrname="'
3. "vimxmltaginfo" - special key with dictionary containing as key tag names, 3. "vimxmltaginfo" - a special key with a Dictionary containing tag
as value two element List for additional menu info and long description. names as keys and two element List as values, for additional menu info and
4. "vimxmlattrinfo" - special key with dictionary containing as key attribute the long description.
names, as value two element List for additional menu info and long 4. "vimxmlattrinfo" - special key with Dictionary containing attribute names
as keys and two element List as values, for additional menu info and long
description. description.
Note: Tag names in data file MUST not contain namespace description. Check Note: Tag names in the data file MUST not contain a namespace description.
xsl.vim for example. Check xsl.vim for an example.
Note: All data and functions are publicly available as global
variables/functions and can be used for personal editing functions.
DTD -> Vim *dtd2vim* DTD -> Vim *dtd2vim*
On |www| is script |dtd2vim| which parses DTD and creates XML data file On |www| is the script |dtd2vim| which parses DTD and creates an XML data file
for Vim XML omni completion. for Vim XML omni completion.
dtd2vim: http://www.vim.org/scripts/script.php?script_id=1462 dtd2vim: http://www.vim.org/scripts/script.php?script_id=1462
Check there and beginning of file for details of usage. Check the beginning of that file for usage details.
Script requires perl and: The script requires perl and:
perlSGML: http://savannah.nongnu.org/projects/perlsgml perlSGML: http://savannah.nongnu.org/projects/perlsgml
@@ -1574,12 +1579,12 @@ Commands
:XMLns {name} [{namespace}] *:XMLns* :XMLns {name} [{namespace}] *:XMLns*
Vim has to know which data file should be used and with which namespace. For Vim has to know which data file should be used and with which namespace. For
loading of data file and connecting data with prope namespace use |:XMLns| loading of the data file and connecting data with the proper namespace use
command. First (obligatory) argument is name of data (xhtml10s, xsl). Second |:XMLns| command. The first (obligatory) argument is the name of the data
argument is code of namespace (h, xsl). When used without second argument (xhtml10s, xsl). The second argument is the code of namespace (h, xsl). When
dialect will be used as default - without namespace declaration. For example used without a second argument the dialect will be used as default - without
to use XML completion in .xsl files: > namespace declaration. For example to use XML completion in .xsl files: >
:XMLns xhtml10s :XMLns xhtml10s
:XMLns xsl xsl :XMLns xsl xsl
@@ -1587,35 +1592,34 @@ to use XML completion in .xsl files: >
:XMLent {name} *:XMLent* :XMLent {name} *:XMLent*
By default entities will be completed from data file of default By default entities will be completed from the data file of the default
namespace. XMLent command should be used in case when there is no namespace. The XMLent command should be used in case when there is no default
default namespace: > namespace: >
:XMLent xhtml10s :XMLent xhtml10s
Usage Usage
While used in situation (after declarations from previous part, | is While used in this situation (after declarations from previous part, | is
cursor position): > cursor position): >
<| <|
Will complete to appropriate XHTML tag, and in this situation: > Will complete to an appropriate XHTML tag, and in this situation: >
<xsl:| <xsl:|
Will complete to appropriate XSL tag. Will complete to an appropriate XSL tag.
File xmlcomplete.vim provides through |autoload| mechanism
GetLastOpenTag function which can be used in XML files to get name of The script xmlcomplete.vim, provided through the |autoload| mechanism,
last open tag with (b:unaryTagsStack has to be defined): > has the xmlcomplete#GetLastOpenTag() function which can be used in XML files
to get the name of the last open tag (b:unaryTagsStack has to be defined): >
:echo xmlcomplete#GetLastOpenTag("b:unaryTagsStack") :echo xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
============================================================================== ==============================================================================
8. Insert mode commands *inserting* 8. Insert mode commands *inserting*

View File

@@ -1,4 +1,4 @@
*map.txt* For Vim version 7.0g. Last change: 2006 Apr 30 *map.txt* For Vim version 7.0g. Last change: 2006 May 03
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -157,8 +157,9 @@ type "a", then "bar" will get inserted.
1.2 SPECIAL ARGUMENTS *:map-arguments* 1.2 SPECIAL ARGUMENTS *:map-arguments*
"<buffer>", "<silent>", "<script>", "<expr>" and "<unique>" can be used in any "<buffer>", "<silent>", "<special>", "<script>", "<expr>" and "<unique>" can
order. They must appear right after the command, before any other arguments. be used in any order. They must appear right after the command, before any
other arguments.
*:map-local* *:map-<buffer>* *E224* *E225* *:map-local* *:map-<buffer>* *E224* *E225*
If the first argument to one of these commands is "<buffer>" it will apply to If the first argument to one of these commands is "<buffer>" it will apply to
@@ -185,6 +186,12 @@ Prompts will still be given, e.g., for inputdialog().
Using "<silent>" for an abbreviation is possible, but will cause redrawing of Using "<silent>" for an abbreviation is possible, but will cause redrawing of
the command line to fail. the command line to fail.
*:map-<special>* *:map-special*
Define a mapping with <> notation for special keys, even though the "<" flag
may appear in 'cpoptions'. This is useful if the side effect of setting
'cpoptions' is not desired. Example: >
:map <special> <F12> /Header<CR>
<
*:map-<script>* *:map-script* *:map-<script>* *:map-script*
If the first argument to one of these commands is "<script>" and it is used to If the first argument to one of these commands is "<script>" and it is used to
define a new mapping or abbreviation, the mapping will only remap characters define a new mapping or abbreviation, the mapping will only remap characters

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.0g. Last change: 2006 May 02 *options.txt* For Vim version 7.0g. Last change: 2006 May 03
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4792,6 +4792,8 @@ A jump table for the options with a short description can be found at |Q_op|.
completion with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O| completion with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O|
See |complete-functions| for an explanation of how the function is See |complete-functions| for an explanation of how the function is
invoked and what it should return. invoked and what it should return.
This option is usually set by a filetype plugin.
|:filetype-plugin-on|
*'operatorfunc'* *'opfunc'* *'operatorfunc'* *'opfunc'*

View File

@@ -2273,6 +2273,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:map-<expr> map.txt /*:map-<expr>* :map-<expr> map.txt /*:map-<expr>*
:map-<script> map.txt /*:map-<script>* :map-<script> map.txt /*:map-<script>*
:map-<silent> map.txt /*:map-<silent>* :map-<silent> map.txt /*:map-<silent>*
:map-<special> map.txt /*:map-<special>*
:map-<unique> map.txt /*:map-<unique>* :map-<unique> map.txt /*:map-<unique>*
:map-alt-keys map.txt /*:map-alt-keys* :map-alt-keys map.txt /*:map-alt-keys*
:map-arguments map.txt /*:map-arguments* :map-arguments map.txt /*:map-arguments*
@@ -2283,6 +2284,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:map-operator map.txt /*:map-operator* :map-operator map.txt /*:map-operator*
:map-script map.txt /*:map-script* :map-script map.txt /*:map-script*
:map-silent map.txt /*:map-silent* :map-silent map.txt /*:map-silent*
:map-special map.txt /*:map-special*
:map-special-chars map.txt /*:map-special-chars* :map-special-chars map.txt /*:map-special-chars*
:map-special-keys map.txt /*:map-special-keys* :map-special-keys map.txt /*:map-special-keys*
:map-undo map.txt /*:map-undo* :map-undo map.txt /*:map-undo*
@@ -2301,10 +2303,12 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:menu gui.txt /*:menu* :menu gui.txt /*:menu*
:menu-<script> gui.txt /*:menu-<script>* :menu-<script> gui.txt /*:menu-<script>*
:menu-<silent> gui.txt /*:menu-<silent>* :menu-<silent> gui.txt /*:menu-<silent>*
:menu-<special> gui.txt /*:menu-<special>*
:menu-disable gui.txt /*:menu-disable* :menu-disable gui.txt /*:menu-disable*
:menu-enable gui.txt /*:menu-enable* :menu-enable gui.txt /*:menu-enable*
:menu-script gui.txt /*:menu-script* :menu-script gui.txt /*:menu-script*
:menu-silent gui.txt /*:menu-silent* :menu-silent gui.txt /*:menu-silent*
:menu-special gui.txt /*:menu-special*
:menut mlang.txt /*:menut* :menut mlang.txt /*:menut*
:menutrans mlang.txt /*:menutrans* :menutrans mlang.txt /*:menutrans*
:menutranslate mlang.txt /*:menutranslate* :menutranslate mlang.txt /*:menutranslate*

View File

@@ -4,80 +4,72 @@
" "
" Define Mac-standard keyboard shortcuts. " Define Mac-standard keyboard shortcuts.
" Save and restore compatible mode. " We don't change 'cpoptions' here, because it would not be set properly when
let s:save_cpo = &cpo " a .vimrc file is found later. Thus don't use line continuation and use
set cpo&vim " <special> in mappings.
nnoremap <D-n> :confirm enew<CR> nnoremap <special> <D-n> :confirm enew<CR>
vmap <D-n> <Esc><D-n>gv vmap <special> <D-n> <Esc><D-n>gv
imap <D-n> <C-O><D-n> imap <special> <D-n> <C-O><D-n>
cmap <D-n> <C-C><D-n> cmap <special> <D-n> <C-C><D-n>
omap <D-n> <Esc><D-n> omap <special> <D-n> <Esc><D-n>
nnoremap <D-o> :browse confirm e<CR> nnoremap <special> <D-o> :browse confirm e<CR>
vmap <D-o> <Esc><D-o>gv vmap <special> <D-o> <Esc><D-o>gv
imap <D-o> <C-O><D-o> imap <special> <D-o> <C-O><D-o>
cmap <D-o> <C-C><D-o> cmap <special> <D-o> <C-C><D-o>
omap <D-o> <Esc><D-o> omap <special> <D-o> <Esc><D-o>
nnoremap <silent> <D-w> :if winheight(2) < 0 <Bar> nnoremap <silent> <special> <D-w> :if winheight(2) < 0 <Bar> confirm enew <Bar> else <Bar> confirm close <Bar> endif<CR>
\ confirm enew <Bar> vmap <special> <D-w> <Esc><D-w>gv
\ else <Bar> imap <special> <D-w> <C-O><D-w>
\ confirm close <Bar> cmap <special> <D-w> <C-C><D-w>
\ endif<CR> omap <special> <D-w> <Esc><D-w>
vmap <D-w> <Esc><D-w>gv
imap <D-w> <C-O><D-w>
cmap <D-w> <C-C><D-w>
omap <D-w> <Esc><D-w>
nnoremap <silent> <D-s> :if expand("%") == ""<Bar>browse confirm w<Bar> nnoremap <silent> <special> <D-s> :if expand("%") == ""<Bar>browse confirm w<Bar> else<Bar>confirm w<Bar>endif<CR>
\ else<Bar>confirm w<Bar>endif<CR> vmap <special> <D-s> <Esc><D-s>gv
vmap <D-s> <Esc><D-s>gv imap <special> <D-s> <C-O><D-s>
imap <D-s> <C-O><D-s> cmap <special> <D-s> <C-C><D-s>
cmap <D-s> <C-C><D-s> omap <special> <D-s> <Esc><D-s>
omap <D-s> <Esc><D-s>
nnoremap <D-S-s> :browse confirm saveas<CR> nnoremap <special> <D-S-s> :browse confirm saveas<CR>
vmap <D-S-s> <Esc><D-s>gv vmap <special> <D-S-s> <Esc><D-s>gv
imap <D-S-s> <C-O><D-s> imap <special> <D-S-s> <C-O><D-s>
cmap <D-S-s> <C-C><D-s> cmap <special> <D-S-s> <C-C><D-s>
omap <D-S-s> <Esc><D-s> omap <special> <D-S-s> <Esc><D-s>
" From the Edit menu of SimpleText: " From the Edit menu of SimpleText:
nnoremap <D-z> u nnoremap <special> <D-z> u
vmap <D-z> <Esc><D-z>gv vmap <special> <D-z> <Esc><D-z>gv
imap <D-z> <C-O><D-z> imap <special> <D-z> <C-O><D-z>
cmap <D-z> <C-C><D-z> cmap <special> <D-z> <C-C><D-z>
omap <D-z> <Esc><D-z> omap <special> <D-z> <Esc><D-z>
vnoremap <D-x> "+x vnoremap <special> <D-x> "+x
vnoremap <D-c> "+y vnoremap <special> <D-c> "+y
cnoremap <D-c> <C-Y> cnoremap <special> <D-c> <C-Y>
nnoremap <D-v> "+gP nnoremap <special> <D-v> "+gP
cnoremap <D-v> <C-R>+ cnoremap <special> <D-v> <C-R>+
execute 'vnoremap <script> <D-v>' paste#paste_cmd['v'] execute 'vnoremap <script> <special> <D-v>' paste#paste_cmd['v']
execute 'inoremap <script> <D-v>' paste#paste_cmd['i'] execute 'inoremap <script> <special> <D-v>' paste#paste_cmd['i']
nnoremap <silent> <D-a> :if &slm != ""<Bar>exe ":norm gggH<C-O>G"<Bar> nnoremap <silent> <special> <D-a> :if &slm != ""<Bar>exe ":norm gggH<C-O>G"<Bar> else<Bar>exe ":norm ggVG"<Bar>endif<CR>
\ else<Bar>exe ":norm ggVG"<Bar>endif<CR> vmap <special> <D-a> <Esc><D-a>
vmap <D-a> <Esc><D-a> imap <special> <D-a> <Esc><D-a>
imap <D-a> <Esc><D-a> cmap <special> <D-a> <C-C><D-a>
cmap <D-a> <C-C><D-a> omap <special> <D-a> <Esc><D-a>
omap <D-a> <Esc><D-a>
nnoremap <D-f> / nnoremap <special> <D-f> /
vmap <D-f> <Esc><D-f> vmap <special> <D-f> <Esc><D-f>
imap <D-f> <Esc><D-f> imap <special> <D-f> <Esc><D-f>
cmap <D-f> <C-C><D-f> cmap <special> <D-f> <C-C><D-f>
omap <D-f> <Esc><D-f> omap <special> <D-f> <Esc><D-f>
nnoremap <D-g> n nnoremap <special> <D-g> n
vmap <D-g> <Esc><D-g> vmap <special> <D-g> <Esc><D-g>
imap <D-g> <C-O><D-g> imap <special> <D-g> <C-O><D-g>
cmap <D-g> <C-C><D-g> cmap <special> <D-g> <C-C><D-g>
omap <D-g> <Esc><D-g> omap <special> <D-g> <Esc><D-g>
let &cpo = s:save_cpo

View File

@@ -1,7 +1,8 @@
" Vim syntax file " Vim syntax file
" Language: C# " Language: C#
" Maintainer: Johannes Zellner <johannes@zellner.org> " Maintainer: Anduin Withers <awithers@anduin.com>
" Last Change: Mo, 24 Apr 2006 10:11:07 CEST " Former Maintainer: Johannes Zellner <johannes@zellner.org>
" Last Change: Sun Apr 30 19:26:18 PDT 2006
" Filenames: *.cs " Filenames: *.cs
" $Id$ " $Id$
" "
@@ -38,11 +39,16 @@ syn keyword csException try catch finally throw
" TODO: " TODO:
syn keyword csUnspecifiedStatement as base checked event fixed in is lock new operator out params ref sizeof stackalloc this typeof unchecked unsafe using syn keyword csUnspecifiedStatement as base checked event fixed in is lock new operator out params ref sizeof stackalloc this typeof unchecked unsafe using
" TODO: " TODO:
syn keyword csUnsupportedStatement get set add remove value syn keyword csUnsupportedStatement add remove value
" TODO: " TODO:
syn keyword csUnspecifiedKeyword explicit implicit syn keyword csUnspecifiedKeyword explicit implicit
" Contextual Keywords
syn match csContextualStatement /\<yield[[:space:]\n]\+\(return\|break\)/me=s+5
syn match csContextualStatement /\<partial[[:space:]\n]\+\(class\|struct\|interface\)/me=s+7
syn match csContextualStatement /\<\(get\|set\)[[:space:]\n]*{/me=s+3
syn match csContextualStatement /\<where\>[^:]\+:/me=s+5
" Comments " Comments
" "
@@ -79,8 +85,10 @@ hi def link xmlRegion Comment
" [1] 9.5 Pre-processing directives " [1] 9.5 Pre-processing directives
syn region csPreCondit syn region csPreCondit
\ start="^\s*#\s*\(define\|undef\|if\|elif\|else\|endif\|line\|error\|warning\|region\|endregion\)" \ start="^\s*#\s*\(define\|undef\|if\|elif\|else\|endif\|line\|error\|warning\)"
\ skip="\\$" end="$" contains=csComment keepend \ skip="\\$" end="$" contains=csComment keepend
syn region csRegion matchgroup=csPreCondit start="^\s*#\s*region.*$"
\ end="^\s*#\s*endregion" transparent fold contains=TOP
@@ -115,6 +123,7 @@ hi def link csException Exception
hi def link csUnspecifiedStatement Statement hi def link csUnspecifiedStatement Statement
hi def link csUnsupportedStatement Statement hi def link csUnsupportedStatement Statement
hi def link csUnspecifiedKeyword Keyword hi def link csUnspecifiedKeyword Keyword
hi def link csContextualStatement Statement
hi def link csOperatorError Error hi def link csOperatorError Error
hi def link csTodo Todo hi def link csTodo Todo

View File

@@ -52,6 +52,9 @@ syn keyword pythonPreCondit import from as
syn match pythonComment "#.*$" contains=pythonTodo syn match pythonComment "#.*$" contains=pythonTodo
syn keyword pythonTodo TODO FIXME XXX contained syn keyword pythonTodo TODO FIXME XXX contained
" Decorators (new in Python 2.4)
syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite
" strings " strings
syn region pythonString matchgroup=Normal start=+[uU]\='+ end=+'+ skip=+\\\\\|\\'+ contains=pythonEscape syn region pythonString matchgroup=Normal start=+[uU]\='+ end=+'+ skip=+\\\\\|\\'+ contains=pythonEscape
syn region pythonString matchgroup=Normal start=+[uU]\="+ end=+"+ skip=+\\\\\|\\"+ contains=pythonEscape syn region pythonString matchgroup=Normal start=+[uU]\="+ end=+"+ skip=+\\\\\|\\"+ contains=pythonEscape
@@ -85,6 +88,8 @@ endif
if exists("python_highlight_builtins") if exists("python_highlight_builtins")
" builtin functions, types and objects, not really part of the syntax " builtin functions, types and objects, not really part of the syntax
syn keyword pythonBuiltin True False bool enumerate set frozenset help
syn keyword pythonBuiltin reversed sorted sum
syn keyword pythonBuiltin Ellipsis None NotImplemented __import__ abs syn keyword pythonBuiltin Ellipsis None NotImplemented __import__ abs
syn keyword pythonBuiltin apply buffer callable chr classmethod cmp syn keyword pythonBuiltin apply buffer callable chr classmethod cmp
syn keyword pythonBuiltin coerce compile complex delattr dict dir divmod syn keyword pythonBuiltin coerce compile complex delattr dict dir divmod
@@ -110,6 +115,8 @@ if exists("python_highlight_exceptions")
syn keyword pythonException StandardError StopIteration SyntaxError syn keyword pythonException StandardError StopIteration SyntaxError
syn keyword pythonException SyntaxWarning SystemError SystemExit TabError syn keyword pythonException SyntaxWarning SystemError SystemExit TabError
syn keyword pythonException TypeError UnboundLocalError UnicodeError syn keyword pythonException TypeError UnboundLocalError UnicodeError
syn keyword pythonException UnicodeEncodeError UnicodeDecodeError
syn keyword pythonException UnicodeTranslateError
syn keyword pythonException UserWarning ValueError Warning WindowsError syn keyword pythonException UserWarning ValueError Warning WindowsError
syn keyword pythonException ZeroDivisionError syn keyword pythonException ZeroDivisionError
endif endif
@@ -151,6 +158,7 @@ if version >= 508 || !exists("did_python_syn_inits")
HiLink pythonPreCondit PreCondit HiLink pythonPreCondit PreCondit
HiLink pythonComment Comment HiLink pythonComment Comment
HiLink pythonTodo Todo HiLink pythonTodo Todo
HiLink pythonDecorator Define
if exists("python_highlight_numbers") if exists("python_highlight_numbers")
HiLink pythonNumber Number HiLink pythonNumber Number
endif endif

View File

@@ -1,9 +1,9 @@
" Vim syntax file " Vim syntax file
" Language: VRML97 " Language: VRML97
" Modified from: VRML 1.0C by David Brown <dbrown@cgs.c4.gmeds.com> " Modified from: VRML 1.0C by David Brown <dbrown@cgs.c4.gmeds.com>
" Maintainer: Gregory Seidman <gseidman@acm.org> " Maintainer: vacancy!
" URL: http://www.cs.brown.edu/~gss/vim/syntax/vrml.vim " Former Maintainer: Gregory Seidman <gsslist+vim@anthropohedron.net>
" Last change: 2003 May 11 " Last change: 2006 May 03
" For version 5.x: Clear all syntax items " For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded " For version 6.x: Quit when a syntax file was already loaded
@@ -195,7 +195,7 @@ syn sync minlines=1
if version >= 600 if version >= 600
"FOLDS! "FOLDS!
syn sync fromstart syn sync fromstart
setlocal foldmethod=syntax "setlocal foldmethod=syntax
syn region braceFold start="{" end="}" transparent fold contains=TOP syn region braceFold start="{" end="}" transparent fold contains=TOP
syn region bracketFold start="\[" end="]" transparent fold contains=TOP syn region bracketFold start="\[" end="]" transparent fold contains=TOP
syn region VRMLString start=+"+ skip=+\\\\\|\\"+ end=+"+ fold contains=VRMLSpecial,VRMLjScriptString syn region VRMLString start=+"+ skip=+\\\\\|\\"+ end=+"+ fold contains=VRMLSpecial,VRMLjScriptString

View File

@@ -4999,7 +4999,7 @@ uc_add_command(name, name_len, rep, argt, def, flags, compl, compl_arg, force)
char_u *rep_buf = NULL; char_u *rep_buf = NULL;
garray_T *gap; garray_T *gap;
replace_termcodes(rep, &rep_buf, FALSE, FALSE); replace_termcodes(rep, &rep_buf, FALSE, FALSE, FALSE);
if (rep_buf == NULL) if (rep_buf == NULL)
{ {
/* Can't replace termcodes - try using the string as is */ /* Can't replace termcodes - try using the string as is */
@@ -9854,18 +9854,6 @@ makeopens(fd, dirnow)
|| put_eol(fd) == FAIL)) || put_eol(fd) == FAIL))
return FAIL; return FAIL;
/*
* Wipe out an empty unnamed buffer we started in.
*/
if (put_line(fd, "if exists('s:wipebuf')") == FAIL)
return FAIL;
if (put_line(fd, " exe 'bwipe ' . s:wipebuf") == FAIL)
return FAIL;
if (put_line(fd, "endif") == FAIL)
return FAIL;
if (put_line(fd, "unlet! s:wipebuf") == FAIL)
return FAIL;
/* /*
* Restore window sizes again after jumping around in windows, because * Restore window sizes again after jumping around in windows, because
* the current window has a minimum size while others may not. * the current window has a minimum size while others may not.
@@ -9873,11 +9861,6 @@ makeopens(fd, dirnow)
if (nr > 1 && ses_winsizes(fd, restore_size) == FAIL) if (nr > 1 && ses_winsizes(fd, restore_size) == FAIL)
return FAIL; return FAIL;
/* Re-apply 'winheight', 'winwidth' and 'shortmess'. */
if (fprintf(fd, "set winheight=%ld winwidth=%ld shortmess=%s",
p_wh, p_wiw, p_shm) < 0 || put_eol(fd) == FAIL)
return FAIL;
/* Don't continue in another tab page when doing only the current one /* Don't continue in another tab page when doing only the current one
* or when at the last tab page. */ * or when at the last tab page. */
if (!(ssop_flags & SSOP_TABPAGES) || curtab->tp_next == NULL) if (!(ssop_flags & SSOP_TABPAGES) || curtab->tp_next == NULL)
@@ -9893,6 +9876,22 @@ makeopens(fd, dirnow)
return FAIL; return FAIL;
} }
/*
* Wipe out an empty unnamed buffer we started in.
*/
if (put_line(fd, "if exists('s:wipebuf')") == FAIL)
return FAIL;
if (put_line(fd, " exe 'bwipe ' . s:wipebuf") == FAIL)
return FAIL;
if (put_line(fd, "endif") == FAIL)
return FAIL;
if (put_line(fd, "unlet! s:wipebuf") == FAIL)
return FAIL;
/* Re-apply 'winheight', 'winwidth' and 'shortmess'. */
if (fprintf(fd, "set winheight=%ld winwidth=%ld shortmess=%s",
p_wh, p_wiw, p_shm) < 0 || put_eol(fd) == FAIL)
return FAIL;
/* /*
* Lastly, execute the x.vim file if it exists. * Lastly, execute the x.vim file if it exists.

View File

@@ -3034,6 +3034,7 @@ do_map(maptype, arg, mode, abbrev)
mapblock_T **map_table; mapblock_T **map_table;
int unique = FALSE; int unique = FALSE;
int silent = FALSE; int silent = FALSE;
int special = FALSE;
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
int expr = FALSE; int expr = FALSE;
#endif #endif
@@ -3075,6 +3076,16 @@ do_map(maptype, arg, mode, abbrev)
continue; continue;
} }
/*
* Check for "<special>": accept special keys in <>
*/
if (STRNCMP(keys, "<special>", 9) == 0)
{
keys = skipwhite(keys + 9);
special = TRUE;
continue;
}
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
/* /*
* Check for "<script>": remap script-local mappings only * Check for "<script>": remap script-local mappings only
@@ -3147,13 +3158,13 @@ do_map(maptype, arg, mode, abbrev)
* replace_termcodes() also removes CTRL-Vs and sometimes backslashes. * replace_termcodes() also removes CTRL-Vs and sometimes backslashes.
*/ */
if (haskey) if (haskey)
keys = replace_termcodes(keys, &keys_buf, TRUE, TRUE); keys = replace_termcodes(keys, &keys_buf, TRUE, TRUE, special);
if (hasarg) if (hasarg)
{ {
if (STRICMP(rhs, "<nop>") == 0) /* "<Nop>" means nothing */ if (STRICMP(rhs, "<nop>") == 0) /* "<Nop>" means nothing */
rhs = (char_u *)""; rhs = (char_u *)"";
else else
rhs = replace_termcodes(rhs, &arg_buf, FALSE, TRUE); rhs = replace_termcodes(rhs, &arg_buf, FALSE, TRUE, special);
} }
#ifdef FEAT_FKMAP #ifdef FEAT_FKMAP
@@ -3819,7 +3830,7 @@ map_to_exists(str, modechars, abbr)
char_u *buf; char_u *buf;
int retval; int retval;
rhs = replace_termcodes(str, &buf, FALSE, TRUE); rhs = replace_termcodes(str, &buf, FALSE, TRUE, FALSE);
if (vim_strchr(modechars, 'n') != NULL) if (vim_strchr(modechars, 'n') != NULL)
mode |= NORMAL; mode |= NORMAL;

View File

@@ -4544,6 +4544,12 @@ gui_mouse_moved(x, y)
if (wp == curwin || wp == NULL) if (wp == curwin || wp == NULL)
return; /* still in the same old window, or none at all */ return; /* still in the same old window, or none at all */
#ifdef FEAT_WINDOWS
/* Ignore position in the tab pages line. */
if (Y_2_ROW(y) < tabline_height())
return;
#endif
/* /*
* format a mouse click on status line input * format a mouse click on status line input
* ala gui_send_mouse_event(0, x, y, 0, 0); * ala gui_send_mouse_event(0, x, y, 0, 0);
@@ -4597,7 +4603,11 @@ gui_mouse_correct()
/* Don't move the mouse when it's left or right of the Vim window */ /* Don't move the mouse when it's left or right of the Vim window */
if (x < 0 || x > Columns * gui.char_width) if (x < 0 || x > Columns * gui.char_width)
return; return;
# ifdef FEAT_WINDOWS
if (Y_2_ROW(y) >= tabline_height())
# else
if (y >= 0) if (y >= 0)
# endif
wp = xy2win(x, y); wp = xy2win(x, y);
if (wp != curwin && wp != NULL) /* If in other than current window */ if (wp != curwin && wp != NULL) /* If in other than current window */
{ {

View File

@@ -314,7 +314,7 @@ CVim::SendKeys(BSTR keys)
} }
/* Translate key codes like <Esc> */ /* Translate key codes like <Esc> */
str = replace_termcodes((char_u *)buffer, &ptr, FALSE, TRUE); str = replace_termcodes((char_u *)buffer, &ptr, FALSE, TRUE, FALSE);
/* If ptr was set, then a new buffer was allocated, /* If ptr was set, then a new buffer was allocated,
* so we can free the old one. * so we can free the old one.

View File

@@ -6420,7 +6420,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
{ {
if (*p_pt) if (*p_pt)
{ {
(void)replace_termcodes(p_pt, &p, TRUE, TRUE); (void)replace_termcodes(p_pt, &p, TRUE, TRUE, FALSE);
if (p != NULL) if (p != NULL)
{ {
if (new_value_alloced) if (new_value_alloced)

View File

@@ -51,7 +51,7 @@ extern char_u *get_termcode __ARGS((int i));
extern void del_termcode __ARGS((char_u *name)); extern void del_termcode __ARGS((char_u *name));
extern void set_mouse_topline __ARGS((win_T *wp)); extern void set_mouse_topline __ARGS((win_T *wp));
extern int check_termcode __ARGS((int max_offset, char_u *buf, int buflen)); extern int check_termcode __ARGS((int max_offset, char_u *buf, int buflen));
extern char_u *replace_termcodes __ARGS((char_u *from, char_u **bufp, int from_part, int do_lt)); extern char_u *replace_termcodes __ARGS((char_u *from, char_u **bufp, int from_part, int do_lt, int special));
extern int find_term_bykeys __ARGS((char_u *src)); extern int find_term_bykeys __ARGS((char_u *src));
extern void show_termcodes __ARGS((void)); extern void show_termcodes __ARGS((void));
extern int show_one_termcode __ARGS((char_u *name, char_u *code, int printit)); extern int show_one_termcode __ARGS((char_u *name, char_u *code, int printit));

View File

@@ -118,6 +118,7 @@ static void qf_fmt_text __ARGS((char_u *text, char_u *buf, int bufsize));
static void qf_clean_dir_stack __ARGS((struct dir_stack_T **)); static void qf_clean_dir_stack __ARGS((struct dir_stack_T **));
#ifdef FEAT_WINDOWS #ifdef FEAT_WINDOWS
static int qf_win_pos_update __ARGS((qf_info_T *qi, int old_qf_index)); static int qf_win_pos_update __ARGS((qf_info_T *qi, int old_qf_index));
static int is_qf_win __ARGS((win_T *win, qf_info_T *qi));
static win_T *qf_find_win __ARGS((qf_info_T *qi)); static win_T *qf_find_win __ARGS((qf_info_T *qi));
static buf_T *qf_find_buf __ARGS((qf_info_T *qi)); static buf_T *qf_find_buf __ARGS((qf_info_T *qi));
static void qf_update_buffer __ARGS((qf_info_T *qi)); static void qf_update_buffer __ARGS((qf_info_T *qi));
@@ -2199,6 +2200,7 @@ ex_copen(eap)
int height; int height;
win_T *win; win_T *win;
tabpage_T *prevtab = curtab; tabpage_T *prevtab = curtab;
buf_T *qf_buf;
if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow) if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow)
{ {
@@ -2231,6 +2233,8 @@ ex_copen(eap)
win_goto(win); win_goto(win);
else else
{ {
qf_buf = qf_find_buf(qi);
/* The current window becomes the previous window afterwards. */ /* The current window becomes the previous window afterwards. */
win = curwin; win = curwin;
@@ -2256,13 +2260,21 @@ ex_copen(eap)
win->w_llist->qf_refcount++; win->w_llist->qf_refcount++;
} }
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE); if (qf_buf != NULL)
/* switch off 'swapfile' */ /* Use the existing quickfix buffer */
set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL); (void)do_ecmd(qf_buf->b_fnum, NULL, NULL, NULL, ECMD_ONE,
set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix", ECMD_HIDE + ECMD_OLDBUF);
else
{
/* Create a new quickfix buffer */
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE);
/* switch off 'swapfile' */
set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix",
OPT_LOCAL); OPT_LOCAL);
set_option_value((char_u *)"bh", 0L, (char_u *)"wipe", OPT_LOCAL); set_option_value((char_u *)"bh", 0L, (char_u *)"wipe", OPT_LOCAL);
set_option_value((char_u *)"diff", 0L, (char_u *)"", OPT_LOCAL); set_option_value((char_u *)"diff", 0L, (char_u *)"", OPT_LOCAL);
}
/* Only set the height when still in the same tab page and there is no /* Only set the height when still in the same tab page and there is no
* window to the side. */ * window to the side. */
@@ -2351,8 +2363,32 @@ qf_win_pos_update(qi, old_qf_index)
return win != NULL; return win != NULL;
} }
/*
* Check whether the given window is displaying the specified quickfix/location
* list buffer
*/
static int
is_qf_win(win, qi)
win_T *win;
qf_info_T *qi;
{
/*
* A window displaying the quickfix buffer will have the w_llist_ref field
* set to NULL.
* A window displaying a location list buffer will have the w_llist_ref
* pointing to the location list.
*/
if (bt_quickfix(win->w_buffer))
if ((qi == &ql_info && win->w_llist_ref == NULL)
|| (qi != &ql_info && win->w_llist_ref == qi))
return TRUE;
return FALSE;
}
/* /*
* Find a window displaying the quickfix/location list 'qi' * Find a window displaying the quickfix/location list 'qi'
* Searches in only the windows opened in the current tab.
*/ */
static win_T * static win_T *
qf_find_win(qi) qf_find_win(qi)
@@ -2360,33 +2396,29 @@ qf_find_win(qi)
{ {
win_T *win; win_T *win;
/*
* When searching for the quickfix buffer, find a window
* with w_llist_ref set to NULL.
* When searching for the location list buffer, find a window
* with w_llist_ref pointing to the supplied location list.
*/
FOR_ALL_WINDOWS(win) FOR_ALL_WINDOWS(win)
if (bt_quickfix(win->w_buffer)) if (is_qf_win(win, qi))
if ((qi == &ql_info && win->w_llist_ref == NULL) break;
|| (qi != &ql_info && win->w_llist_ref == qi))
break;
return win; return win;
} }
/* /*
* Find quickfix buffer. * Find a quickfix buffer.
* Searches in windows opened in all the tabs.
*/ */
static buf_T * static buf_T *
qf_find_buf(qi) qf_find_buf(qi)
qf_info_T *qi; qf_info_T *qi;
{ {
tabpage_T *tp;
win_T *win; win_T *win;
win = qf_find_win(qi); FOR_ALL_TAB_WINDOWS(tp, win)
if (is_qf_win(win, qi))
return win->w_buffer;
return (win != NULL) ? win->w_buffer: NULL; return NULL;
} }
/* /*

View File

@@ -7031,7 +7031,7 @@ spell_read_wordfile(spin, fname)
continue; /* empty or blank line */ continue; /* empty or blank line */
rline[l] = NUL; rline[l] = NUL;
/* Convert from "=encoding={encoding}" to 'encoding' when needed. */ /* Convert from "/encoding={encoding}" to 'encoding' when needed. */
vim_free(pc); vim_free(pc);
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
if (spin->si_conv.vc_type != CONV_NONE) if (spin->si_conv.vc_type != CONV_NONE)
@@ -7069,7 +7069,7 @@ spell_read_wordfile(spin, fname)
char_u *enc; char_u *enc;
/* Setup for conversion to 'encoding'. */ /* Setup for conversion to 'encoding'. */
line += 10; line += 9;
enc = enc_canonize(line); enc = enc_canonize(line);
if (enc != NULL && !spin->si_ascii if (enc != NULL && !spin->si_ascii
&& convert_setup(&spin->si_conv, enc, && convert_setup(&spin->si_conv, enc,

View File

@@ -4945,12 +4945,13 @@ check_termcode(max_offset, buf, buflen)
* nothing). When 'cpoptions' does not contain 'B', a backslash can be used * nothing). When 'cpoptions' does not contain 'B', a backslash can be used
* instead of a CTRL-V. * instead of a CTRL-V.
*/ */
char_u * char_u *
replace_termcodes(from, bufp, from_part, do_lt) replace_termcodes(from, bufp, from_part, do_lt, special)
char_u *from; char_u *from;
char_u **bufp; char_u **bufp;
int from_part; int from_part;
int do_lt; /* also translate <lt> */ int do_lt; /* also translate <lt> */
int special; /* always accept <key> notation */
{ {
int i; int i;
int slen; int slen;
@@ -4963,7 +4964,7 @@ replace_termcodes(from, bufp, from_part, do_lt)
char_u *result; /* buffer for resulting string */ char_u *result; /* buffer for resulting string */
do_backslash = (vim_strchr(p_cpo, CPO_BSLASH) == NULL); do_backslash = (vim_strchr(p_cpo, CPO_BSLASH) == NULL);
do_special = (vim_strchr(p_cpo, CPO_SPECI) == NULL); do_special = (vim_strchr(p_cpo, CPO_SPECI) == NULL) || special;
do_key_code = (vim_strchr(p_cpo, CPO_KEYCODE) == NULL); do_key_code = (vim_strchr(p_cpo, CPO_KEYCODE) == NULL);
/* /*

View File

@@ -35,6 +35,6 @@
*/ */
#define VIM_VERSION_NODOT "vim70g" #define VIM_VERSION_NODOT "vim70g"
#define VIM_VERSION_SHORT "7.0g" #define VIM_VERSION_SHORT "7.0g"
#define VIM_VERSION_MEDIUM "7.0g-01 BETA" #define VIM_VERSION_MEDIUM "7.0g02 BETA"
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0g01 BETA (2006 May 2)" #define VIM_VERSION_LONG "VIM - Vi IMproved 7.0g02 BETA (2006 May 3)"
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0g01 BETA (2006 May 2, compiled " #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0g02 BETA (2006 May 3, compiled "

View File

@@ -5195,6 +5195,7 @@ win_new_height(wp, height)
int sline, line_size; int sline, line_size;
int space; int space;
int did_below = FALSE; int did_below = FALSE;
int old_height = wp->w_height;
#define FRACTION_MULT 16384L #define FRACTION_MULT 16384L
/* Don't want a negative height. Happens when splitting a tiny window. /* Don't want a negative height. Happens when splitting a tiny window.
@@ -5238,9 +5239,15 @@ win_new_height(wp, height)
} }
else else
{ {
space = height; space = height - 1;
while (lnum > 1) while (lnum > 1)
{ {
/* When using "~" lines stop when at the old topline, don't
* scroll down. */
if (did_below && height < old_height && lnum <= wp->w_topline)
sline = 0;
space -= line_size; space -= line_size;
if (space > 0 && sline <= 0 && !did_below) if (space > 0 && sline <= 0 && !did_below)
{ {