Compare commits

...

10 Commits

Author SHA1 Message Date
Bram Moolenaar
ff18df03c3 updated for version 7.4a.044
Problem:    Test 96 sometimes fails.
Solution:   Clear window from b_wininfo in win_free().  (Suggestion by
            Yukihiro Nakadaira)
2013-07-24 17:51:57 +02:00
Bram Moolenaar
af003f6384 updated for version 7.4a.043
Problem:    More ml_get errors when adding or deleting lines from Python.
            (Vlad Irnov)
Solution:   Switch to a window with the buffer when possible.
2013-07-24 17:11:46 +02:00
Bram Moolenaar
2b90ed294e updated for version 7.4a.042
Problem:    Crash when BufUnload autocommands close all buffers. (Andrew
            Pimlott)
Solution:   Set curwin->w_buffer to curbuf to avoid NULL.
2013-07-24 16:02:36 +02:00
Bram Moolenaar
ad875fb7ff updated for version 7.4a.041
Problem:    When using ":new ++ff=unix" and "dos" is first in 'fileformats'
            then 'ff' is set to "dos" instead of "unix". (Ingo Karkat)
Solution:   Create set_file_options() and invoke it from do_ecmd().
2013-07-24 15:02:03 +02:00
Bram Moolenaar
e24a9c0b59 updated for version 7.4a.040
Problem:    Win32: using uninitialized variable.
Solution:   (Yukihiro Nakadaira)
2013-07-24 13:49:22 +02:00
Bram Moolenaar
196ed14d15 updated for version 7.4a.039
Problem:    New regexp engine doesn't match pattern. (Ingo Karkat)
Solution:   When adding a state also check for different PIM if the list of
            states has any state with a PIM.
2013-07-21 18:59:24 +02:00
Bram Moolenaar
9d48895e4c updated for version 7.4a.038
Problem:    When using MSVC 2012 there are various issues, including GUI size
            computations.
Solution:   Use SM_CXPADDEDBORDER. (Mike Williams)
2013-07-21 17:53:58 +02:00
Bram Moolenaar
5f919ee8eb updated for version 7.4a.037
Problem:    Win32: When mouse is hidden and in the toolbar, moving it won't
            make it appear. (Sami Salonen)
Solution:   Add tabline_wndproc() and toolbar_wndproc(). (Ken Takata)
2013-07-21 17:46:43 +02:00
Bram Moolenaar
ac7c33e38c updated for version 7.4a.036
Problem:    "\p" in a regexp does not match double-width characters.
            (Yukihiro Nakadaira)
Solution:   Don't count display cells, use vim_isprintc().
2013-07-21 17:06:00 +02:00
Bram Moolenaar
9ba7e17de1 Updated runtime files. 2013-07-17 22:37:26 +02:00
33 changed files with 555 additions and 204 deletions

View File

@@ -1,4 +1,4 @@
*change.txt* For Vim version 7.4a. Last change: 2013 Mar 19
*change.txt* For Vim version 7.4a. Last change: 2013 Jul 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -71,9 +71,21 @@ For inserting text see |insert.txt|.
"D" deletes the highlighted text plus all text until
the end of the line. {not in Vi}
*:d* *:de* *:del* *:delete* *:dl*
*:d* *:de* *:del* *:delete* *:dl* *:dp*
:[range]d[elete] [x] Delete [range] lines (default: current line) [into
register x].
Note these weird abbreviations:
:dl delete and list
:dell idem
:delel idem
:deletl idem
:deletel idem
:dp delete and print
:dep idem
:delp idem
:delep idem
:deletp idem
:deletep idem
:[range]d[elete] [x] {count}
Delete {count} lines, starting with [range]

View File

@@ -1,4 +1,4 @@
*if_pyth.txt* For Vim version 7.4a. Last change: 2013 Jun 28
*if_pyth.txt* For Vim version 7.4a. Last change: 2013 Jul 10
VIM REFERENCE MANUAL by Paul Moore
@@ -23,6 +23,7 @@ The Python 2.x interface is available only when Vim was compiled with the
|+python| feature.
The Python 3 interface is available only when Vim was compiled with the
|+python3| feature.
Both can be available at the same time, but read |python-2-and-3|.
==============================================================================
1. Commands *python-commands*
@@ -711,7 +712,7 @@ Vim can be built in four ways (:version output):
3. Python 3 support only (-python, +python3 or +python3/dyn)
4. Python 2 and 3 support (+python/dyn, +python3/dyn)
Some more details on the special case 4:
Some more details on the special case 4: *python-2-and-3*
When Python 2 and Python 3 are both supported they must be loaded dynamically.

View File

@@ -1,4 +1,4 @@
*index.txt* For Vim version 7.4a. Last change: 2013 Jun 21
*index.txt* For Vim version 7.4a. Last change: 2013 Jul 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1191,9 +1191,12 @@ tag command action ~
|:digraphs| :dig[raphs] show or enter digraphs
|:display| :di[splay] display registers
|:djump| :dj[ump] jump to #define
|:dlist| :dl[ist] list #defines
|:dl| :dl short for |:delete|
|:dl| :del[ete]l short for |:delete|
|:dlist| :dli[st] list #defines
|:doautocmd| :do[autocmd] apply autocommands to current buffer
|:doautoall| :doautoa[ll] apply autocommands for all loaded buffers
|:dp| :d[elete]p short for |:delete|
|:drop| :dr[op] jump to window editing file or edit file in
current window
|:dsearch| :ds[earch] list one #define

View File

@@ -1,4 +1,4 @@
*insert.txt* For Vim version 7.4a. Last change: 2013 Jul 04
*insert.txt* For Vim version 7.4a. Last change: 2013 Jul 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1359,7 +1359,7 @@ Complete:
Completion works in separate JavaScript files (&ft==javascript), inside of
<script> tag of (X)HTML and in values of event attributes (including scanning
of external files.
of external files).
DOM compatibility
@@ -1515,8 +1515,7 @@ The basic form of this variable is: >
let g:omni_syntax_group_include_{filetype} = 'regex,comma,separated'
The PHP language has an enormous number of items which it knows how to syntax
highlight. These these items will be available within the omni completion
list.
highlight. These items will be available within the omni completion list.
Some people may find this list unwieldy or are only interested in certain
items. There are two ways to prune this list (if necessary). If you find

View File

@@ -1,4 +1,4 @@
*motion.txt* For Vim version 7.4a. Last change: 2013 Mar 07
*motion.txt* For Vim version 7.4a. Last change: 2013 Jul 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -236,6 +236,8 @@ g$ or g<End> When lines wrap ('wrap' on): To the last character of
the line is not on the screen or when a count is used.
Additionally, vertical movements keep the column,
instead of going to the end of the line.
When 'virtualedit' is enabled moves to the end of the
screen line.
{not in Vi}
*bar*
@@ -1083,7 +1085,8 @@ only once.
When the |:keepjumps| command modifier is used, jumps are not stored in the
jumplist. Jumps are also not stored in other cases, e.g., in a |:global|
command. You can explicitly add a jump by setting the ' mark.
command. You can explicitly add a jump by setting the ' mark with "m'". Note
that calling setpos() does not do this.
After the CTRL-O command that got you into line 1154 you could give another
jump command (e.g., "G"). The jump list would then become:

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.4a. Last change: 2013 Jul 07
*options.txt* For Vim version 7.4a. Last change: 2013 Jul 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -7863,8 +7863,9 @@ A jump table for the options with a short description can be found at |Q_op|.
if the line was empty. But it is far from Vi compatible. It may also
break some plugins or Vim scripts. For example because |l| can move
the cursor after the last character. Use with care!
Using the |$| command will move to the last character in the line, not
Using the `$` command will move to the last character in the line, not
past it. This may actually move the cursor to the left!
The `g$` command will move to the end of the screen line.
It doesn't make sense to combine "all" with "onemore", but you will
not get a warning for it.

View File

@@ -1,4 +1,4 @@
*spell.txt* For Vim version 7.4a. Last change: 2013 Jun 26
*spell.txt* For Vim version 7.4a. Last change: 2013 Jul 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1133,7 +1133,7 @@ WORDS WITH A SLASH *spell-SLASH*
The slash is used in the .dic file to separate the basic word from the affix
letters and other flags. Unfortunately, this means you cannot use a slash in
a word. Thus "TCP/IP" is not a word but "TCP with the flags "IP". To include
a word. Thus "TCP/IP" is not a word but "TCP" with the flags "IP". To include
a slash in the word put a backslash before it: "TCP\/IP". In the rare case
you want to use a backslash inside a word you need to use two backslashes.
Any other use of the backslash is reserved for future expansion.
@@ -1382,7 +1382,7 @@ Only case-folded letters need to be included.
Another way to restrict compounding was mentioned above: Adding the
|spell-COMPOUNDFORBIDFLAG| flag to an affix causes all words that are made
with that affix not be be used for compounding.
with that affix to not be used for compounding.
UNLIMITED COMPOUNDING *spell-NOBREAK*

View File

@@ -2124,6 +2124,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:doautoa autocmd.txt /*:doautoa*
:doautoall autocmd.txt /*:doautoall*
:doautocmd autocmd.txt /*:doautocmd*
:dp change.txt /*:dp*
:dr windows.txt /*:dr*
:drop windows.txt /*:drop*
:ds tagsrch.txt /*:ds*
@@ -4850,6 +4851,7 @@ beos-timeout os_beos.txt /*beos-timeout*
beos-unicode os_beos.txt /*beos-unicode*
beos-utf8 os_beos.txt /*beos-utf8*
beos-vimdir os_beos.txt /*beos-vimdir*
better-python-interface version7.txt /*better-python-interface*
beval_bufnr-variable eval.txt /*beval_bufnr-variable*
beval_col-variable eval.txt /*beval_col-variable*
beval_lnum-variable eval.txt /*beval_lnum-variable*
@@ -7382,6 +7384,7 @@ py3eval() eval.txt /*py3eval()*
pyeval() eval.txt /*pyeval()*
python if_pyth.txt /*python*
python-.locked if_pyth.txt /*python-.locked*
python-2-and-3 if_pyth.txt /*python-2-and-3*
python-Dictionary if_pyth.txt /*python-Dictionary*
python-Function if_pyth.txt /*python-Function*
python-List if_pyth.txt /*python-List*

View File

@@ -1,4 +1,4 @@
*tagsrch.txt* For Vim version 7.4a. Last change: 2011 Oct 28
*tagsrch.txt* For Vim version 7.4a. Last change: 2013 Jul 17
VIM REFERENCE MANUAL by Bram Moolenaar

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.4a. Last change: 2013 Jul 08
*todo.txt* For Vim version 7.4a. Last change: 2013 Jul 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -34,6 +34,18 @@ not be repeated below, unless there is extra information.
*known-bugs*
-------------------- Known bugs and current work -----------------------
Edit changed-7.4 text.
Patch for this bug: (Ken Takata, 2013 Jul 17)
8 Win32: When mouse is hidden and in the toolbar, moving it won't make it
appear. (Sami Salonen)
This results in 'fileformat' set to "dos" instead of "unix". (Ingo Karkat,
2013 Jul 16)
:set fileformats=dos,unix
:new ++ff=unix
Also for ++bin and ++enc.
Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
Patch to add "acl" and "xpm" as a feature. (Ken Takata, 2013 Jul 8)
@@ -102,6 +114,9 @@ May 28: with options
Patch to support 'u' in interactive substitute. (Christian Brabandt, 2012 Sep
28) With tests: Oct 9.
Patch from Christian Brabandt to make the "buffer" argument for ":sign place"
optional. (2013 Jul 12)
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)
@@ -118,9 +133,7 @@ Issue 54: document behavior of -complete, also expands arg.
the two into a regex for searching. (Ned Konz)
Patch by Christian Brabandt, 2013 Apr 20, unfinished.
Bug: findfile("any", "http://;") returns http://any. (Andrew Pimlott, 2013 May
7) Not sure if that can be fixed, but when using "file://" it should be
possible to check if the file exists.
Bug: findfile("any", "file:///tmp;") does not work.
v:register is not directly reset to " after a delete command that specifies a
register. It is reset after the next command. (Steve Vermeulen, 2013 Mar 16)
@@ -130,8 +143,6 @@ register. It is reset after the next command. (Steve Vermeulen, 2013 Mar 16)
Patch to set antialiasing style on Windows. (Ondrej Balaz, 2013 Mar 14)
Needs a different check for CLEARTYPE_QUALITY.
Issue 72: 'autochdir' causes problems for :vimgrep.
In the ATTENTION message about an existing swap file, mention the name of the
process that is running. It might actually be some other program, e.g. after
a reboot.
@@ -169,10 +180,14 @@ b:undo_ftplugin cannot call a script-local function. (Boris Danilov, 2013 Jan
Win32: The Python interface only works with one version of Python, selected at
compile time. Can this be made to work with version 2.1 and 2.2 dynamically?
Python: Extended funcrefs: use func_T* structure in place of char_u* function
names. (ZyX, 2013 Jul 15 and later)
Python: Be able to define a Python function that can be called directly from
Vim script. Requires converting the arguments and return value, like with
vim.bindeval().
Patch for :tabcloseleft, after closing a tab go to left tab. (William Bowers,
2012 Aug 4)
@@ -192,6 +207,17 @@ Szamotulski, 2012 Nov 8)
Crash in autocmd that unloads buffers in a BufUnload event. (Andrew Pimlott,
2012 Aug 11) Disallow :new when BufUnload is being handled?
Issue 72: 'autochdir' causes problems for :vimgrep.
'autochdir' causes problems for setbufvar(). (Ben Fritz, 2013 Jul 16)
Session file creation: 'autochdir' causes trouble. Keep it off until after
loading all files.
Win32: When 'autochdir' is on and 'encoding' is changed, files on the command
line are opened again, but from the wrong directory. Apply 'autochdir' only
after starting up?
Patch to add ":ldo" and ":cdo", execute commands over quickfix list and
location list. (Yegappan Lakshmanan, 2013 Jun 2)
@@ -217,6 +243,7 @@ Also question if examples are correct.
It should be possible to make globpath() return a list instead of a string,
like with glob(). (Greg Novack, 2012 Nov 2)
Patch by Adnan Zafar, 2013 Jul 15.
The input map for CTRL-O in mswin.vim causes problems after CTRL-X CTRL-O.
Suggestion for another map. (Philip Mat, 2012 Jun 18)
@@ -271,8 +298,6 @@ Should use has("browsefilter") in ftplugins. Requires patch 7.3.593.
Update for vim2html.pl. (Tyru, 2013 Feb 22)
Issue 48: foldopen error can't be caught by try/catch
Patch to sort functions starting with '<' after others. Omit dict functions,
they can't be called. (Yasuhiro Matsumoto, 2011 Oct 11)
@@ -281,6 +306,9 @@ Patch to pass list to or(), and() and xor(). (Yasuhiro Matsumoto, 2012 Feb 8)
Patch to improve "it" and "at" text object matching. (Christian Brabandt, 2011
Nov 20)
Windows 7 confirm() dialog can be taller than the screen. (David Fishburn,
2013 Jul 9) Does not count the height of the buttons?
Patch to improve GUI find/replace dialog. (Christian Brabandt, 2012 May 26)
Update Jun 2.
@@ -330,9 +358,6 @@ Sep 17) Asked for feedback from others.
Win32: Cannot cd into a directory that starts with a space. (Andy Wokula, 2012
Jan 19)
Win32: default for 'backupcopy' is wrong for a symbolic link. (mklink one
two). (Benjamin Fritz, 2012 Mar 15)
Need to escape $HOME on Windows? (ZyX, 2011 Jul 21, discussion 2013 Jul 4)
Can't simply use a backslash, \$HOME has a different meaning already.
Would be possible to use $$HOME where $HOME is to be used.
@@ -342,27 +367,9 @@ Oct 26)
Bug in repeating Visual "u". (Lawrence Kesteloot, 2010 Dec 20)
Using "p" in Visual mode while specifying the small delete register "-
overwrites the register before it is put. (Marcin Szamotulski, 2012 Nov 23)
With "unamedplus" in 'clipboard' pasting in Visual mode causes error for empty
register. (Michael Seiwald, 2011 Jun 28) I can't reproduce it.
In GTK Gvim, setting 'lines' and 'columns' to 99999 causes a crash (Tony
Mechelynck, 2011 Apr 25). Can reproduce the crash sometimes:
gvim -N -u NONE --cmd 'set lines=99999 columns=99999'
(gvim:25968): Gdk-WARNING **: Native Windows wider or taller than 65535 pixels are not supported
The program 'gvim' received an X Window System error.
This probably reflects a bug in the program.
The error was 'RenderBadPicture (invalid Picture parameter)'.
(Details: serial 313 error_code 161 request_code 149 minor_code 8)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
Check that number of pixels doesn't go above 65535?
Windows keys not set properly on Windows 7? (cncyber, 2010 Aug 26)
When using a Vim server, a # in the path causes an error message.
@@ -409,6 +416,9 @@ Make 'formatprg' global-local. (Sung Pae)
When doing "redir => s:foo" in a script and then "redir END" somewhere else
(e.g. in a function) it can't find s:foo.
When a script contains "redir => s:foo" but doesn't end redirection, a
following "redir" command gives an error for not being able to access s:foo.
(ZyX, 2011 Mar 27)
When setqflist() uses a filename that triggers a BufReadCmd autocommand Vim
doesn't jump to the correct line with :cfirst. (ZyX, 2011 Sep 18)
@@ -441,10 +451,6 @@ May 24) Update May 26.
Patch for :tabrecently. (Hirokazu Yoshida, 2012 Jan 30)
When a script contains "redir => s:foo" but doesn't end redirection, a
following "redir" command gives an error for not being able to access s:foo.
(ZyX, 2011 Mar 27)
Problem with "syn sync gouphere". (Gustavo Niemeyer, 2011 Jan 27)
Loading autoload script even when usage is inside "if 0". (Christian Brabandt,
@@ -471,9 +477,6 @@ Update by Ben Fritz, with fix for TOhtml. (2011 Jul 30)
avoid matching something up to a time 11:22:33.
Patch by Christian Brabandt, 2011 Jul 27.
Patch to fix \%V item in regexp. (Christian Brabandt, 2010 Nov 8)
Update Nov 19. James Vega: still not right. Christian: it's difficult.
Patch to add up to 99 match groups. (Christian Brabandt, 2010 Dec 22)
Also add named groups: \%{name}(re) and \%{name}g
@@ -506,14 +509,6 @@ New esperanto spell file can't be processed. (Dominique Pelle, 2011 Jan 30)
"L'Italie" noted as a spell error at start of the sentence. (Dominique Pelle,
2011 Feb 27)
Copy/paste between Vim and Google chrome doesn't work well for multi-byte
characters. (Ben Haskell, 2010 Sep 17)
When putting text in the cut buffer (when exiting) and conversion doesn't work
properly, Prepend "ENC==={value of 'enc'}:" to the text and don't convert?
Then it should at least work from Vim to Vim and in other applications it's
clear why it doesn't work.
Experimental patch by Christian Brabandt, 2012 Apr 19.
Editing a file with a ^M with 'ff' set to "mac", opening a help file, then the
^M is displayed as ^J sometimes. Getting 'ff' value from wrong window/buffer?
@@ -530,6 +525,9 @@ the command line. (Ingo Karkat, 2011 Jan 25)
Since patch 7.2.46 Yankring plugin has become very slow, eventually make Vim
crash? (Raiwil, 2010 Nov 17)
Patch to add FoldedLineNr highlighting: different highlighting for the line
number of a closed fold. (eXerigumo Clanjor, 2013 Jul 15)
Does not work with NFA regexp engine:
- \%u, \%x, \%o, \%d followed by a composing character
@@ -593,10 +591,6 @@ Messages in message.txt are highlighted as examples.
When using cp850 the NBSP (0xff) is not drawn correctly. (Brett Stahlman, 2010
Oct 22) 'isprint' is set to "@,161-255".
Test 73 fails on MS-Windows when compiled with DJGPP and run twice. How to
delete the Xfind directory? Add an rmdir() function, just like we have
mkdir().
":echo "\x85" =~# '[\u0085]'" returns 1 instead of 0. (ZyX, 2010 Oct 3)
'cindent' not correct when 'list' is set. (Zdravi Korusef, 2010 Apr 15)
@@ -619,10 +613,6 @@ accented character. (Tony Mechelynck, 2010 Apr 15)
Don't call check_restricted() for histadd(), setbufvar(), settabvar(),
setwinvar().
Echo starts in the wrong column:
while 1 | let s = input('A') | echo 'R' | endw
(Boyko Bantchev, 2010 Aug 9)
Patch for GVimExt to show an icon. (Dominik Riebeling, 2010 Nov 7)
When writing a file > 2Gbyte, the reported number of bytes is negative.
@@ -821,9 +811,6 @@ Add "no_hlsearch" to winsaveview().
Cursorline highlighting combines with Search ('hlsearch') but not with
SpellBad. (Jim Karsten, 2009 Mar 18)
When 'foldmethod' is "indent", using >> on a line just above a fold makes the
cursor line folded. (Evan Laforge, 2009 Oct 17)
When 'foldmethod' is "indent", adding an empty line below a fold and then
indented text, creates a new fold instead of joining it with the previous one.
(Evan Laforge, 2009 Oct 17)
@@ -852,8 +839,6 @@ Support a 'systemencoding' option (for Unix). It specifies the encoding of
file names. (Kikuchan, 2010 Oct 5). Useful on a latin1 or double-byte Asian
system when 'encoding' is "utf-8".
Win32 GUI: Changing manifest helps for dpi changes (Joe Castro, 2009 Mar 27)
Win32 GUI: last message from startup doesn't show up when there is an echoerr
command. (Cyril Slobin, 2009 Mar 13)
@@ -994,9 +979,6 @@ argument is processed for <f-args>. (Ivan Tishchenko, 2008 Aug 19)
Win32: associating a type with Vim doesn't take care of space after a
backslash? (Robert Vibrant, 2008 Jun 5)
Win32: bold font doesn't work when 'guifontwide' has been set. (Yue Wu, 2010
Aug 23)
When 'rightleft' is set, cursorcolumn isn't highlighted after the end of a
line. It's also wrong in folds. (Dominique Pelle, 2010 Aug 21)
@@ -1293,10 +1275,6 @@ patches by Mathias, see mail Feb 22)
Win32: compiling with normal features and OLE fails. Patch by Mathias
Michaelis, 2006 Jun 4.
Win32: echo doesn't work for gvim.exe.mnf. Use inline file. Patch by Mathias
Michaelis. http://groups.yahoo.com/group/vimdev/message/43765
Patch that includes this and does more by George Reilly, 2007 Feb 12
Win16: include patches to make Win16 version work. (Vince Negri, 2006 May 22)
Win32: after "[I" showing matches, scroll wheel messes up screen. (Tsakiridis,
@@ -1445,13 +1423,6 @@ that char is single width when it's set (compare with 'listchars').
The generated vim.bat can avoid the loop for NT. (Carl Zmola, 2006 Sep 3)
Session file creation: 'autochdir' causes trouble. Keep it off until after
loading all files.
Win32: When 'autochdir' is on and 'encoding' is changed, files on the command
line are opened again, but from the wrong directory. Apply 'autochdir' only
after starting up?
When showing a diff between a non-existent file and an existing one, with the
cursor in the empty buffer, the other buffer only shows the last line. Change
the "insert" into a change from one line to many? (Yakov Lerner, 2008 May 27)
@@ -1544,8 +1515,6 @@ After starting Vim, using '0 to jump somewhere in a file, ":sp" doesn't center
the cursor line. It works OK after some other commands.
Win32: Is it possible to have both postscript and Win32 printing?
Does multi-byte printing with ":hardcopy" work? Add remark in documentation
about this.
Check: Running Vim in a console and still having connect to the X server for
copy/paste: is stopping the X server handled gracefully? Should catch the X
@@ -1932,8 +1901,6 @@ Win32 GUI known bugs:
console, go back to Vim and click "reload" in the dialog for the changed
file: Window moves with the cursor!
Put focus event in input buffer and let generic Vim code handle it?
8 Win32: When mouse is hidden and in the toolbar, moving it won't make it
appear. (Sami Salonen)
8 Win32 GUI: With maximized window, ":set go-=r" doesn't use the space that
comes available. (Poucet) It works OK on Win 98 but doesn't work on Win
NT 4.0. Leaves a grey area where the scrollbar was. ":set go+=r" also
@@ -3920,7 +3887,6 @@ Command line editing:
Command line completion:
8 Completing ":r ~br" should find matching user names.
8 Change expand_interactively into a flag that is passed as an argument.
8 With command line completion after '%' and '#', expand current/alternate
file name, so it can be edited. Also with modifiers, such as "%:h".

View File

@@ -1,4 +1,4 @@
*version7.txt* For Vim version 7.4a. Last change: 2013 Jul 07
*version7.txt* For Vim version 7.4a. Last change: 2013 Jul 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -70,6 +70,7 @@ Fixed |fixed-7.3|
VERSION 7.4 |version-7.4|
New regexp engine |new-regexp-engine|
Better Python interface |better-python-interface|
Changed |changed-7.4|
Added |added-7.4|
Fixed |fixed-7.4|
@@ -10163,6 +10164,9 @@ This section is about improvements made between version 7.3 and 7.4.
This release has hundreds of bug fixes and there are a few new features. The
most notable new features are:
- New regexp engine |new-regexp-engine|
- A more pythonic Python interface |better-python-interface|
New regexp engine *new-regexp-engine*
-----------------
@@ -10183,15 +10187,169 @@ is now working fine. Previously Vim could get stuck.
More information here: |two-engines|
Better Python interface *better-python-interface*
-----------------------
Added |python-bindeval| function. Unlike |python-eval| this one returns
|python-Dictionary|, |python-List| and |python-Function| objects for
dictionaries lists and functions respectively in place of their python
built-in equivalents (or None if we are talking about function references).
For simple types this function returns python built-in types and not only
python `str()` like |python-eval| does. On python 3 it will return `bytes()`
objects in place of `str()` ones avoiding possibility of UnicodeDecodeError.
Interface of new objects mimics standard python `dict()` and `list()`
interfaces to some extent. Extent will be improved in the future.
Added special |python-vars| objects also available for |python-buffer| and
|python-window|. They ease access to VimL variables from python.
Now you no longer need to alter `sys.path` to import your module: special
hooks are responsible for importing from {rtp}/python2, {rtp}/python3 and
{rtp}/pythonx directories (for python 2, python 3 and both respectively).
See |python-special-path|.
Added possibility to work with |tabpage|s through |python-tabpage| object.
Added automatic conversion of vim errors and exceptions to python
exceptions.
Changed the behavior of |python-buffers| object: it now uses buffer numbers
as keys in place of the index of the buffer in the internal buffer list.
This should not break anything as the only way to get this index was
iterating over |python-buffers|.
Added |:pydo| and |:py3do| commands.
Added |pyeval()| and |py3eval()| functions.
Now in all places which previously accepted `str()` objects in both python
version both `str()` and `unicode()` (python 2) or `bytes()` and `str()`
(python 3) are accepted.
|python-window| has gained `.col` and `.row` attributes that are currently
the only way to get internal window positions.
Added or fixed support for `dir()` in vim python objects.
Old python versions (≤2.2) are no longer supported. Building with them did
not work anyway.
Changed *changed-7.4*
-------
Todo.
Functions:
Added ability to use |Dictionary-function|s for |sort()|ing, via
optional third argument. (Nikolay Pavlov)
Added special |expand()| argument that expands to the current line
number.
Made it possible to force |char2nr()| always give unicode codepoints
regardless of current encoding. (Yasuhiro Matsumoto)
Made it possible for functions generating file list generate |List|
and not NL-separated string. (e.g. |glob()|, |expand()|) (Christian
Brabandt)
Functions that obtain variables from the specific window, tabpage or
buffer scope dictionary can now return specified default value in
place of empty string in case variable is not found. (|gettabvar()|,
|getwinvar()|, |getbufvar()|) (Shougo Matsushita, Hirohito Higashi)
Options:
Added ability to automatically save selection into the system
clipboard when using non-GUI version of vim (autoselectplus in
'clipboard'). Also added ability to use system clipboard as default
register (previously only primary selection could be used). (Ivan
Krasilnikov, Christian Brabandt, Bram Moolenaar)
Added special 'shiftwidth' value that makes 'sw' follow 'tabstop'. As
indenting via 'indentexpr' became tricky |shiftwidth()| function was
added. Also added equivalent special value to 'softtabstop' option.
(Christian Brabandt, so8res)
Added ability to delete comment leader when using |J| by `j` flag in
'formatoptions' (|fo-table|). (Lech Lorens)
Added ability to control indentation inside namespaces: |cino-N|.
(Konstantin Lepa)
Added ability to control alignment inside `if` condition separately
from alignment inside function arguments: |cino-k|. (Lech Lorens)
Added ability to show absolute number in number column when
'relativenumber' option is on. (Christian Brabandt)
Comands:
Made it possible to remove all signs from the current buffer using
|:sign-unplace|. (Christian Brabandt)
Added |:language| autocompletion. (Dominique Pelle)
|:diffoff| now saves the local values of some settings and restores
them in place of blindly resetting them to the defaults. (Christian
Brabandt)
Added |:map-nowait| creating mapping which when having lhs that is the
prefix of another mappings lhs will not allow vim to wait for user to
type more characters to resolve ambiguity, forcing vim to take the
shorter alternative: one with <nowait>.
Added more |:command-complete| completion types: |:behave| suboptions,
color schemes, compilers, |:cscope| suboptions, files from 'path',
|:history| suboptions, locale names, |:syntime| suboptions, user
names. (Dominique Pelle)
Other:
Improved support for cmd.exe. (Ben Fritz, Bram Moolenaar)
Added |v:windowid| variable containing current window number in GUI
vim. (Christian J. Robinson, Lech Lorens)
Lua interface now also uses userdata binded to vim structures. (Taro
Muraoka, Luis Carvalho)
Added rxvt-unicode and >xterm-277 mouse support. (Yiding Jia, Hayaki
Saito)
Added *added-7.4*
-----
Added support for |Lists| and |Dictionaries| in |viminfo|. (Christian
Brabandt)
Functions:
Bitwise functions: |and()|, |or()|, |invert()|, |xor()|.
Added |luaeval()| function. (Taro Muraoka, Luis Carvalho)
Added |sha256()| function. (Tyru, Hirohito Higashi)
Added |wildmenumode()| function. (Christian Brabandt)
Debugging functions: |screenattr()|, |screenchar()|, |screencol()|,
|screenrow()|. (Simon Ruderich, Bram Moolenaar)
Autocommands:
Added |InsertCharPre| event launched before inserting character.
(Jakson A. Aquino)
Added |CompleteDone| event launched after finishing completion in
insert mode. (idea by Florian Klein)
Added |QuitPre| event launched when commands that can either close vim
or only some window(s) are launched.
Added |TextChanged| and |TextChangedI| events launched when text is
changed.
Commands:
|:syntime| command useful for debugging.
Options:
Made it possible to ignore case when completing: 'wildignorecase'.
Various syntax, indent and other plugins were added.
@@ -11730,7 +11888,7 @@ Solution: Don't trigger CursorHold when there is typeahead.
Files: src/fileio.c
Patch 7.3.261
Problem: G++ error message errornously recognized as error.
Problem: G++ error message erroneously recognized as error.
Solution: Ignore "In file included from" line also when it ends in a colon.
(Fernando Castillo)
Files: src/option.h
@@ -13682,7 +13840,7 @@ Files: src/buffer.c, src/eval.c, src/proto/eval.pro, src/structs.h,
Patch 7.3.604
Problem: inputdialog() doesn't use the cancel argument in the console.
(David Fishburn)
Solution: Use the third argument. (Christian Brabant)
Solution: Use the third argument. (Christian Brabandt)
Files: src/eval.c
Patch 7.3.605 (after 7.3.577)
@@ -15523,7 +15681,7 @@ Patch 7.3.926
Problem: Autocommands are triggered by setwinvar() et al. Missing BufEnter
on :tabclose. Duplicate WinEnter on :tabclose. Wrong order of
events for :tablose and :tabnew.
Solution: Fix these autocommand events. (Zyx)
Solution: Fix these autocommand events. (ZyX)
Files: runtime/doc/eval.txt, src/buffer.c, src/eval.c, src/ex_cmds2.c,
src/fileio.c, src/proto/window.pro, src/testdir/test62.in,
src/testdir/test62.ok, src/window.c

View File

@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: man
" Maintainer: SungHyun Nam <goweol@gmail.com>
" Last Change: 2012 Mar 6
" Last Change: 2013 Jul 17
" To make the ":Man" command available before editing a manual page, source
" this script from your startup vimrc file.
@@ -151,7 +151,7 @@ func <SID>GetPage(...)
" Avoid warning for editing the dummy file twice
setl buftype=nofile noswapfile
setl ma
setl ma nonu nornu nofen
silent exec "norm 1GdG"
let $MANWIDTH = winwidth(0)
silent exec "r!/usr/bin/man ".s:GetCmdArg(sect, page)." | col -b"

View File

@@ -2,7 +2,7 @@
" Language: Python
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Original Author: David Bustos <bustos@caltech.edu>
" Last Change: 2013 Jun 21
" Last Change: 2013 Jul 9
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -61,7 +61,7 @@ function GetPythonIndent(lnum)
let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW',
\ "line('.') < " . (plnum - s:maxoff) . " ? dummy :"
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
\ . " =~ '\\(Comment\\|String\\)$'")
\ . " =~ '\\(Comment\\|Todo\\|String\\)$'")
if parlnum > 0
let plindent = indent(parlnum)
let plnumstart = parlnum
@@ -80,14 +80,14 @@ function GetPythonIndent(lnum)
let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
\ . " =~ '\\(Comment\\|String\\)$'")
\ . " =~ '\\(Comment\\|Todo\\|String\\)$'")
if p > 0
if p == plnum
" When the start is inside parenthesis, only indent one 'shiftwidth'.
let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
\ . " =~ '\\(Comment\\|String\\)$'")
\ . " =~ '\\(Comment\\|Todo\\|String\\)$'")
if pp > 0
return indent(plnum) + (exists("g:pyindent_nested_paren") ? eval(g:pyindent_nested_paren) : shiftwidth())
endif
@@ -108,12 +108,12 @@ function GetPythonIndent(lnum)
" If the last character in the line is a comment, do a binary search for
" the start of the comment. synID() is slow, a linear search would take
" too long on a long line.
if synIDattr(synID(plnum, pline_len, 1), "name") =~ "Comment$"
if synIDattr(synID(plnum, pline_len, 1), "name") =~ "\\(Comment\\|Todo\\)$"
let min = 1
let max = pline_len
while min < max
let col = (min + max) / 2
if synIDattr(synID(plnum, col, 1), "name") =~ "Comment$"
if synIDattr(synID(plnum, col, 1), "name") =~ "\\(Comment\\|Todo\\)$"
let max = col
else
let min = col + 1

View File

@@ -3448,9 +3448,13 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
curwin->w_buffer = buf;
curbuf = buf;
++curbuf->b_nwindows;
/* set 'fileformat' */
if (*p_ffs && !oldbuf)
set_fileformat(default_fileformat(), OPT_LOCAL);
/* Set 'fileformat', 'binary' and 'fenc' when forced. */
if (!oldbuf && eap != NULL)
{
set_file_options(TRUE, eap);
set_forced_fenc(eap);
}
}
/* May get the window options from the last time this buffer

View File

@@ -474,23 +474,8 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
}
#endif
/* set default 'fileformat' */
if (set_options)
{
if (eap != NULL && eap->force_ff != 0)
set_fileformat(get_fileformat_force(curbuf, eap), OPT_LOCAL);
else if (*p_ffs != NUL)
set_fileformat(default_fileformat(), OPT_LOCAL);
}
/* set or reset 'binary' */
if (eap != NULL && eap->force_bin != 0)
{
int oldval = curbuf->b_p_bin;
curbuf->b_p_bin = (eap->force_bin == FORCE_BIN);
set_options_bin(oldval, curbuf->b_p_bin, OPT_LOCAL);
}
/* Set default or forced 'fileformat' and 'binary'. */
set_file_options(set_options, eap);
/*
* When opening a new file we take the readonly flag from the file.
@@ -647,15 +632,9 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
check_marks_read();
#endif
#ifdef FEAT_MBYTE
if (eap != NULL && eap->force_enc != 0)
{
/* set forced 'fileencoding' */
fenc = enc_canonize(eap->cmd + eap->force_enc);
if (fenc != NULL)
set_string_option_direct((char_u *)"fenc", -1,
fenc, OPT_FREE|OPT_LOCAL, 0);
vim_free(fenc);
}
/* Set forced 'fileencoding'. */
if (eap != NULL)
set_forced_fenc(eap);
#endif
#ifdef FEAT_AUTOCMD
apply_autocmds_exarg(EVENT_BUFNEWFILE, sfname, sfname,
@@ -2738,7 +2717,52 @@ prep_exarg(eap, buf)
return OK;
}
#ifdef FEAT_MBYTE
/*
* Set default or forced 'fileformat' and 'binary'.
*/
void
set_file_options(set_options, eap)
int set_options;
exarg_T *eap;
{
/* set default 'fileformat' */
if (set_options)
{
if (eap != NULL && eap->force_ff != 0)
set_fileformat(get_fileformat_force(curbuf, eap), OPT_LOCAL);
else if (*p_ffs != NUL)
set_fileformat(default_fileformat(), OPT_LOCAL);
}
/* set or reset 'binary' */
if (eap != NULL && eap->force_bin != 0)
{
int oldval = curbuf->b_p_bin;
curbuf->b_p_bin = (eap->force_bin == FORCE_BIN);
set_options_bin(oldval, curbuf->b_p_bin, OPT_LOCAL);
}
}
#if defined(FEAT_MBYTE) || defined(PROTO)
/*
* Set forced 'fileencoding'.
*/
void
set_forced_fenc(eap)
exarg_T *eap;
{
if (eap->force_enc != 0)
{
char_u *fenc = enc_canonize(eap->cmd + eap->force_enc);
if (fenc != NULL)
set_string_option_direct((char_u *)"fenc", -1,
fenc, OPT_FREE|OPT_LOCAL, 0);
vim_free(fenc);
}
}
/*
* Find next fileencoding to use from 'fileencodings'.
* "pp" points to fenc_next. It's advanced to the next item.

View File

@@ -344,11 +344,13 @@ static UINT msh_msgmousewheel = 0;
static int s_usenewlook; /* emulate W95/NT4 non-bold dialogs */
#ifdef FEAT_TOOLBAR
static void initialise_toolbar(void);
static LRESULT CALLBACK toolbar_wndproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static int get_toolbar_bitmap(vimmenu_T *menu);
#endif
#ifdef FEAT_GUI_TABLINE
static void initialise_tabline(void);
static LRESULT CALLBACK tabline_wndproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
#endif
#ifdef FEAT_MBYTE_IME
@@ -1692,8 +1694,10 @@ gui_mch_set_shellsize(int width, int height,
}
/* compute the size of the outside of the window */
win_width = width + GetSystemMetrics(SM_CXFRAME) * 2;
win_height = height + GetSystemMetrics(SM_CYFRAME) * 2
win_width = width + (GetSystemMetrics(SM_CXFRAME) +
GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
win_height = height + (GetSystemMetrics(SM_CYFRAME) +
GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
+ GetSystemMetrics(SM_CYCAPTION)
#ifdef FEAT_MENU
+ gui_mswin_get_menu_height(FALSE)
@@ -2544,13 +2548,15 @@ gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
get_work_area(&workarea_rect);
*screen_w = workarea_rect.right - workarea_rect.left
- GetSystemMetrics(SM_CXFRAME) * 2;
- (GetSystemMetrics(SM_CXFRAME) +
GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
/* FIXME: dirty trick: Because the gui_get_base_height() doesn't include
* the menubar for MSwin, we subtract it from the screen height, so that
* the window size can be made to fit on the screen. */
*screen_h = workarea_rect.bottom - workarea_rect.top
- GetSystemMetrics(SM_CYFRAME) * 2
- (GetSystemMetrics(SM_CYFRAME) +
GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
- GetSystemMetrics(SM_CYCAPTION)
#ifdef FEAT_MENU
- gui_mswin_get_menu_height(FALSE)
@@ -3180,12 +3186,14 @@ gui_mch_dialog(
/* Use our own window for the size, unless it's very small. */
GetWindowRect(s_hwnd, &rect);
maxDialogWidth = rect.right - rect.left
- GetSystemMetrics(SM_CXFRAME) * 2;
- (GetSystemMetrics(SM_CXFRAME) +
GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
if (maxDialogWidth < DLG_MIN_MAX_WIDTH)
maxDialogWidth = DLG_MIN_MAX_WIDTH;
maxDialogHeight = rect.bottom - rect.top
- GetSystemMetrics(SM_CXFRAME) * 2;
- (GetSystemMetrics(SM_CXFRAME) +
GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
if (maxDialogHeight < DLG_MIN_MAX_HEIGHT)
maxDialogHeight = DLG_MIN_MAX_HEIGHT;
}
@@ -4127,10 +4135,22 @@ initialise_toolbar(void)
TOOLBAR_BUTTON_HEIGHT,
sizeof(TBBUTTON)
);
s_toolbar_wndproc = SubclassWindow(s_toolbarhwnd, toolbar_wndproc);
gui_mch_show_toolbar(vim_strchr(p_go, GO_TOOLBAR) != NULL);
}
static LRESULT CALLBACK
toolbar_wndproc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
HandleMouseHide(uMsg, lParam);
return CallWindowProc(s_toolbar_wndproc, hwnd, uMsg, wParam, lParam);
}
static int
get_toolbar_bitmap(vimmenu_T *menu)
{
@@ -4207,12 +4227,24 @@ initialise_tabline(void)
WS_CHILD|TCS_FOCUSNEVER|TCS_TOOLTIPS,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, s_hwnd, NULL, s_hinst, NULL);
s_tabline_wndproc = SubclassWindow(s_tabhwnd, tabline_wndproc);
gui.tabline_height = TABLINE_HEIGHT;
# ifdef USE_SYSMENU_FONT
set_tabline_font();
# endif
}
static LRESULT CALLBACK
tabline_wndproc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
HandleMouseHide(uMsg, lParam);
return CallWindowProc(s_tabline_wndproc, hwnd, uMsg, wParam, lParam);
}
#endif

View File

@@ -177,10 +177,12 @@ static HBRUSH s_brush = NULL;
#ifdef FEAT_TOOLBAR
static HWND s_toolbarhwnd = NULL;
static WNDPROC s_toolbar_wndproc = NULL;
#endif
#ifdef FEAT_GUI_TABLINE
static HWND s_tabhwnd = NULL;
static WNDPROC s_tabline_wndproc = NULL;
static int showing_tabline = 0;
#endif
@@ -2907,9 +2909,11 @@ gui_mswin_get_valid_dimensions(
int base_width, base_height;
base_width = gui_get_base_width()
+ GetSystemMetrics(SM_CXFRAME) * 2;
+ (GetSystemMetrics(SM_CXFRAME) +
GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
base_height = gui_get_base_height()
+ GetSystemMetrics(SM_CYFRAME) * 2
+ (GetSystemMetrics(SM_CYFRAME) +
GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
+ GetSystemMetrics(SM_CYCAPTION)
#ifdef FEAT_MENU
+ gui_mswin_get_menu_height(FALSE)
@@ -3272,9 +3276,11 @@ gui_mch_newfont()
GetWindowRect(s_hwnd, &rect);
gui_resize_shell(rect.right - rect.left
- GetSystemMetrics(SM_CXFRAME) * 2,
- (GetSystemMetrics(SM_CXFRAME) +
GetSystemMetrics(SM_CXPADDEDBORDER)) * 2,
rect.bottom - rect.top
- GetSystemMetrics(SM_CYFRAME) * 2
- (GetSystemMetrics(SM_CYFRAME) +
GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
- GetSystemMetrics(SM_CYCAPTION)
#ifdef FEAT_MENU
- gui_mswin_get_menu_height(FALSE)

View File

@@ -3694,6 +3694,39 @@ py_fix_cursor(linenr_T lo, linenr_T hi, linenr_T extra)
invalidate_botline();
}
/*
* Find a window that contains "buf" and switch to it.
* If there is no such window, use the current window and change "curbuf".
* Caller must initialize save_curbuf to NULL.
* restore_win_for_buf() MUST be called later!
*/
static void
switch_to_win_for_buf(
buf_T *buf,
win_T **save_curwinp,
tabpage_T **save_curtabp,
buf_T **save_curbufp)
{
win_T *wp;
tabpage_T *tp;
if (find_win_for_buf(buf, &wp, &tp) == FAIL
|| switch_win(save_curwinp, save_curtabp, wp, tp, TRUE) == FAIL)
switch_buffer(save_curbufp, buf);
}
static void
restore_win_for_buf(
win_T *save_curwin,
tabpage_T *save_curtab,
buf_T *save_curbuf)
{
if (save_curbuf == NULL)
restore_win(save_curwin, save_curtab, TRUE);
else
restore_buffer(save_curbuf);
}
/*
* Replace a line in the specified buffer. The line number is
* in Vim format (1-based). The replacement line is given as
@@ -3706,6 +3739,10 @@ py_fix_cursor(linenr_T lo, linenr_T hi, linenr_T extra)
static int
SetBufferLine(buf_T *buf, PyInt n, PyObject *line, PyInt *len_change)
{
buf_T *save_curbuf = NULL;
win_T *save_curwin = NULL;
tabpage_T *save_curtab = NULL;
/* First of all, we check the type of the supplied Python object.
* There are three cases:
* 1. NULL, or None - this is a deletion.
@@ -3714,10 +3751,8 @@ SetBufferLine(buf_T *buf, PyInt n, PyObject *line, PyInt *len_change)
*/
if (line == Py_None || line == NULL)
{
buf_T *savebuf;
PyErr_Clear();
switch_buffer(&savebuf, buf);
switch_to_win_for_buf(buf, &save_curwin, &save_curtab, &save_curbuf);
VimTryStart();
@@ -3727,12 +3762,15 @@ SetBufferLine(buf_T *buf, PyInt n, PyObject *line, PyInt *len_change)
RAISE_DELETE_LINE_FAIL;
else
{
if (buf == savebuf)
if (buf == curbuf)
py_fix_cursor((linenr_T)n, (linenr_T)n + 1, (linenr_T)-1);
deleted_lines_mark((linenr_T)n, 1L);
if (save_curbuf == NULL)
/* Only adjust marks if we managed to switch to a window that
* holds the buffer, otherwise line numbers will be invalid. */
deleted_lines_mark((linenr_T)n, 1L);
}
restore_buffer(savebuf);
restore_win_for_buf(save_curwin, save_curtab, save_curbuf);
if (VimTryEnd())
return FAIL;
@@ -3745,7 +3783,6 @@ SetBufferLine(buf_T *buf, PyInt n, PyObject *line, PyInt *len_change)
else if (PyBytes_Check(line) || PyUnicode_Check(line))
{
char *save = StringToLine(line);
buf_T *savebuf;
if (save == NULL)
return FAIL;
@@ -3754,7 +3791,7 @@ SetBufferLine(buf_T *buf, PyInt n, PyObject *line, PyInt *len_change)
/* We do not need to free "save" if ml_replace() consumes it. */
PyErr_Clear();
switch_buffer(&savebuf, buf);
switch_to_win_for_buf(buf, &save_curwin, &save_curtab, &save_curbuf);
if (u_savesub((linenr_T)n) == FAIL)
{
@@ -3769,10 +3806,10 @@ SetBufferLine(buf_T *buf, PyInt n, PyObject *line, PyInt *len_change)
else
changed_bytes((linenr_T)n, 0);
restore_buffer(savebuf);
restore_win_for_buf(save_curwin, save_curtab, save_curbuf);
/* Check that the cursor is not beyond the end of the line now. */
if (buf == savebuf)
if (buf == curbuf)
check_cursor_col();
if (VimTryEnd())
@@ -3806,6 +3843,10 @@ SetBufferLineList(
PyObject *list,
PyInt *len_change)
{
buf_T *save_curbuf = NULL;
win_T *save_curwin = NULL;
tabpage_T *save_curtab = NULL;
/* First of all, we check the type of the supplied Python object.
* There are three cases:
* 1. NULL, or None - this is a deletion.
@@ -3816,11 +3857,10 @@ SetBufferLineList(
{
PyInt i;
PyInt n = (int)(hi - lo);
buf_T *savebuf;
PyErr_Clear();
VimTryStart();
switch_buffer(&savebuf, buf);
switch_to_win_for_buf(buf, &save_curwin, &save_curtab, &save_curbuf);
if (u_savedel((linenr_T)lo, (long)n) == FAIL)
RAISE_UNDO_FAIL;
@@ -3834,12 +3874,15 @@ SetBufferLineList(
break;
}
}
if (buf == savebuf)
if (buf == curbuf)
py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)-n);
deleted_lines_mark((linenr_T)lo, (long)i);
if (save_curbuf == NULL)
/* Only adjust marks if we managed to switch to a window that
* holds the buffer, otherwise line numbers will be invalid. */
deleted_lines_mark((linenr_T)lo, (long)i);
}
restore_buffer(savebuf);
restore_win_for_buf(save_curwin, save_curtab, save_curbuf);
if (VimTryEnd())
return FAIL;
@@ -3856,7 +3899,6 @@ SetBufferLineList(
PyInt old_len = hi - lo;
PyInt extra = 0; /* lines added to text, can be negative */
char **array;
buf_T *savebuf;
if (new_len == 0) /* avoid allocating zero bytes */
array = NULL;
@@ -3888,7 +3930,7 @@ SetBufferLineList(
PyErr_Clear();
/* START of region without "return". Must call restore_buffer()! */
switch_buffer(&savebuf, buf);
switch_to_win_for_buf(buf, &save_curwin, &save_curtab, &save_curbuf);
if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL)
RAISE_UNDO_FAIL;
@@ -3960,16 +4002,18 @@ SetBufferLineList(
/* Adjust marks. Invalidate any which lie in the
* changed range, and move any in the remainder of the buffer.
*/
mark_adjust((linenr_T)lo, (linenr_T)(hi - 1),
* Only adjust marks if we managed to switch to a window that holds
* the buffer, otherwise line numbers will be invalid. */
if (save_curbuf == NULL)
mark_adjust((linenr_T)lo, (linenr_T)(hi - 1),
(long)MAXLNUM, (long)extra);
changed_lines((linenr_T)lo, 0, (linenr_T)hi, (long)extra);
if (buf == savebuf)
if (buf == curbuf)
py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)extra);
/* END of region without "return". */
restore_buffer(savebuf);
restore_win_for_buf(save_curwin, save_curtab, save_curbuf);
if (VimTryEnd())
return FAIL;
@@ -3998,9 +4042,7 @@ SetBufferLineList(
InsertBufferLines(buf_T *buf, PyInt n, PyObject *lines, PyInt *len_change)
{
buf_T *save_curbuf = NULL;
win_T *wp;
win_T *save_curwin = NULL;
tabpage_T *tp;
tabpage_T *save_curtab = NULL;
/* First of all, we check the type of the supplied Python object.
@@ -4015,10 +4057,7 @@ InsertBufferLines(buf_T *buf, PyInt n, PyObject *lines, PyInt *len_change)
PyErr_Clear();
VimTryStart();
if (find_win_for_buf(buf, &wp, &tp) == FAIL
|| switch_win(&save_curwin, &save_curtab, wp, tp, TRUE)
== FAIL)
switch_buffer(&save_curbuf, buf);
switch_to_win_for_buf(buf, &save_curwin, &save_curtab, &save_curbuf);
if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL)
RAISE_UNDO_FAIL;
@@ -4030,10 +4069,7 @@ InsertBufferLines(buf_T *buf, PyInt n, PyObject *lines, PyInt *len_change)
appended_lines_mark((linenr_T)n, 1L);
vim_free(str);
if (save_curbuf == NULL)
restore_win(save_curwin, save_curtab, TRUE);
else
restore_buffer(save_curbuf);
restore_win_for_buf(save_curwin, save_curtab, save_curbuf);
update_screen(VALID);
if (VimTryEnd())
@@ -4073,10 +4109,7 @@ InsertBufferLines(buf_T *buf, PyInt n, PyObject *lines, PyInt *len_change)
PyErr_Clear();
VimTryStart();
if (find_win_for_buf(buf, &wp, &tp) == FAIL
|| switch_win(&save_curwin, &save_curtab, wp, tp, TRUE)
== FAIL)
switch_buffer(&save_curbuf, buf);
switch_to_win_for_buf(buf, &save_curwin, &save_curtab, &save_curbuf);
if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL)
RAISE_UNDO_FAIL;
@@ -4097,18 +4130,17 @@ InsertBufferLines(buf_T *buf, PyInt n, PyObject *lines, PyInt *len_change)
}
vim_free(array[i]);
}
if (i > 0)
if (i > 0 && save_curbuf == NULL)
/* Only adjust marks if we managed to switch to a window that
* holds the buffer, otherwise line numbers will be invalid. */
appended_lines_mark((linenr_T)n, (long)i);
}
/* Free the array of lines. All of its contents have now
* been freed. */
PyMem_Free(array);
restore_win_for_buf(save_curwin, save_curtab, save_curbuf);
if (save_curbuf == NULL)
restore_win(save_curwin, save_curtab, TRUE);
else
restore_buffer(save_curbuf);
update_screen(VALID);
if (VimTryEnd())

View File

@@ -2717,21 +2717,19 @@ mch_getperm(char_u *name)
/*
* set file permission for `name' to `perm'
* Set file permission for "name" to "perm".
*
* return FAIL for failure, OK otherwise
* Return FAIL for failure, OK otherwise.
*/
int
mch_setperm(
char_u *name,
long perm)
mch_setperm(char_u *name, long perm)
{
long n;
long n = -1;
#ifdef FEAT_MBYTE
WCHAR *p;
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
{
p = enc_to_utf16(name, NULL);
WCHAR *p = enc_to_utf16(name, NULL);
if (p != NULL)
{
@@ -2742,7 +2740,7 @@ mch_setperm(
/* Retry with non-wide function (for Windows 98). */
}
}
if (p == NULL)
if (n == -1)
#endif
n = _chmod(name, perm);
if (n == -1)

View File

@@ -102,6 +102,9 @@
#endif
#ifndef PROTO
# include <windows.h>
# ifndef SM_CXPADDEDBORDER
# define SM_CXPADDEDBORDER 92
# endif
#endif
/*

View File

@@ -2,6 +2,8 @@
void filemess __ARGS((buf_T *buf, char_u *name, char_u *s, int attr));
int readfile __ARGS((char_u *fname, char_u *sfname, linenr_T from, linenr_T lines_to_skip, linenr_T lines_to_read, exarg_T *eap, int flags));
int prep_exarg __ARGS((exarg_T *eap, buf_T *buf));
void set_file_options __ARGS((int set_options, exarg_T *eap));
void set_forced_fenc __ARGS((exarg_T *eap));
int prepare_crypt_read __ARGS((FILE *fp));
char_u *prepare_crypt_write __ARGS((buf_T *buf, int *lenp));
int check_file_readonly __ARGS((char_u *fname, int perm));

View File

@@ -4563,14 +4563,14 @@ regmatch(scan)
break;
case PRINT:
if (ptr2cells(reginput) != 1)
if (!vim_isprintc(PTR2CHAR(reginput)))
status = RA_NOMATCH;
else
ADVANCE_REGINPUT();
break;
case SPRINT:
if (VIM_ISDIGIT(*reginput) || ptr2cells(reginput) != 1)
if (VIM_ISDIGIT(*reginput) || !vim_isprintc(PTR2CHAR(reginput)))
status = RA_NOMATCH;
else
ADVANCE_REGINPUT();
@@ -5944,7 +5944,8 @@ regrepeat(p, maxcount)
if (got_int)
break;
}
else if (ptr2cells(scan) == 1 && (testval || !VIM_ISDIGIT(*scan)))
else if (vim_isprintc(PTR2CHAR(scan)) == 1
&& (testval || !VIM_ISDIGIT(*scan)))
{
mb_ptr_adv(scan);
}

View File

@@ -3464,6 +3464,7 @@ typedef struct
int n; /* nr of states currently in "t" */
int len; /* max nr of states in "t" */
int id; /* ID of the list */
int has_pim; /* TRUE when any state has a PIM */
} nfa_list_T;
#ifdef ENABLE_LOG
@@ -3966,7 +3967,7 @@ addstate(l, state, subs_arg, pim, off)
/* This state is already in the list, don't add it again,
* unless it is an MOPEN that is used for a backreference or
* when there is a PIM. */
if (!nfa_has_backref && pim == NULL)
if (!nfa_has_backref && pim == NULL && !l->has_pim)
{
skip_add:
#ifdef ENABLE_LOG
@@ -4012,7 +4013,10 @@ skip_add:
if (pim == NULL)
thread->pim.result = NFA_PIM_UNUSED;
else
{
copy_pim(&thread->pim, pim);
l->has_pim = TRUE;
}
copy_sub(&thread->subs.norm, &subs->norm);
#ifdef FEAT_SYN_HL
if (nfa_has_zsubexpr)
@@ -5060,8 +5064,10 @@ nfa_regmatch(prog, start, submatch, m)
thislist = &list[0];
thislist->n = 0;
thislist->has_pim = FALSE;
nextlist = &list[1];
nextlist->n = 0;
nextlist->has_pim = FALSE;
#ifdef ENABLE_LOG
fprintf(log_fd, "(---) STARTSTATE first\n");
#endif
@@ -5120,6 +5126,7 @@ nfa_regmatch(prog, start, submatch, m)
thislist = &list[flag];
nextlist = &list[flag ^= 1];
nextlist->n = 0; /* clear nextlist */
nextlist->has_pim = FALSE;
++nfa_listid;
thislist->id = nfa_listid;
nextlist->id = nfa_listid + 1;
@@ -5749,12 +5756,12 @@ nfa_regmatch(prog, start, submatch, m)
break;
case NFA_PRINT: /* \p */
result = ptr2cells(reginput) == 1;
result = vim_isprintc(PTR2CHAR(reginput));
ADD_STATE_IF_MATCH(t->state);
break;
case NFA_SPRINT: /* \P */
result = !VIM_ISDIGIT(curc) && ptr2cells(reginput) == 1;
result = !VIM_ISDIGIT(curc) && vim_isprintc(PTR2CHAR(reginput));
ADD_STATE_IF_MATCH(t->state);
break;

View File

@@ -228,6 +228,7 @@ STARTTEST
:call add(tl, [2, '\v((ab)|c*)+', 'abcccaba', 'abcccab', '', 'ab'])
:call add(tl, [2, '\v(a(c*)+b)+', 'acbababaaa', 'acbabab', 'ab', ''])
:call add(tl, [2, '\v(a|b*)+', 'aaaa', 'aaaa', ''])
:call add(tl, [2, '\p*', 'aá ', 'aá '])
:"
:" Test greedy-ness and lazy-ness
:call add(tl, [2, 'a\{-2,7}','aaaaaaaaaaaaa', 'aa'])
@@ -340,6 +341,7 @@ STARTTEST
:call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' foo xxx ', 'foo'])
:call add(tl, [2, '[ ]\@!\p\%([ ]\@!\p\)*:', 'implicit mappings:', 'mappings:'])
:call add(tl, [2, 'm\k\+_\@=\%(_\@!\k\)\@<=\k\+e', 'mx__xe', 'mx__xe'])
:call add(tl, [2, '\%(\U\@<=S\k*\|S\l\)R', 'SuR', 'SuR'])
:"
:"""" Combining different tests and features
:call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab'])

View File

@@ -506,6 +506,9 @@ OK 2 - \v(a(c*)+b)+
OK 0 - \v(a|b*)+
OK 1 - \v(a|b*)+
OK 2 - \v(a|b*)+
OK 0 - \p*
OK 1 - \p*
OK 2 - \p*
OK 0 - a\{-2,7}
OK 1 - a\{-2,7}
OK 2 - a\{-2,7}
@@ -776,6 +779,9 @@ OK 2 - [ ]\@!\p\%([ ]\@!\p\)*:
OK 0 - m\k\+_\@=\%(_\@!\k\)\@<=\k\+e
OK 1 - m\k\+_\@=\%(_\@!\k\)\@<=\k\+e
OK 2 - m\k\+_\@=\%(_\@!\k\)\@<=\k\+e
OK 0 - \%(\U\@<=S\k*\|S\l\)R
OK 1 - \%(\U\@<=S\k*\|S\l\)R
OK 2 - \%(\U\@<=S\k*\|S\l\)R
OK 0 - [[:alpha:]]\{-2,6}
OK 1 - [[:alpha:]]\{-2,6}
OK 2 - [[:alpha:]]\{-2,6}

View File

@@ -1,4 +1,5 @@
Test for BufWritePre autocommand that deletes or unloads the buffer.
Test for BufUnload autocommand that unloads all other buffers.
STARTTEST
:so small.vim
@@ -16,6 +17,27 @@ $r2:.,/end of/w! Xxx2 " write test file Xxx2
:bwipe test.out " remove test.out from the buffer list
:w " write it, will delete the buffer and give an error msg
:w >>test.out " Append contents of this file
:au! BufWritePre
:func CloseAll()
let i = 0
while i <= bufnr('$')
if i != bufnr('%') && bufloaded(i)
exe i . "bunload"
endif
let i += 1
endwhile
endfunc
:func WriteToOut()
edit! test.out
$put ='VimLeave done'
write
endfunc
:set viminfo='100,nviminfo
:au BufUnload * call CloseAll()
:au VimLeave * call WriteToOut()
:e small.vim
:sp mbyte.vim
:q
:qa!
ENDTEST

View File

@@ -4,3 +4,4 @@ end of Xxx
start of Xxx1
test
end of Xxx
VimLeave done

View File

@@ -3,6 +3,7 @@ vim: set ft=vim :
STARTTEST
:so small.vim
:so mbyte.vim
:"
:" Test for getbufvar()
:" Use strings to test for memory leaks.
@@ -22,6 +23,17 @@ STARTTEST
:$put =string(getbufvar(1, '&autoindent'))
:$put =string(getbufvar(1, '&autoindent', 1))
:"
:" Open new window with forced option values
:set fileformats=unix,dos
:new ++ff=dos ++bin ++enc=iso-8859-2
:let otherff = getbufvar(bufnr('%'), '&fileformat')
:let otherbin = getbufvar(bufnr('%'), '&bin')
:let otherfenc = getbufvar(bufnr('%'), '&fenc')
:close
:$put =otherff
:$put =string(otherbin)
:$put =otherfenc
:unlet otherff otherbin otherfenc
:" test for getwinvar()
:let w:var_str = "Dance"
:let def_str = "Chance"

View File

@@ -10,6 +10,9 @@ start:
'5678'
0
0
dos
1
iso-8859-2
'Dance'
'Dance'
{'var_str': 'Dance'}

View File

@@ -29,6 +29,7 @@ STARTTEST
:" this is not a normal "i" but 0xec
:call add(tl, [2, '\p\+', 'ìa', 'ìa'])
:call add(tl, [2, '\p*', 'aあ', 'aあ'])
:"""" Test recognition of some character classes
:call add(tl, [2, '\i\+', '&*¨xx ', 'xx'])
@@ -118,6 +119,16 @@ STARTTEST
:endfor
:unlet t tl e l
:" check that 'ambiwidth' does not change the meaning of \p
:set regexpengine=1 ambiwidth=single
:$put ='eng 1 ambi single: ' . match(\"\u00EC\", '\p')
:set regexpengine=1 ambiwidth=double
:$put ='eng 1 ambi double: ' . match(\"\u00EC\", '\p')
:set regexpengine=2 ambiwidth=single
:$put ='eng 2 ambi single: ' . match(\"\u00EC\", '\p')
:set regexpengine=2 ambiwidth=double
:$put ='eng 2 ambi double: ' . match(\"\u00EC\", '\p')
:/\%#=1^Results/,$wq! test.out
ENDTEST

View File

@@ -17,6 +17,9 @@ OK 2 - [ม[:alpha:][=a=]]\+
OK 0 - \p\+
OK 1 - \p\+
OK 2 - \p\+
OK 0 - \p*
OK 1 - \p*
OK 2 - \p*
OK 0 - \i\+
OK 1 - \i\+
OK 2 - \i\+
@@ -113,3 +116,7 @@ OK 2 - \Zֹ\+
OK 0 - [^[=a=]]\+
OK 1 - [^[=a=]]\+
OK 2 - [^[=a=]]\+
eng 1 ambi single: 0
eng 1 ambi double: 0
eng 2 ambi single: 0
eng 2 ambi double: 0

View File

@@ -727,6 +727,24 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
44,
/**/
43,
/**/
42,
/**/
41,
/**/
40,
/**/
39,
/**/
38,
/**/
37,
/**/
36,
/**/
35,
/**/

View File

@@ -2291,8 +2291,13 @@ win_close(win, free_buf)
if (only_one_window() && win_valid(win) && win->w_buffer == NULL
&& (last_window() || curtab != prev_curtab
|| close_last_window_tabpage(win, free_buf, prev_curtab)))
/* Autocommands have close all windows, quit now. */
{
/* Autocommands have close all windows, quit now. Restore
* curwin->w_buffer, otherwise writing viminfo may fail. */
if (curwin->w_buffer == NULL)
curwin->w_buffer = curbuf;
getout(0);
}
/* Autocommands may have closed the window already, or closed the only
* other window or moved to another tab page. */
@@ -4513,7 +4518,7 @@ win_alloc(after, hidden)
#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* remove window 'wp' from the window list and free the structure
* Remove window 'wp' from the window list and free the structure.
*/
static void
win_free(wp, tp)
@@ -4521,6 +4526,8 @@ win_free(wp, tp)
tabpage_T *tp; /* tab page "win" is in, NULL for current */
{
int i;
buf_T *buf;
wininfo_T *wip;
#ifdef FEAT_FOLDING
clearFolding(wp);
@@ -4581,6 +4588,13 @@ win_free(wp, tp)
vim_free(wp->w_localdir);
/* Remove the window from the b_wininfo lists, it may happen that the
* freed memory is re-used for another window. */
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next)
if (wip->wi_win == wp)
wip->wi_win = NULL;
#ifdef FEAT_SEARCH_EXTRA
clear_matches(wp);
#endif