Compare commits

...

16 Commits

Author SHA1 Message Date
Bram Moolenaar
4e036c9e6f updated for version 7.4.369
Problem:    Using freed memory when exiting while compiled with EXITFREE.
Solution:   Set curwin to NULL and check for that. (Dominique Pelle)
2014-07-16 16:30:28 +02:00
Bram Moolenaar
b643e77782 updated for version 7.4.368
Problem:    Restoring the window sizes after closing the command line window
            doesn't work properly if there are nested splits.
Solution:   Restore the sizes twice. (Hirohito Higashi)
2014-07-16 15:18:26 +02:00
Bram Moolenaar
f1924a9d8c updated for version 7.4.367
Problem:    Other solution for redrawing after completion.
Solution:   Schedule a window redraw instead of just clearing the command
            line. (Jacob Niehus)
2014-07-16 14:42:46 +02:00
Bram Moolenaar
310e2dbaee updated for version 7.4.366
Problem:    Can't run the linebreak test on MS-Windows.
Solution:   Fix the output file name. (Taro Muraoka)
2014-07-16 14:20:41 +02:00
Bram Moolenaar
b4d2135518 updated for version 7.4.365
Problem:    Crash when using ":botright split" when there isn't much space.
Solution:   Add a check for the minimum width/height. (Yukihiro Nakadaira)
2014-07-16 14:16:46 +02:00
Bram Moolenaar
db6ea06335 Updated runtime files. 2014-07-10 22:01:47 +02:00
Bram Moolenaar
3ed8b1332f updated for version 7.4.364
Problem:    When the viminfo file can't be renamed there is no error message.
            (Vladimir Berezhnoy)
Solution:   Check for the rename to fail.
2014-07-09 21:18:04 +02:00
Bram Moolenaar
455009122a updated for version 7.4.363
Problem:    In Windows console typing 0xCE does not work.
Solution:   Convert 0xCE to K_NUL 3. (Nobuhiro Takasaki et al.)
2014-07-09 20:51:07 +02:00
Bram Moolenaar
1e1aca3784 updated for version 7.4.362
Problem:    When matchaddpos() uses a length smaller than the number of bytes
            in the (last) character the highlight continues until the end of
            the line.
Solution:   Change condition from equal to larger-or-equal.
2014-07-09 20:20:43 +02:00
Bram Moolenaar
c804515003 updated for version 7.4.361
Problem:    Lots of flickering when filling the preview window for 'omnifunc'.
Solution:   Disable redrawing. (Hirohito Higashi)
2014-07-09 19:58:24 +02:00
Bram Moolenaar
ff65ac84fd updated for version 7.4.360
Problem:    In a regexp pattern a "$" followed by \v or \V is not seen as the
            end-of-line.
Solution:   Handle the situation. (Ozaki Kiichi)
2014-07-09 19:32:34 +02:00
Bram Moolenaar
0d1e8c1203 updated for version 7.4.359
Problem:    When 'ttymouse' is set to 'uxterm' the xterm version is not
            requested. (Tomas Janousek)
Solution:   Do not mark uxterm as a conflict mouse and add
            resume_get_esc_sequence().
2014-07-09 19:13:49 +02:00
Bram Moolenaar
6bf5548df2 updated for version 7.4.358
Problem:    Sort is not always stable.
Solution:   Add an index instead of relying on the pointer to remain the same.
            Idea by Jun Takimoto.
2014-07-09 17:51:51 +02:00
Bram Moolenaar
0bed10a813 updated for version 7.4.357
Problem:    After completion some characters are not redrawn.
Solution:   Clear the command line unconditionally. (Jacob Niehus)
2014-07-09 14:00:49 +02:00
Bram Moolenaar
cc57bb2f85 updated for version 7.4.356
Problem:    Mercurial does not ignore memfile_test. (Daniel Hahler)
Solution:   Add memfile_test to ignored files, remove trailing spaces.
2014-07-09 13:43:29 +02:00
Bram Moolenaar
8bb1c3e53e Updated runtime files. Overhauled HTML indent script. 2014-07-04 16:43:17 +02:00
42 changed files with 1752 additions and 534 deletions

13
.gitignore vendored
View File

@@ -62,11 +62,12 @@ src/xxd/xxd.dSYM
src/po/vim.pot
# Generated by "make test"
src/po/*.ck
src/testdir/mbyte.vim
src/testdir/mzscheme.vim
src/testdir/lua.vim
src/testdir/small.vim
src/testdir/tiny.vim
src/po/*.ck
src/testdir/mbyte.vim
src/testdir/mzscheme.vim
src/testdir/lua.vim
src/testdir/small.vim
src/testdir/tiny.vim
src/testdir/test*.out
src/testdir/test.log
src/memfile_test

View File

@@ -1,4 +1,4 @@
*change.txt* For Vim version 7.4. Last change: 2014 Feb 11
*change.txt* For Vim version 7.4. Last change: 2014 Jun 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1717,8 +1717,8 @@ Note that using `:sort` with `:global` doesn't sort the matching lines, it's
quite useless.
The details about sorting depend on the library function used. There is no
guarantee that sorting is "stable" or obeys the current locale. You will have
to try it out.
guarantee that sorting obeys the current locale. You will have to try it out.
Vim does do a "stable" sort.
The sorting can be interrupted, but if you interrupt it too late in the
process you may end up with duplicated lines. This also depends on the system

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.4. Last change: 2014 Jun 25
*eval.txt* For Vim version 7.4. Last change: 2014 Jul 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -5651,6 +5651,11 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702*
{dict} is for functions with the "dict" attribute. It will be
used to set the local variable "self". |Dictionary-function|
The sort is stable, items which compare equal (as number or as
string) will keep their relative position. E.g., when sorting
on numbers, text strings will sort next to each other, in the
same order as they were originally.
Also see |uniq()|.
Example: >

View File

@@ -1,4 +1,4 @@
*insert.txt* For Vim version 7.4. Last change: 2013 Jul 12
*insert.txt* For Vim version 7.4. Last change: 2014 Jul 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1302,7 +1302,7 @@ HTML *ft-html-omni*
XHTML *ft-xhtml-omni*
CTRL-X CTRL-O provides completion of various elements of (X)HTML files. It is
designed to support writing of XHTML 1.0 Strict files but will also works for
designed to support writing of XHTML 1.0 Strict files but will also work for
other versions of HTML. Features:
- after "<" complete tag name depending on context (no div suggestion inside

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.4. Last change: 2014 Jun 25
*options.txt* For Vim version 7.4. Last change: 2014 Jun 26
VIM REFERENCE MANUAL by Bram Moolenaar

View File

@@ -1,4 +1,4 @@
*spell.txt* For Vim version 7.4. Last change: 2013 Nov 12
*spell.txt* For Vim version 7.4. Last change: 2014 Jul 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -939,9 +939,10 @@ be combined without errors.
If you get an E763 warning that the word tables differ you need to update your
".spl" spell files. If you downloaded the files, get the latest version of
all spell files you use. Otherwise generate the .spl file again with
|:mkspell|. If you still get errors check the FOL, LOW and UPP lines in the
used .aff files.
all spell files you use. If you are only using one, e.g., German, then also
download the recent English spell files. Otherwise generate the .spl file
again with |:mkspell|. If you still get errors check the FOL, LOW and UPP
lines in the used .aff files.
The XX.ascii.spl spell file generated with the "-ascii" argument will not
contain the table with characters, so that it can be combine with spell files

View File

@@ -1,4 +1,4 @@
*starting.txt* For Vim version 7.4. Last change: 2014 Jun 14
*starting.txt* For Vim version 7.4. Last change: 2014 Jul 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1506,7 +1506,7 @@ most of the information will be restored).
already set (registers, marks, |v:oldfiles|, etc.)
will be overwritten {not in Vi}
*:wv* *:wviminfo* *E137* *E138* *E574*
*:wv* *:wviminfo* *E137* *E138* *E574* *E886*
:wv[iminfo][!] [file] Write to viminfo file [file] (default: see above).
The information in the file is first read in to make
a merge between old and new info. When [!] is used,

View File

@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 7.4. Last change: 2014 Jun 03
*syntax.txt* For Vim version 7.4. Last change: 2014 Jun 27
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1688,7 +1688,7 @@ vimrc file: >
HTML comments are rather special (see an HTML reference document for the
details), and the syntax coloring scheme will highlight all errors.
However, if you prefer to use the wrong style (starts with <!-- and
ends with --!>) you can define >
ends with -->) you can define >
:let html_wrong_comments=1
JavaScript and Visual Basic embedded inside HTML documents are highlighted as

View File

@@ -4323,6 +4323,7 @@ E882 eval.txt /*E882*
E883 eval.txt /*E883*
E884 eval.txt /*E884*
E885 sign.txt /*E885*
E886 starting.txt /*E886*
E89 message.txt /*E89*
E90 message.txt /*E90*
E91 options.txt /*E91*

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.4. Last change: 2014 Jun 25
*todo.txt* For Vim version 7.4. Last change: 2014 Jul 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -34,6 +34,8 @@ not be repeated below, unless there is extra information.
*known-bugs*
-------------------- Known bugs and current work -----------------------
Forfeit test_listlbr when encoding is not utf8? (Danek Duvall)
Regexp problems:
- Bug with pattern: '\vblock (\d+)\.\n.*\d+%(\1)@<!\.$'
(Lech Lorens, 2014 Feb 3)
@@ -47,6 +49,9 @@ Regexp problems:
- Does not work with NFA regexp engine:
\%u, \%x, \%o, \%d followed by a composing character
Patch to set y_width when getting the register from the clipboard.
(Yukihiro Nakadaira, 2014 Jul 10)
Problem that a previous silent ":throw" causes a following try/catch not to
work. (ZyX, 2013 Sep 28)
@@ -55,10 +60,15 @@ Completion for :buf does not use 'wildignorecase'. (Akshay H, 2014 May 31)
":cd C:\Windows\System32\drivers\etc*" does not work, even though the
directory exists. (Sergio Gallelli, 2013 Dec 29)
The entries added by matchaddpos() are returned by getmatches() but can't be
set with setmatches(). (lcd47, 2014 Jun 29)
Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
When using an undo file, also restore the changelist, so that "g;" works.
Value returned by virtcol() changes depending on how lines wrap. This is
inconsistant with the documentation.
@@ -67,9 +77,6 @@ MS-Windows: Crash opening very long file name starting with "\\".
Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21)
Patch to translate 0xce in K_NUL 3. (Yasuhiro Matsumoto, 2014 June 6)
Update by Nobuhiro Takasaki, Jun 19.
Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19)
"hi link" does not respect groups with GUI settings only. (Mark Lodato, 2014
@@ -123,7 +130,7 @@ Problem with upwards search on Windows (works OK on Linux). (Brett Stahlman,
When 'clipboard' is "unnamed", :g/pat/d is very slow. Only set the clipboard
after the last delete? (Praful, 2014 May 28)
Patch by Christian Brabandt, 2014 Jun 18.
Patch by Christian Brabandt, 2014 Jun 18. Update Jun 25.
Include a plugin manager with Vim? Neobundle seems to be the best currently.
Long message about this from ZyX, 2014 Mar 23. And following replies.
@@ -162,6 +169,9 @@ Out of scope:
Setting the spell file in a session only reads the local additions, not the
normal spell file. (Enno Nagel, 2014 Mar 29)
CTRL-] in Visual mode uses the selected text as a tag. This does not work
when preceded with CTRL-W. (Patrick Hemmer, 2014 Jun 28)
When typing the first character of a command, e.g. "f", then using a menu, the
menu item doesn't work. Clear typeahead when using a menu?
@@ -171,6 +181,9 @@ Editing an ascii file as ucs-2 or ucs-4 causes display errors.
":Next 1 some-arg" does not complain about trailing argument. Also for
various other commands. (ZyX, 2014 Mar 30)
patch to skip sort if no line matches the expression.
(Christian Brabandt, 2014 Jun 25)
Patch to add sortuniq(). (Cade Forester, 2014 Mar 19)
Or add uniq() instead? Patch by lcd47, but it has problems.
@@ -344,6 +357,7 @@ Patch to allow setting w:quickfix_title via setqflist() and setloclist()
functions. (Christian Brabandt, 2013 May 8, update May 21)
Patch to add getlocstack() / setlocstack(). (Christian Brabandt, 2013 May 14)
Second one. Update May 22.
Update by Daniel Hahler, 2014 Jul 4.
Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec)

View File

@@ -1,4 +1,4 @@
*usr_08.txt* For Vim version 7.4. Last change: 2006 Jul 18
*usr_08.txt* For Vim version 7.4. Last change: 2014 Jul 06
VIM USER MANUAL - by Bram Moolenaar
@@ -532,7 +532,7 @@ window. And you will notice a bar at the top with the two file names:
You now have two tab pages. The first one has a window for "thisfile" and the
second one a window for "thatfile". It's like two pages that are on top of
eachother, with a tab sticking out of each page showing the file name.
each other, with a tab sticking out of each page showing the file name.
Now use the mouse to click on "thisfile" in the top line. The result is

View File

@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2014 Jun 12
" Last Change: 2014 Jul 09
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -864,7 +864,7 @@ func! s:FThtml()
setf xhtml
return
endif
if getline(n) =~ '{%\s*\(extends\|block\)\>'
if getline(n) =~ '{%\s*\(extends\|block\|load\)\>'
setf htmldjango
return
endif
@@ -1649,6 +1649,20 @@ else
au BufNewFile,BufRead *.rnw,*.snw setf rnoweb
endif
" R Markdown file
if has("fname_case")
au BufNewFile,BufRead *.Rmd,*.rmd,*.Smd,*.smd setf rmd
else
au BufNewFile,BufRead *.rmd,*.smd setf rmd
endif
" R reStructuredText file
if has("fname_case")
au BufNewFile,BufRead *.Rrst,*.rrst,*.Srst,*.srst setf rrst
else
au BufNewFile,BufRead *.rrst,*.srst setf rrst
endif
" Rexx, Rebol or R
au BufNewFile,BufRead *.r,*.R call s:FTr()
@@ -2664,7 +2678,7 @@ au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh')
" Plain text files, needs to be far down to not override others. This avoids
" the "conf" type being used if there is a line starting with '#'.
au BufNewFile,BufRead *.txt,*.text setf text
au BufNewFile,BufRead *.txt,*.text,README setf text
" Use the filetype detect plugins. They may overrule any of the previously

31
runtime/ftplugin/r.vim Normal file
View File

@@ -0,0 +1,31 @@
" Vim filetype plugin file
" Language: R
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Last Change: Sun Feb 23, 2014 04:07PM
" Only do this when not yet done for this buffer
if exists("b:did_ftplugin")
finish
endif
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
setlocal iskeyword=@,48-57,_,.
setlocal formatoptions-=t
setlocal commentstring=#\ %s
setlocal comments=:#',:###,:##,:#
if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "R Source Files (*.R)\t*.R\n" .
\ "Files that include R (*.Rnw *.Rd *.Rmd *.Rrst)\t*.Rnw;*.Rd;*.Rmd;*.Rrst\n" .
\ "All Files (*.*)\t*.*\n"
endif
let b:undo_ftplugin = "setl cms< com< fo< isk< | unlet! b:browsefilter"
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -0,0 +1,29 @@
" Vim filetype plugin file
" Language: R help file
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Last Change: Wed Jul 09, 2014 06:23PM
" Only do this when not yet done for this buffer
if exists("b:did_ftplugin")
finish
endif
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
setlocal iskeyword=@,48-57,_,.
if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" .
\ "All Files (*.*)\t*.*\n"
endif
let b:undo_ftplugin = "setl isk< | unlet! b:browsefilter"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: sw=2

43
runtime/ftplugin/rmd.vim Normal file
View File

@@ -0,0 +1,43 @@
" Vim filetype plugin file
" Language: R help file
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Last Change: Wed Jul 09, 2014 06:23PM
" Original work by Alex Zvoleff (adjusted for rmd by Michel Kuhlmann)
" Only do this when not yet done for this buffer
if exists("b:did_ftplugin")
finish
endif
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s
setlocal formatoptions+=tcqln
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+
setlocal iskeyword=@,48-57,_,.
let s:cpo_save = &cpo
set cpo&vim
" Enables pandoc if it is installed
unlet! b:did_ftplugin
runtime ftplugin/pandoc.vim
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" .
\ "All Files (*.*)\t*.*\n"
endif
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= " | setl cms< com< fo< flp< isk< | unlet! b:browsefilter"
else
let b:undo_ftplugin = "setl cms< com< fo< flp< isk< | unlet! b:browsefilter"
endif
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: sw=2

View File

@@ -0,0 +1,40 @@
" Vim filetype plugin file
" Language: Rnoweb
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Last Change: Wed Jul 09, 2014 06:23PM
" Only do this when not yet done for this buffer
if exists("b:did_ftplugin")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
runtime! ftplugin/tex.vim
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
" Enables Vim-Latex-Suite, LaTeX-Box if installed
runtime ftplugin/tex_*.vim
setlocal iskeyword=@,48-57,_,.
setlocal suffixesadd=.bib,.tex
setlocal comments=b:%,b:#,b:##,b:###,b:#'
if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" .
\ "All Files (*.*)\t*.*\n"
endif
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= " | setl isk< sua< com< | unlet! b:browsefilter"
else
let b:undo_ftplugin = "setl isk< sua< com< | unlet! b:browsefilter"
endif
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: sw=2

37
runtime/ftplugin/rrst.vim Normal file
View File

@@ -0,0 +1,37 @@
" Vim filetype plugin file
" Language: reStructuredText documentation format with R code
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Last Change: Wed Jul 09, 2014 06:23PM
" Original work by Alex Zvoleff
" Only do this when not yet done for this buffer
if exists("b:did_ftplugin")
finish
endif
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s
setlocal formatoptions+=tcqln
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+
setlocal iskeyword=@,48-57,_,.
if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" .
\ "All Files (*.*)\t*.*\n"
endif
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= " | setl cms< com< fo< flp< isk< | unlet! b:browsefilter"
else
let b:undo_ftplugin = "setl cms< com< fo< flp< isk< | unlet! b:browsefilter"
endif
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: sw=2

17
runtime/ftplugin/text.vim Normal file
View File

@@ -0,0 +1,17 @@
" Vim filetype plugin
" Language: Text
" Maintainer: David Barnett <daviebdawg+vim@gmail.com>
" Last Change: 2014 Jul 09
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
let b:undo_ftplugin = 'setlocal comments< commentstring<'
" We intentionally don't set formatoptions-=t since text should wrap as text.
" Pseudo comment leaders to indent bulleted lists.
setlocal comments=fb:-,fb:*
setlocal commentstring=

File diff suppressed because it is too large Load Diff

111
runtime/indent/rhelp.vim Normal file
View File

@@ -0,0 +1,111 @@
" Vim indent file
" Language: R Documentation (Help), *.Rd
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Last Change: Wed Jul 09, 2014 07:34PM
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
runtime indent/r.vim
let s:RIndent = function(substitute(&indentexpr, "()", "", ""))
let b:did_indent = 1
setlocal indentkeys=0{,0},:,!^F,o,O,e
setlocal indentexpr=GetRHelpIndent()
" Only define the function once.
if exists("*GetRHelpIndent")
finish
endif
setlocal noautoindent
setlocal nocindent
setlocal nosmartindent
setlocal nolisp
setlocal indentkeys=0{,0},:,!^F,o,O,e
setlocal indentexpr=GetCorrectRHelpIndent()
function s:SanitizeRHelpLine(line)
let newline = substitute(a:line, '\\\\', "x", "g")
let newline = substitute(newline, '\\{', "x", "g")
let newline = substitute(newline, '\\}', "x", "g")
let newline = substitute(newline, '\\%', "x", "g")
let newline = substitute(newline, '%.*', "", "")
let newline = substitute(newline, '\s*$', "", "")
return newline
endfunction
function GetRHelpIndent()
let clnum = line(".") " current line
if clnum == 1
return 0
endif
let cline = getline(clnum)
if cline =~ '^\s*}\s*$'
let i = clnum
let bb = -1
while bb != 0 && i > 1
let i -= 1
let line = s:SanitizeRHelpLine(getline(i))
let line2 = substitute(line, "{", "", "g")
let openb = strlen(line) - strlen(line2)
let line3 = substitute(line2, "}", "", "g")
let closeb = strlen(line2) - strlen(line3)
let bb += openb - closeb
endwhile
return indent(i)
endif
if cline =~ '^\s*#ifdef\>' || cline =~ '^\s*#endif\>'
return 0
endif
let lnum = clnum - 1
let line = getline(lnum)
if line =~ '^\s*#ifdef\>' || line =~ '^\s*#endif\>'
let lnum -= 1
let line = getline(lnum)
endif
while lnum > 1 && (line =~ '^\s*$' || line =~ '^#ifdef' || line =~ '^#endif')
let lnum -= 1
let line = getline(lnum)
endwhile
if lnum == 1
return 0
endif
let line = s:SanitizeRHelpLine(line)
let line2 = substitute(line, "{", "", "g")
let openb = strlen(line) - strlen(line2)
let line3 = substitute(line2, "}", "", "g")
let closeb = strlen(line2) - strlen(line3)
let bb = openb - closeb
let ind = indent(lnum) + (bb * &sw)
if line =~ '^\s*}\s*$'
let ind = indent(lnum)
endif
if ind < 0
return 0
endif
return ind
endfunction
function GetCorrectRHelpIndent()
let lastsection = search('^\\[a-z]*{', "bncW")
let secname = getline(lastsection)
if secname =~ '^\\usage{' || secname =~ '^\\examples{' || secname =~ '^\\dontshow{' || secname =~ '^\\dontrun{' || secname =~ '^\\donttest{' || secname =~ '^\\testonly{' || secname =~ '^\\method{.*}{.*}('
return s:RIndent()
else
return GetRHelpIndent()
endif
endfunction
" vim: sw=2

46
runtime/indent/rmd.vim Normal file
View File

@@ -0,0 +1,46 @@
" Vim indent file
" Language: Rmd
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Last Change: Wed Jul 09, 2014 07:33PM
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
runtime indent/r.vim
let s:RIndent = function(substitute(&indentexpr, "()", "", ""))
let b:did_indent = 1
setlocal indentkeys=0{,0},:,!^F,o,O,e
setlocal indentexpr=GetRmdIndent()
if exists("*GetRmdIndent")
finish
endif
function GetMdIndent()
let pline = getline(v:lnum - 1)
let cline = getline(v:lnum)
if prevnonblank(v:lnum - 1) < v:lnum - 1 || cline =~ '^\s*[-\+\*]\s' || cline =~ '^\s*\d\+\.\s\+'
return indent(v:lnum)
elseif pline =~ '^\s*[-\+\*]\s'
return indent(v:lnum - 1) + 2
elseif pline =~ '^\s*\d\+\.\s\+'
return indent(v:lnum - 1) + 3
endif
return indent(prevnonblank(v:lnum - 1))
endfunction
function GetRmdIndent()
if getline(".") =~ '^```{r .*}$' || getline(".") =~ '^```$'
return 0
endif
if search('^```{r', "bncW") > search('^```$', "bncW")
return s:RIndent()
else
return GetMdIndent()
endif
endfunction
" vim: sw=2

35
runtime/indent/rnoweb.vim Normal file
View File

@@ -0,0 +1,35 @@
" Vim indent file
" Language: Rnoweb
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Last Change: Wed Jul 09, 2014 07:28PM
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
runtime indent/tex.vim
let s:TeXIndent = function(substitute(&indentexpr, "()", "", ""))
unlet b:did_indent
runtime indent/r.vim
let s:RIndent = function(substitute(&indentexpr, "()", "", ""))
let b:did_indent = 1
setlocal indentkeys=0{,0},!^F,o,O,e,},=\bibitem,=\item
setlocal indentexpr=GetRnowebIndent()
if exists("*GetRnowebIndent")
finish
endif
function GetRnowebIndent()
if getline(".") =~ "^<<.*>>=$"
return 0
endif
if search("^<<", "bncW") > search("^@", "bncW")
return s:RIndent()
endif
return s:TeXIndent()
endfunction
" vim: sw=2

46
runtime/indent/rrst.vim Normal file
View File

@@ -0,0 +1,46 @@
" Vim indent file
" Language: Rrst
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Last Change: Wed Jul 09, 2014 07:33PM
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
runtime indent/r.vim
let s:RIndent = function(substitute(&indentexpr, "()", "", ""))
let b:did_indent = 1
setlocal indentkeys=0{,0},:,!^F,o,O,e
setlocal indentexpr=GetRrstIndent()
if exists("*GetRrstIndent")
finish
endif
function GetRstIndent()
let pline = getline(v:lnum - 1)
let cline = getline(v:lnum)
if prevnonblank(v:lnum - 1) < v:lnum - 1 || cline =~ '^\s*[-\+\*]\s' || cline =~ '^\s*\d\+\.\s\+'
return indent(v:lnum)
elseif pline =~ '^\s*[-\+\*]\s'
return indent(v:lnum - 1) + 2
elseif pline =~ '^\s*\d\+\.\s\+'
return indent(v:lnum - 1) + 3
endif
return indent(prevnonblank(v:lnum - 1))
endfunction
function GetRrstIndent()
if getline(".") =~ '^\.\. {r .*}$' || getline(".") =~ '^\.\. \.\.$'
return 0
endif
if search('^\.\. {r', "bncW") > search('^\.\. \.\.$', "bncW")
return s:RIndent()
else
return GetRstIndent()
endif
endfunction
" vim: sw=2

View File

@@ -1,6 +1,6 @@
" Vim plugin for showing matching parens
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2014 Jun 17
" Last Change: 2014 Jul 09
" Exit quickly when:
" - this plugin was already loaded (or disabled)
@@ -54,14 +54,15 @@ function! s:Highlight_Matching_Pair()
let c_col = col('.')
let before = 0
let c = getline(c_lnum)[c_col - 1]
let text = getline(c_lnum)
let c = text[c_col - 1]
let plist = split(&matchpairs, '.\zs[:,]')
let i = index(plist, c)
if i < 0
" not found, in Insert mode try character before the cursor
if c_col > 1 && (mode() == 'i' || mode() == 'R')
let before = 1
let c = getline(c_lnum)[c_col - 2]
let c = text[c_col - 2]
let i = index(plist, c)
endif
if i < 0
@@ -87,7 +88,7 @@ function! s:Highlight_Matching_Pair()
" Find the match. When it was just before the cursor move it there for a
" moment.
if before > 0
let save_cursor = winsaveview()
let save_cursor = getcurpos()
call cursor(c_lnum, c_col - before)
endif
@@ -147,7 +148,7 @@ function! s:Highlight_Matching_Pair()
endtry
if before > 0
call winrestview(save_cursor)
call setpos('.', save_cursor)
endif
" If a match is found setup match highlighting.

View File

@@ -3,7 +3,7 @@
" Maintainer: Jakson Aquino <jalvesaq@gmail.com>
" Former Maintainers: Vaidotas Zemlys <zemlys@gmail.com>
" Tom Payne <tom@tompayne.org>
" Last Change: Sun May 19, 2013 05:59PM
" Last Change: Wed Jul 09, 2014 10:29PM
" Filenames: *.R *.r *.Rhistory *.Rt
"
" NOTE: The highlighting of R functions is defined in the
@@ -30,14 +30,16 @@ endif
syn case match
" Comment
syn match rComment contains=@Spell "#.*"
syn match rCommentTodo contained "\(BUG\|FIXME\|NOTE\|TODO\):"
syn match rComment contains=@Spell,rCommentTodo "#.*"
" Roxygen
syn match rOKeyword contained "@\(param\|return\|name\|rdname\|examples\|include\|docType\)"
syn match rOKeyword contained "@\(S3method\|TODO\|aliases\|alias\|assignee\|author\|callGraphDepth\|callGraph\)"
syn match rOKeyword contained "@\(callGraphPrimitives\|concept\|exportClass\|exportMethod\|exportPattern\|export\|formals\)"
syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\)"
syn match rOKeyword contained "@\(method\|nord\|note\|references\|seealso\|setClass\|slot\|source\|title\|usage\)"
syn match rOKeyword contained "@\(method\|noRd\|note\|references\|seealso\|setClass\|slot\|source\|title\|usage\)"
syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritsParams\)"
syn match rOComment contains=@Spell,rOKeyword "#'.*"
@@ -119,7 +121,7 @@ if &filetype != "rmd" && &filetype != "rrst"
else
syn match rOperator "[|!<>^~`/:]"
endif
syn match rOperator "%\{2}\|%\S*%"
syn match rOperator "%\{2}\|%\S\{-}%"
syn match rOpError '\*\{3}'
syn match rOpError '//'
syn match rOpError '&&&'
@@ -164,8 +166,8 @@ syn match rLstElmt "@[a-zA-Z0-9\\._]*" contains=rDollar
syn keyword rPreProc library require attach detach source
if &filetype == "rhelp"
syn match rHelpIdent '\\method'
syn match rHelpIdent '\\S4method'
syn match rHelpIdent '\\method'
syn match rHelpIdent '\\S4method'
endif
" Type
@@ -187,6 +189,7 @@ hi def link rArrow Statement
hi def link rBoolean Boolean
hi def link rBraceError Error
hi def link rComment Comment
hi def link rCommentTodo Todo
hi def link rOComment Comment
hi def link rComplex Number
hi def link rConditional Conditional

View File

@@ -2,9 +2,7 @@
" Language: R Help File
" Maintainer: Jakson Aquino <jalvesaq@gmail.com>
" Former Maintainer: Johannes Ranke <jranke@uni-bremen.de>
" Last Change: Fri Oct 14, 2011 09:54PM
" Version: 0.7.4
" SVN: $Id: rhelp.vim 90 2010-11-22 10:58:11Z ranke $
" Last Change: Wed Jul 09, 2014 10:28PM
" Remarks: - Includes R syntax highlighting in the appropriate
" sections if an r.vim file is in the same directory or in the
" default debian location.
@@ -23,6 +21,8 @@ elseif exists("b:current_syntax")
finish
endif
setlocal iskeyword=@,48-57,_,.
syn case match
" R help identifiers {{{1
@@ -51,7 +51,12 @@ syn region rhelpRcode matchgroup=Delimiter start="\\examples{" matchgroup=Delimi
syn region rhelpRcode matchgroup=Delimiter start="\\usage{" matchgroup=Delimiter transparent end="}" contains=@R,rhelpIdentifier,rhelpS4method
syn region rhelpRcode matchgroup=Delimiter start="\\synopsis{" matchgroup=Delimiter transparent end="}" contains=@R
syn region rhelpRcode matchgroup=Delimiter start="\\special{" matchgroup=Delimiter transparent end="}" contains=@R
syn region rhelpRcode matchgroup=Delimiter start="\\code{" skip='\\\@<!{.\{-}\\\@<!}' transparent end="}" contains=@R,rhelpDots,rhelpString,rhelpSpecialChar,rhelpLink keepend
if v:version > 703
syn region rhelpRcode matchgroup=Delimiter start="\\code{" skip='\\\@1<!{.\{-}\\\@1<!}' transparent end="}" contains=@R,rhelpDots,rhelpString,rhelpSpecialChar,rhelpLink keepend
else
syn region rhelpRcode matchgroup=Delimiter start="\\code{" skip='\\\@<!{.\{-}\\\@<!}' transparent end="}" contains=@R,rhelpDots,rhelpString,rhelpSpecialChar,rhelpLink keepend
endif
syn region rhelpS4method matchgroup=Delimiter start="\\S4method{.*}(" matchgroup=Delimiter transparent end=")" contains=@R,rhelpDots
syn region rhelpSexpr matchgroup=Delimiter start="\\Sexpr{" matchgroup=Delimiter transparent end="}" contains=@R
@@ -127,8 +132,13 @@ syn region rhelpLink matchgroup=rhelpSection start="\\link\[.\{-}\]{" end="}" co
syn region rhelpLink matchgroup=rhelpSection start="\\linkS4class{" end="}" contained keepend extend
" Verbatim like {{{1
syn region rhelpVerbatim matchgroup=rhelpType start="\\samp{" skip='\\\@<!{.\{-}\\\@<!}' end="}" contains=rhelpSpecialChar,rhelpComment
syn region rhelpVerbatim matchgroup=rhelpType start="\\verb{" skip='\\\@<!{.\{-}\\\@<!}' end="}" contains=rhelpSpecialChar,rhelpComment
if v:version > 703
syn region rhelpVerbatim matchgroup=rhelpType start="\\samp{" skip='\\\@1<!{.\{-}\\\@1<!}' end="}" contains=rhelpSpecialChar,rhelpComment
syn region rhelpVerbatim matchgroup=rhelpType start="\\verb{" skip='\\\@1<!{.\{-}\\\@1<!}' end="}" contains=rhelpSpecialChar,rhelpComment
else
syn region rhelpVerbatim matchgroup=rhelpType start="\\samp{" skip='\\\@<!{.\{-}\\\@<!}' end="}" contains=rhelpSpecialChar,rhelpComment
syn region rhelpVerbatim matchgroup=rhelpType start="\\verb{" skip='\\\@<!{.\{-}\\\@<!}' end="}" contains=rhelpSpecialChar,rhelpComment
endif
" Type Styles {{{1
syn match rhelpType "\\emph\>"
@@ -200,6 +210,8 @@ syn match rhelpBraceError /[)}]/ contained
syn match rhelpCurlyError /[)\]]/ contained
syn match rhelpParenError /[\]}]/ contained
syntax sync match rhelpSyncRcode grouphere rhelpRcode "\\examples{"
" Define the default highlighting {{{1
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
@@ -233,4 +245,5 @@ if version >= 508 || !exists("did_rhelp_syntax_inits")
endif
let b:current_syntax = "rhelp"
" vim: foldmethod=marker:
" vim: foldmethod=marker sw=2

87
runtime/syntax/rmd.vim Normal file
View File

@@ -0,0 +1,87 @@
" markdown Text with R statements
" Language: markdown with R code chunks
" Last Change: Wed Jul 09, 2014 10:29PM
"
" CONFIGURATION:
" To highlight chunk headers as R code, put in your vimrc:
" let rmd_syn_hl_chunk = 1
" for portability
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" load all of pandoc info
runtime syntax/pandoc.vim
if exists("b:current_syntax")
let rmdIsPandoc = 1
unlet b:current_syntax
else
let rmdIsPandoc = 0
runtime syntax/markdown.vim
if exists("b:current_syntax")
unlet b:current_syntax
endif
endif
" load all of the r syntax highlighting rules into @R
syntax include @R syntax/r.vim
if exists("b:current_syntax")
unlet b:current_syntax
endif
if exists("g:rmd_syn_hl_chunk")
" highlight R code inside chunk header
syntax match rmdChunkDelim "^[ \t]*```{r" contained
syntax match rmdChunkDelim "}$" contained
else
syntax match rmdChunkDelim "^[ \t]*```{r.*}$" contained
endif
syntax match rmdChunkDelim "^[ \t]*```$" contained
syntax region rmdChunk start="^[ \t]*``` *{r.*}$" end="^[ \t]*```$" contains=@R,rmdChunkDelim keepend fold
" also match and syntax highlight in-line R code
syntax match rmdEndInline "`" contained
syntax match rmdBeginInline "`r " contained
syntax region rmdrInline start="`r " end="`" contains=@R,rmdBeginInline,rmdEndInline keepend
" match slidify special marker
syntax match rmdSlidifySpecial "\*\*\*"
if rmdIsPandoc == 0
syn match rmdBlockQuote /^\s*>.*\n\(.*\n\@<!\n\)*/ skipnl
" LaTeX
syntax include @LaTeX syntax/tex.vim
if exists("b:current_syntax")
unlet b:current_syntax
endif
" Inline
syntax match rmdLaTeXInlDelim "\$"
syntax match rmdLaTeXInlDelim "\\\$"
syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" contains=@texMathZoneGroup
" Region
syntax match rmdLaTeXRegDelim "\$\$" contained
syntax match rmdLaTeXRegDelim "\$\$latex$" contained
syntax region rmdLaTeXRegion start="^\$\$" skip="\\\$" end="\$\$$" contains=@LaTeX,rmdLaTeXSt,rmdLaTeXRegDelim keepend
syntax region rmdLaTeXRegion2 start="^\\\[" end="\\\]" contains=@LaTeX,rmdLaTeXSt,rmdLaTeXRegDelim keepend
hi def link rmdLaTeXSt Statement
hi def link rmdLaTeXInlDelim Special
hi def link rmdLaTeXRegDelim Special
endif
setlocal iskeyword=@,48-57,_,.
syn sync match rmdSyncChunk grouphere rmdChunk "^[ \t]*``` *{r"
hi def link rmdChunkDelim Special
hi def link rmdBeginInline Special
hi def link rmdEndInline Special
hi def link rmdBlockQuote Comment
hi def link rmdSlidifySpecial Special
let b:current_syntax = "rmd"
" vim: ts=8 sw=2

47
runtime/syntax/rrst.vim Normal file
View File

@@ -0,0 +1,47 @@
" reStructured Text with R statements
" Language: reST with R code chunks
" Maintainer: Alex Zvoleff, azvoleff@mail.sdsu.edu
" Last Change: Wed Jul 09, 2014 10:29PM
"
" CONFIGURATION:
" To highlight chunk headers as R code, put in your vimrc:
" let rrst_syn_hl_chunk = 1
" for portability
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" load all of the rst info
runtime syntax/rst.vim
unlet b:current_syntax
" load all of the r syntax highlighting rules into @R
syntax include @R syntax/r.vim
setlocal iskeyword=@,48-57,_,.
" highlight R chunks
if exists("g:rrst_syn_hl_chunk")
" highlight R code inside chunk header
syntax match rrstChunkDelim "^\.\. {r" contained
syntax match rrstChunkDelim "}$" contained
else
syntax match rrstChunkDelim "^\.\. {r .*}$" contained
endif
syntax match rrstChunkDelim "^\.\. \.\.$" contained
syntax region rrstChunk start="^\.\. {r.*}$" end="^\.\. \.\.$" contains=@R,rrstChunkDelim keepend transparent fold
" also highlight in-line R code
syntax match rrstInlineDelim "`" contained
syntax match rrstInlineDelim ":r:" contained
syntax region rrstInline start=":r: *`" skip=/\\\\\|\\`/ end="`" contains=@R,rrstInlineDelim keepend
hi def link rrstChunkDelim Special
hi def link rrstInlineDelim Special
let b:current_syntax = "rrst"
" vim: ts=8 sw=2

View File

@@ -5702,8 +5702,8 @@ buf_delete_signs(buf)
signlist_T *next;
/* When deleting the last sign need to redraw the windows to remove the
* sign column. */
if (buf->b_signlist != NULL)
* sign column. Not when curwin is NULL (this means we're exiting). */
if (buf->b_signlist != NULL && curwin != NULL)
{
redraw_buf_later(buf, NOT_VALID);
changed_cline_bef_curs();

View File

@@ -4592,7 +4592,10 @@ ins_compl_delete()
*/
i = compl_col + (compl_cont_status & CONT_ADDING ? compl_length : 0);
backspace_until_column(i);
/* Not sure what is still valid, better redraw everything. */
changed_cline_bef_curs();
redraw_curbuf_later(NOT_VALID);
}
/* Insert the new text being completed. */

View File

@@ -17329,6 +17329,13 @@ static int
#endif
item_compare2 __ARGS((const void *s1, const void *s2));
/* struct used in the array that's given to qsort() */
typedef struct
{
listitem_T *item;
int idx;
} sortItem_T;
static int item_compare_ic;
static int item_compare_numeric;
static char_u *item_compare_func;
@@ -17349,14 +17356,17 @@ item_compare(s1, s2)
const void *s1;
const void *s2;
{
sortItem_T *si1, *si2;
char_u *p1, *p2;
char_u *tofree1, *tofree2;
int res;
char_u numbuf1[NUMBUFLEN];
char_u numbuf2[NUMBUFLEN];
p1 = tv2string(&(*(listitem_T **)s1)->li_tv, &tofree1, numbuf1, 0);
p2 = tv2string(&(*(listitem_T **)s2)->li_tv, &tofree2, numbuf2, 0);
si1 = (sortItem_T *)s1;
si2 = (sortItem_T *)s2;
p1 = tv2string(&si1->item->li_tv, &tofree1, numbuf1, 0);
p2 = tv2string(&si2->item->li_tv, &tofree2, numbuf2, 0);
if (p1 == NULL)
p1 = (char_u *)"";
if (p2 == NULL)
@@ -17379,7 +17389,7 @@ item_compare(s1, s2)
/* When the result would be zero, compare the pointers themselves. Makes
* the sort stable. */
if (res == 0 && !item_compare_keep_zero)
res = s1 > s2 ? 1 : -1;
res = si1->idx > si2->idx ? 1 : -1;
vim_free(tofree1);
vim_free(tofree2);
@@ -17394,6 +17404,7 @@ item_compare2(s1, s2)
const void *s1;
const void *s2;
{
sortItem_T *si1, *si2;
int res;
typval_T rettv;
typval_T argv[3];
@@ -17403,10 +17414,13 @@ item_compare2(s1, s2)
if (item_compare_func_err)
return 0;
si1 = (sortItem_T *)s1;
si2 = (sortItem_T *)s2;
/* Copy the values. This is needed to be able to set v_lock to VAR_FIXED
* in the copy without changing the original list items. */
copy_tv(&(*(listitem_T **)s1)->li_tv, &argv[0]);
copy_tv(&(*(listitem_T **)s2)->li_tv, &argv[1]);
copy_tv(&si1->item->li_tv, &argv[0]);
copy_tv(&si2->item->li_tv, &argv[1]);
rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */
res = call_func(item_compare_func, (int)STRLEN(item_compare_func),
@@ -17426,7 +17440,7 @@ item_compare2(s1, s2)
/* When the result would be zero, compare the pointers themselves. Makes
* the sort stable. */
if (res == 0 && !item_compare_keep_zero)
res = s1 > s2 ? 1 : -1;
res = si1->idx > si2->idx ? 1 : -1;
return res;
}
@@ -17442,7 +17456,7 @@ do_sort_uniq(argvars, rettv, sort)
{
list_T *l;
listitem_T *li;
listitem_T **ptrs;
sortItem_T *ptrs;
long len;
long i;
@@ -17510,7 +17524,7 @@ do_sort_uniq(argvars, rettv, sort)
}
/* Make an array with each entry pointing to an item in the List. */
ptrs = (listitem_T **)alloc((int)(len * sizeof(listitem_T *)));
ptrs = (sortItem_T *)alloc((int)(len * sizeof(sortItem_T)));
if (ptrs == NULL)
return;
@@ -17519,7 +17533,11 @@ do_sort_uniq(argvars, rettv, sort)
{
/* sort(): ptrs will be the list to sort */
for (li = l->lv_first; li != NULL; li = li->li_next)
ptrs[i++] = li;
{
ptrs[i].item = li;
ptrs[i].idx = i;
++i;
}
item_compare_func_err = FALSE;
item_compare_keep_zero = FALSE;
@@ -17531,7 +17549,7 @@ do_sort_uniq(argvars, rettv, sort)
else
{
/* Sort the array with item pointers. */
qsort((void *)ptrs, (size_t)len, sizeof(listitem_T *),
qsort((void *)ptrs, (size_t)len, sizeof(sortItem_T),
item_compare_func == NULL ? item_compare : item_compare2);
if (!item_compare_func_err)
@@ -17540,7 +17558,7 @@ do_sort_uniq(argvars, rettv, sort)
l->lv_first = l->lv_last = l->lv_idx_item = NULL;
l->lv_len = 0;
for (i = 0; i < len; ++i)
list_append(l, ptrs[i]);
list_append(l, ptrs[i].item);
}
}
}
@@ -17559,7 +17577,7 @@ do_sort_uniq(argvars, rettv, sort)
{
if (item_compare_func_ptr((void *)&li, (void *)&li->li_next)
== 0)
ptrs[i++] = li;
ptrs[i++].item = li;
if (item_compare_func_err)
{
EMSG(_("E882: Uniq compare function failed"));
@@ -17571,12 +17589,12 @@ do_sort_uniq(argvars, rettv, sort)
{
while (--i >= 0)
{
li = ptrs[i]->li_next;
ptrs[i]->li_next = li->li_next;
li = ptrs[i].item->li_next;
ptrs[i].item->li_next = li->li_next;
if (li->li_next != NULL)
li->li_next->li_prev = ptrs[i];
li->li_next->li_prev = ptrs[i].item;
else
l->lv_last = ptrs[i];
l->lv_last = ptrs[i].item;
list_fix_watch(l, li);
listitem_free(li);
l->lv_len--;

View File

@@ -2004,11 +2004,14 @@ write_viminfo(file, forceit)
{
fclose(fp_in);
/*
* In case of an error keep the original viminfo file.
* Otherwise rename the newly written file.
*/
if (viminfo_errcnt || vim_rename(tempname, fname) == -1)
/* In case of an error keep the original viminfo file. Otherwise
* rename the newly written file. Give an error if that fails. */
if (viminfo_errcnt == 0 && vim_rename(tempname, fname) == -1)
{
++viminfo_errcnt;
EMSG2(_("E886: Can't rename viminfo file to %s!"), fname);
}
if (viminfo_errcnt > 0)
mch_remove(tempname);
#ifdef WIN3264

View File

@@ -3780,9 +3780,6 @@ check_mouse_termcode()
# ifdef FEAT_MOUSE_URXVT
/* same as the dec mouse */
if (use_xterm_mouse() == 3
# ifdef FEAT_TERMRESPONSE
&& !did_request_esc_sequence()
# endif
# ifdef FEAT_GUI
&& !gui.in_use
# endif
@@ -3797,7 +3794,8 @@ check_mouse_termcode()
mch_setmouse(FALSE);
setmouse();
}
xterm_conflict_mouse = TRUE;
/* It's OK to request the xterm version for uxterm. */
resume_get_esc_sequence();
}
else
del_mouse_termcode(KS_URXVT_MOUSE);

View File

@@ -619,7 +619,7 @@ win32_enable_privilege(LPTSTR lpszPrivilege, BOOL bEnable)
return FALSE;
}
tokenPrivileges.PrivilegeCount = 1;
tokenPrivileges.PrivilegeCount = 1;
tokenPrivileges.Privileges[0].Luid = luid;
tokenPrivileges.Privileges[0].Attributes = bEnable ?
SE_PRIVILEGE_ENABLED : 0;
@@ -1785,13 +1785,14 @@ mch_inchar(
#endif
{
int n = 1;
int conv = FALSE;
/* A key may have one or two bytes. */
typeahead[typeaheadlen] = c;
if (ch2 != NUL)
{
typeahead[typeaheadlen + 1] = ch2;
++n;
typeahead[typeaheadlen + 1] = 3;
typeahead[typeaheadlen + 2] = ch2;
n += 2;
}
#ifdef FEAT_MBYTE
/* Only convert normal characters, not special keys. Need to
@@ -1800,6 +1801,7 @@ mch_inchar(
if (input_conv.vc_type != CONV_NONE
&& (ch2 == NUL || c != K_NUL))
{
conv = TRUE;
typeaheadlen -= unconverted;
n = convert_input_safe(typeahead + typeaheadlen,
n + unconverted, TYPEAHEADLEN - typeaheadlen,
@@ -1807,6 +1809,24 @@ mch_inchar(
}
#endif
if (conv)
{
char_u *p = typeahead + typeaheadlen;
char_u *e = typeahead + TYPEAHEADLEN;
while (*p && p < e)
{
if (*p == K_NUL)
{
++p;
mch_memmove(p + 1, p, ((size_t)(e - p)) - 1);
*p = 3;
++n;
}
++p;
}
}
/* Use the ALT key to set the 8th bit of the character
* when it's one byte, the 8th bit isn't set yet and not
* using a double-byte encoding (would become a lead

View File

@@ -567,7 +567,9 @@ pum_set_selected(n, repeat)
g_do_tagpreview = 3;
if (p_pvh > 0 && p_pvh < g_do_tagpreview)
g_do_tagpreview = p_pvh;
++RedrawingDisabled;
resized = prepare_tagpreview(FALSE);
--RedrawingDisabled;
g_do_tagpreview = 0;
if (curwin->w_p_pvw)

View File

@@ -35,6 +35,7 @@ void settmode __ARGS((int tmode));
void starttermcap __ARGS((void));
void stoptermcap __ARGS((void));
int did_request_esc_sequence __ARGS((void));
void resume_get_esc_sequence __ARGS((void));
void may_req_termresponse __ARGS((void));
void may_req_ambiguous_char_width __ARGS((void));
int swapping_screen __ARGS((void));

View File

@@ -3109,15 +3109,25 @@ peekchr()
if (reg_magic >= MAGIC_OFF)
{
char_u *p = regparse + 1;
int is_magic_all = (reg_magic == MAGIC_ALL);
/* ignore \c \C \m and \M after '$' */
/* ignore \c \C \m \M \v \V and \Z after '$' */
while (p[0] == '\\' && (p[1] == 'c' || p[1] == 'C'
|| p[1] == 'm' || p[1] == 'M' || p[1] == 'Z'))
|| p[1] == 'm' || p[1] == 'M'
|| p[1] == 'v' || p[1] == 'V' || p[1] == 'Z'))
{
if (p[1] == 'v')
is_magic_all = TRUE;
else if (p[1] == 'm' || p[1] == 'M' || p[1] == 'V')
is_magic_all = FALSE;
p += 2;
}
if (p[0] == NUL
|| (p[0] == '\\'
&& (p[1] == '|' || p[1] == '&' || p[1] == ')'
|| p[1] == 'n'))
|| (is_magic_all
&& (p[0] == '|' || p[0] == '&' || p[0] == ')'))
|| reg_magic == MAGIC_ALL)
curchr = Magic('$');
}

View File

@@ -3852,7 +3852,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
{
shl->attr_cur = shl->attr;
}
else if (v == (long)shl->endcol)
else if (v >= (long)shl->endcol)
{
shl->attr_cur = 0;
next_search_hl(wp, shl, lnum, (colnr_T)v, cur);

View File

@@ -3330,6 +3330,19 @@ did_request_esc_sequence()
return crv_status == CRV_SENT || u7_status == U7_SENT
|| xt_index_out > xt_index_in;
}
/*
* If requesting the version was disabled in did_request_esc_sequence(),
* enable it again.
*/
void
resume_get_esc_sequence()
{
if (crv_status == 0)
crv_status = CRV_GET;
if (u7_status == 0)
u7_status = U7_GET;
}
# endif
@@ -3711,7 +3724,11 @@ add_termcode(name, string, flags)
return;
}
#if defined(WIN3264) && !defined(FEAT_GUI)
s = vim_strnsave(string, (int)STRLEN(string) + 1);
#else
s = vim_strsave(string);
#endif
if (s == NULL)
return;
@@ -3721,6 +3738,15 @@ add_termcode(name, string, flags)
STRMOVE(s, s + 1);
s[0] = term_7to8bit(string);
}
#if defined(WIN3264) && !defined(FEAT_GUI)
if (s[0] == K_NUL)
{
STRMOVE(s + 1, s);
s[1] = 3;
}
#endif
len = (int)STRLEN(s);
need_gather = TRUE; /* need to fill termleader[] */

View File

@@ -37,7 +37,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test105.out test106.out test107.out\
test_autoformat_join.out \
test_breakindent.out \
test_listlbr \
test_listlbr.out \
test_eval.out \
test_options.out

View File

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

View File

@@ -686,6 +686,8 @@ win_split_ins(size, flags, new_wp, dir)
int layout;
frame_T *frp, *curfrp;
int before;
int minwidth;
int minheight;
if (flags & WSP_TOP)
oldwin = firstwin;
@@ -725,11 +727,15 @@ win_split_ins(size, flags, new_wp, dir)
needed += p_wiw - p_wmw;
if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
{
minwidth = frame_minwidth(topframe, NULL);
available = topframe->fr_width;
needed += frame_minwidth(topframe, NULL);
needed += minwidth;
}
else
{
minwidth = frame_minwidth(oldwin->w_frame, NULL);
available = oldwin->w_width;
}
if (available < needed && new_wp == NULL)
{
EMSG(_(e_noroom));
@@ -739,6 +745,8 @@ win_split_ins(size, flags, new_wp, dir)
new_size = oldwin->w_width / 2;
if (new_size > oldwin->w_width - p_wmw - 1)
new_size = oldwin->w_width - p_wmw - 1;
if (new_size > available - minwidth - 1)
new_size = available - minwidth - 1;
if (new_size < p_wmw)
new_size = p_wmw;
@@ -786,11 +794,13 @@ win_split_ins(size, flags, new_wp, dir)
needed += p_wh - p_wmh;
if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
{
minheight = frame_minheight(topframe, NULL);
available = topframe->fr_height;
needed += frame_minheight(topframe, NULL);
needed += minheight;
}
else
{
minheight = frame_minheight(oldwin->w_frame, NULL);
available = oldwin->w_height;
needed += p_wmh;
}
@@ -810,6 +820,8 @@ win_split_ins(size, flags, new_wp, dir)
if (new_size > oldwin_height - p_wmh - STATUS_HEIGHT)
new_size = oldwin_height - p_wmh - STATUS_HEIGHT;
if (new_size > available - minheight - STATUS_HEIGHT)
new_size = available - minheight - STATUS_HEIGHT;
if (new_size < p_wmh)
new_size = p_wmh;
@@ -2477,6 +2489,10 @@ win_free_all()
while (firstwin != NULL)
(void)win_free_mem(firstwin, &dummy, NULL);
/* No window should be used after this. Set curwin to NULL to crash
* instead of using freed memory. */
curwin = NULL;
}
#endif
@@ -4836,15 +4852,20 @@ win_size_restore(gap)
garray_T *gap;
{
win_T *wp;
int i;
int i, j;
if (win_count() * 2 == gap->ga_len)
{
i = 0;
for (wp = firstwin; wp != NULL; wp = wp->w_next)
/* The order matters, because frames contain other frames, but it's
* difficult to get right. The easy way out is to do it twice. */
for (j = 0; j < 2; ++j)
{
frame_setwidth(wp->w_frame, ((int *)gap->ga_data)[i++]);
win_setheight_win(((int *)gap->ga_data)[i++], wp);
i = 0;
for (wp = firstwin; wp != NULL; wp = wp->w_next)
{
frame_setwidth(wp->w_frame, ((int *)gap->ga_data)[i++]);
win_setheight_win(((int *)gap->ga_data)[i++], wp);
}
}
/* recompute the window positions */
(void)win_comp_pos();
@@ -5732,7 +5753,7 @@ win_new_height(wp, height)
--wp->w_wrow;
}
}
set_topline(wp, lnum);
set_topline(wp, lnum);
}
else if (sline > 0)
{
@@ -5778,7 +5799,7 @@ win_new_height(wp, height)
wp->w_wrow -= sline;
}
set_topline(wp, lnum);
set_topline(wp, lnum);
}
}