Compare commits

...

36 Commits

Author SHA1 Message Date
Bjorn Winckler 915d2e30ac Snapshot 37 2008-11-15 14:02:15 +01:00
Bjorn Winckler 6319b9c517 Add Reload/Ignore All buttons to file changed dialog 2008-11-14 20:06:53 +01:00
Bjorn Winckler 0dde2b7232 Explicitly ignore SIGCHLD to avoid zombies 2008-11-14 15:43:54 +01:00
Bjorn Winckler d0645670b5 Merge upstream
Conflicts:
	src/feature.h
2008-11-09 17:23:00 +01:00
vimboss 3157d8636c updated for version 7.2-032 2008-11-09 16:22:01 +00:00
vimboss 8bb0169bd0 updated for version 7.2-031 2008-11-09 12:46:09 +00:00
vimboss 00d911af72 updated for version 7.2-030 2008-11-06 19:47:51 +00:00
vimboss 1111099ec1 updated for version 7.2-029 2008-11-06 16:16:44 +00:00
vimboss 9b4580c4dc updated for version 7.2-028 2008-11-06 10:05:42 +00:00
vimboss e63ff36e87 updated for version 7.2-027 2008-11-06 09:23:57 +00:00
Bjorn Winckler 198610ad25 Data received from system services replaces selection
When data is received from system services it replaces the current
selection.  The current implementation is a bit naive in that it assumes
that Vim is in Visual mode (it doesn't even work in Select mode).  (To
test this functionality: enter "2+3", select it, then hit Cmd-* and the
selection is replaced with "5".)
2008-11-01 19:21:02 +01:00
vimboss a57332a176 updated for version 7.2-026 2008-11-01 12:52:38 +00:00
Bjorn Winckler 9bd6777571 Support "mvim" script symlinks to [m|g]ex, rmvim
Symlinks to "mex" or "gex" starts MacVim in ex mode.  Symlinks to "ex"
starts Vim in ex mode (no GUI).  Symlinks to "rmvim" (or "rgvim" which
was already supported previous to this patch) starts MacVim in
restricted mode.
2008-10-29 17:21:13 +01:00
Bjorn Winckler aee4e6d6ca Add help on symlinks to "mvim" script 2008-10-29 17:04:01 +01:00
Bjorn Winckler 7112e2b5f7 Update help on 'runtimepath' 2008-10-29 16:46:15 +01:00
Bjorn Winckler f9064e4c16 Fix typo in a comment 2008-10-26 22:57:32 +01:00
Bjorn Winckler 69c156faf4 Speed up live resize 2008-10-25 21:10:52 +02:00
Bjorn Winckler dd74c0b520 Connection not in event tracking mode by default
Only add backend connection to event tracking mode when it is absolutely
needed.  At the moment this happens when the window is in "live resize"
or when the mouse button is held on some part of a scroller.
2008-10-25 20:31:17 +02:00
Bjorn Winckler f6ecb9aae9 Help cleanup 2008-10-25 18:38:38 +02:00
Bjorn Winckler bc82e6d58e More help on menu key equivalents 2008-10-25 18:22:12 +02:00
Bjorn Winckler 667279dbca Add help on how to remap Caps Lock to Esc 2008-10-25 18:03:39 +02:00
Bjorn Winckler 331a21d0bd Revert "Modifier key sends Esc" related commits
This reverts the following three commits:
  3ae360ddb38dd49e9392aad7a70f0f31a30849ee
  007bb96eb3ec035169510caa4e206ab901e4b6d0
  b6c06f31be1e8124ed12cc2ff5361752df1e4634
2008-10-25 16:34:16 +02:00
Bjorn Winckler 2cccddd458 Fix "Special Characters" palette bug
It is again possible to insert text from the "Special Characters"
palette (broken by commit 8fbb13da74a1912839e9302ebc725df67619c9c0).
2008-10-18 18:45:50 +02:00
Bjorn Winckler 49a52f9eff Keep whole window visible on ":set lines=X columns=Y" 2008-10-18 17:34:54 +02:00
Bjorn Winckler f231eff6c2 Fix "set lines=999" in .gvimrc
Ensure that the window fits on screen when the window is resized to fit
the content.  This should fix a problem where the window would not be
flush with the menu bar when "set lines=999" was added to .gvimrc.
2008-10-18 15:38:08 +02:00
Bjorn Winckler 3a8ce4e72c Constrain window size during live resize
Ensure that the window size isn't larger than the visible frame of the
current screen.  This avoids problems where the window would "snap back"
immediately after being resized manually.
2008-10-18 14:28:25 +02:00
Bjorn Winckler 52f08cc6aa Delay flushing send queue
Ensure that the send queue is flushed after processCommandQueueDidFinish
since that method may add messages to the send queue.
2008-10-18 14:24:59 +02:00
Bjorn Winckler 1a91b2a5c9 Fix computation of zoomed window frame
When computing the zoomed window frame ensure that it is constrained to
hold an even number of rows and columns.  This fixes a problem where the
window would not "un-zoom" after being zoomed.
2008-10-18 13:23:24 +02:00
Bjorn Winckler 467b890d13 Top of window flush with menu bar after zoom 2008-10-12 17:57:39 +02:00
Jason Foreman fa6eedf24f Enable basic AppleScript support
Putting this key into the Info.plist file turns on the basic AppleScript
support Cocoa provides.  Doing so allows MacVim to receive some basic
events.  This gives MacVim a bit better integration into Mac OS X.

Below is an example which, when placed in one's .vimrc file,  causes the
window to be zoomed during startup.

let script='osascript -e "tell application \"MacVim\""'
       \ . ' -e "set zoomed of first window to true"'
       \ . ' -e "end tell"'
au VIMEnter * call system(script)
2008-10-12 14:36:22 +02:00
Bjorn Winckler 0b546f60b1 Move window to top of screen if bottom is obscured 2008-10-12 14:34:22 +02:00
Bjorn Winckler 1957b370bb Use option as meta key
Added a buffer local option called 'macmeta' which when set causes
MacVim not to interpret option+key presses thus enabling the user to
bind to <M-..>.  Also updated the documentation and added 'macmeta' to
the .vim syntax file.
2008-10-12 14:05:42 +02:00
Bjorn Winckler 275fc44523 Avoid crash when resizing window
Sanity check input to gui_macvim_draw_string(); it can happen that 'len'
is non-zero even though first byte of 's' is NUL (test case with file
containing Chinese characters).
2008-10-11 20:03:23 +02:00
vimboss 678ceed917 updated for version 7.2-025 2008-10-02 20:55:54 +00:00
vimboss 1506bb79d9 updated for version 7.2-024 2008-10-02 20:48:41 +00:00
vimboss 69742a596f updated for version 7.2-023 2008-10-02 16:04:05 +00:00
52 changed files with 864 additions and 348 deletions
+24 -9
View File
@@ -1,4 +1,4 @@
*cmdline.txt* For Vim version 7.2. Last change: 2008 Jul 29
*cmdline.txt* For Vim version 7.2. Last change: 2008 Sep 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -157,6 +157,11 @@ CTRL-R {0-9a-z"%#:-=.} *c_CTRL-R* *c_<C-R>*
(doesn't work at the expression prompt; some
things such as changing the buffer or current
window are not allowed to avoid side effects)
When the result is a |List| the items are used
as lines. They can have line breaks inside
too.
When the result is a Float it's automatically
converted to a String.
See |registers| about registers. {not in Vi}
Implementation detail: When using the |expression| register
and invoking setcmdpos(), this sets the position before
@@ -730,19 +735,29 @@ to use |fnameescape()|.
In Ex commands, at places where a file name can be used, the following
characters have a special meaning. These can also be used in the expression
function expand() |expand()|.
% is replaced with the current file name *:_%*
# is replaced with the alternate file name *:_#*
% Is replaced with the current file name. *:_%* *c_%*
# Is replaced with the alternate file name. *:_#* *c_#*
#n (where n is a number) is replaced with the file name of
buffer n. "#0" is the same as "#"
## is replaced with all names in the argument list *:_##*
buffer n. "#0" is the same as "#".
## Is replaced with all names in the argument list *:_##* *c_##*
concatenated, separated by spaces. Each space in a name
is preceded with a backslash.
Note that these give the file name as it was typed. If an absolute path is
needed (when using the file name from a different directory), you need to add
":p". See |filename-modifiers|.
#<n (where n is a number > 0) is replaced with old *:_#<* *c_#<*
file name n. See |:oldfiles| or |v:oldfiles| to get the
number. *E809*
{only when compiled with the +eval and +viminfo features}
Note that these, except "#<n", give the file name as it was typed. If an
absolute path is needed (when using the file name from a different directory),
you need to add ":p". See |filename-modifiers|.
The "#<n" item returns an absolute path, but it will start with "~/" for files
below your home directory.
Note that backslashes are inserted before spaces, so that the command will
correctly interpret the file name. But this doesn't happen for shell
commands. For those you probably have to use quotes: >
commands. For those you probably have to use quotes (this fails for files
that contain a quote and wildcards): >
:!ls "%"
:r !spell "%"
+12 -1
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.2. Last change: 2008 Aug 09
*eval.txt* For Vim version 7.2. Last change: 2008 Nov 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1484,6 +1484,17 @@ v:mouse_col Column number for a mouse click obtained with |getchar()|.
This is the screen column number, like with |virtcol()|. The
value is zero when there was no mouse button click.
*v:oldfiles* *oldfiles-variable*
v:oldfiles List of file names that is loaded from the |viminfo| file on
startup. These are the files that Vim remembers marks for.
The length of the List is limited by the ' argument of the
'viminfo' option (default is 100).
Also see |:oldfiles| and |c_#<|.
The List can be modified, but this has no effect on what is
stored in the |viminfo| file later. If you use values other
than String this will cause trouble.
{only when compiled with the +viminfo feature}
*v:operator* *operator-variable*
v:operator The last operator given in Normal mode. This is a single
character except for commands starting with <g> or <z>,
+61 -56
View File
@@ -1,4 +1,4 @@
*gui_mac.txt* For Vim version 7.2. Last change: 2008 Oct 04
*gui_mac.txt* For Vim version 7.2. Last change: 2008 Oct 25
VIM REFERENCE MANUAL by Bjorn Winckler
@@ -171,14 +171,16 @@ The advantage of using the latter method is that the settings relating to file
opening in the preferences panel are respected, and files open instantly if
|Quickstart| is enabled.
*mvim*
To save yourself from having to type the entire path to the Vim binary each
time you start MacVim, you could create an alias such as >
alias gvim='/Applications/MacVim.app/Contents/MacOS/Vim -g'
and add that to "~/.profile". A more flexible way to start MacVim is to use
the shell script "mvim" which comes bundled with MacVim. Put this script in a
folder in your path and then simply type "mvim" to start MacVim. This script
will try to find MacVim.app in various typical folders such as >
and add that to "~/.profile".
*mvim*
A more flexible way to start MacVim is to use the shell script "mvim" which
comes bundled with MacVim. Put this script in a folder in your path and then
simply type "mvim" to start MacVim. This script will try to find MacVim.app
in various typical folders such as >
~/Applications ~/Applications/vim
/Applications /Applications/vim
/Applications/Utilities /Applications/Utilities/vim
@@ -186,6 +188,17 @@ If you would rather put MacVim.app in some other directory then that is also
possible, simply set the environment variable VIM_APP_DIR to whatever folder
you have placed MacVim.app in.
The "mvim" script can be symlinked to in order to start up MacVim in different
modes as follows (assuming you placed "mvim" in "/usr/local/bin"): >
* Diff: ln -s /usr/local/bin/mvim mvimdiff
* Read-only: ln -s /usr/local/bin/mvim mview
* Ex: ln -s /usr/local/bin/mvim mex
* Restricted: ln -s /usr/local/bin/mvim rmvim
If the symlink destination starts with "m" (or "g"), Vim will start in GUI
mode. Removing the initial "m" from the above destination names makes Vim
start without the GUI. (In the last case, the destination name can be
"rmvim", "rgvim" or "rvim".)
Note: Starting MacVim by creating a symlink to >
.../MacVim.app/Contents/MacOS/Vim
with 'ln -s' does not work.
@@ -242,8 +255,6 @@ Here is a list of relevant dictionary entries:
KEY VALUE ~
MMCellWidthMultiplier width of a normal glyph in em units [float]
MMDialogsTrackPwd open/save dialogs track the Vim pwd [bool]
MMFakeEscTimeout timeout for modifier to count as Esc [float]
MMFakeEscOnKeyDown send Esc when modifier is pressed [bool]
MMLoginShellArgument login shell parameter [string]
MMLoginShellCommand which shell to use to launch Vim [string]
MMNoFontSubstitution disable automatic font substitution [bool]
@@ -285,30 +296,6 @@ user default MMLoginShellArgument (e.g. to "-l"). Finally, if the "bash"
shell is used, then "-l" is automatically added as an argument. To override
this behaviour set MMLoginShellArgument to "--".
*macvim-esc*
MacVim can treat a modifier key as Esc in order to avoid having to reach for
the Esc key all the time. The actual modifier key to treat as Esc can be
selected in the preferences (only the left modifier key is affected on
keyboards which have a left and a right modifier key). This is most useful if
Caps Lock has also been remapped to the chosen modifier since it is then
possible to use Caps Lock (which is very easy to reach) to go to normal mode
instead of using Esc (which is somewhat harder to reach). Caps Lock can be
remapped in the "Keyboard & Mouse" System Preference by clicking on the
"Modifier Keys..." button.
This feature works by swapping the modifier key release event for an Esc key
press event, so the Esc is only sent when the modifier is released. Also, if
the modifier is not released quickly enough no Esc event is sent. This way it
is possible to keep using the modifier key as a modifier (by holding the key
down and pressing another key) as well as using it as Esc (by quickly pressing
the key). It is possible to make MacVim send Esc when the modifier is pressed
(which makes the key feel more responsive) by setting the MMFakeEscOnKeyDown
user default, but then that modifier key can only be used as Esc. The timeout
can also be change by setting the MMFakeEscTimeout user default to the desired
timeout in seconds (e.g. if you want to be able to press the modifier more
slowly but still having it count as Esc, then you could increase the timeout
to 1.0).
==============================================================================
4. Special colors *macvim-colors*
@@ -403,9 +390,11 @@ can be used to send action messages.
":maca name:".
The key equivalent is specified with the <D-..>
syntax. Note that key equivalents must contain the
Cmd modifier flag (<D-..>), and they take precedence
over normal mappings.
syntax. This is case-sensitive, so <D-a> means Cmd-a
whereas <D-A> means Cmd-Shift-a.
Note that key equivalents must contain the Cmd
modifier flag (<D-..>), and they take precedence over
normal mappings.
Use the syntax "key=<nop>" to clear the key equivalent
of a menu. This can be used to free up a key
combination that is set in the system gvimrc so that
@@ -429,7 +418,12 @@ equivalent Cmd-n, which opens a new window when selected: >
:macm Window.Next\ Tab key=<D-Right>
3. Create a mapping in normal mode which closes the current tab/window: >
:map <C-w> :maca performClose:<CR>
>
4. Free up Cmd-t and remap it to open a file browser in a split view: >
macm File.New\ Tab key=<nop>
nmap <D-t> :sp .<CR>
Note: These two lines must be added to .gvimrc else the first line will fail.
The second line is case sensitive, so <D-T> (Cmd-Shift-t) is not the same as
<D-t> (Cmd-t)!
The standard Vim menus are modified in "$VIM/gvimrc". Take a look at that
file for more examples on how to set up menus. Note: When no window is open a
@@ -520,13 +514,14 @@ located in the /Applications folder. (You might have to logout and then login
again before Mac OS X detects the MacVim services.)
These are the currently supported services:
* New Document Here: Open a new window and set the current directory to that
of the selected text. This is intended to be used from a Finder window to
open an empty document in the currently selected folder.
* New Document Containing Selection: Open a new window and paste the currently
selected text.
* Open Selected File: If the selected text represents a file name, then the
corresponding file is opened in a new window.
* New Document Containing Selection: Open a new window and paste the
currently selected text.
* New Document Here: Open a new window and set the current directory
to that of the selected text. This is intended to be used from a
Finder window to open an empty document in the currently selected
folder.
* Open Selected File: If the selected text represents a file name,
then the corresponding file is opened in a new window.
If new files are set to open in the current window (in the General preference
pane) then the above services will also reuse the topmost window, instead of
@@ -537,20 +532,19 @@ opening a new window.
MacVim supports a custom URL handler for "mvim://" URLs. The handler is
supposed to be compatible to TextMate's URL scheme as documented at
http://blog.macromates.com/2007/the-textmate-url-scheme/.
http://blog.macromates.com/2007/the-textmate-url-scheme/.
Currently, this means that the format is >
mvim://open?<arguments>
< where arguments can be:
* url — the actual file to open (i.e. a file://... URL), if you leave
out this argument, the frontmost document is implied.
* line — line number to go to (one based).
* column — column number to go to (one based).
where "arguments" can be:
* url — the actual file to open (i.e. a file://... URL), if you leave
out this argument, the frontmost document is implied
* line — line number to go to (one based)
* column — column number to go to (one based)
For example, the link >
mvim://open?url=file:///etc/profile&line=20
< will open the file /etc/profile on line 20 when clicked in a web browser.
will open the file /etc/profile on line 20 when clicked in a web browser.
Note that url has to be a file:// url pointing to an existing local file.
@@ -558,8 +552,8 @@ Note that url has to be a file:// url pointing to an existing local file.
10. Keyboard shortcuts *macvim-shortcuts*
Most keyboard shortcuts in MacVim are bound to menu items and can be
discovered by looking through the menus. The remaining shortcuts are listed
here:
discovered by looking through the menus (see |macvim-menus| on how to create
your own menu shortcuts). The remaining shortcuts are listed here:
*Cmd-.* *<D-.>*
Cmd-. Interrupt Vim. This is synonymous with CTRL-C and can
@@ -671,7 +665,7 @@ See |macvim-shift-movement|.
Scenario: ~
You do not want MacVim to set up any key mappings.
Solution: ~
See |macvim-movement|.
See |cmd-movement|.
Scenario: ~
Enabling localized menus breaks the toolbar and the menus as well.
@@ -728,8 +722,19 @@ Use the VimLeave autocommand to hide MacVim when the window closes: >
au VimLeave * maca hide:
Assuming your external program has a setting for which command to execute to
bring up an editor, you would set that option to something like: >
mvim -c "au VimLeave * maca hide:"
(You may need to add the "-f" switch before the "-c", see the Scenario above.)
mvim -f -c "au VimLeave * maca hide:"
(See the above Scenario for an explanation of the "-f" switch.)
Scenario: ~
You would like to remap Caps Lock to Esc.
Solution: ~
The free app "PCKeyboardHack" can be used to remap Caps Lock. It is available
as a free download from:
http://www.pqrs.org/tekezo/macosx/keyremap4macbook/extra.html
On some Apple keyboards the Caps Lock key doesn't immediately register and
this makes Caps Lock "drop" key presses. To work around this problem go into
the "Keyboard & Mouse" System Preference and remap Caps Lock to Ctrl first
(click the "Modifier Keys..." button).
Scenario: ~
You can't find the information on MacVim you thought should be in this manual
+14 -2
View File
@@ -4493,6 +4493,18 @@ A jump table for the options with a short description can be found at |Q_op|.
'termencoding'.
Note: MacVim does not use this option.
*'macmeta'* *'mmta'* *'nomacmeta'* *'nommta'*
'macmeta' boolean (default off)
local to buffer
{only available in MacVim GUI}
Use option (alt) as meta key. When on, option-key presses are not
interpreted, thus enabling bindings to <M-..>. When off, option-key
presses are interpreted by the selected input method and inserted as
text.
Note: Some keys (e.g. <M-F1>, <M-Tab>, <M-Return>, <M-Left>) can be
bound with the Meta flag even when this option is disabled, but this
is not the case for the majority of keys (e.g. <M-a>, <M-`>).
*'magic'* *'nomagic'*
'magic' boolean (default on)
global
@@ -5439,7 +5451,7 @@ A jump table for the options with a short description can be found at |Q_op|.
<
*'runtimepath'* *'rtp'* *vimfiles*
'runtimepath' 'rtp' string (default:
Unix: "$HOME/.vim,
Unix, Mac OS X: "$HOME/.vim,
$VIM/vimfiles,
$VIMRUNTIME,
$VIM/vimfiles/after,
@@ -5454,7 +5466,7 @@ A jump table for the options with a short description can be found at |Q_op|.
$VIMRUNTIME,
$VIM/vimfiles/after,
$HOME/vimfiles/after"
Macintosh: "$VIM:vimfiles,
Macintosh (pre-OS X): "$VIM:vimfiles,
$VIMRUNTIME,
$VIM:vimfiles:after"
RISC-OS: "Choices:vimfiles,
+1
View File
@@ -767,6 +767,7 @@ Short explanation of each option: *option-list*
'listchars' 'lcs' characters for displaying in list mode
'loadplugins' 'lpl' load plugin scripts when starting up
'macatsui' Mac GUI: use ATSUI text drawing
'macmeta' 'mmta' use option as meta key (MacVim GUI only)
'magic' changes special characters in search patterns
'makeef' 'mef' name of the errorfile for ":make"
'makeprg' 'mp' program to use for the ":make" command
+24 -5
View File
@@ -1,4 +1,4 @@
*starting.txt* For Vim version 7.2. Last change: 2008 Jun 21
*starting.txt* For Vim version 7.2. Last change: 2008 Nov 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1338,8 +1338,9 @@ enter Vim and directly start working in your desired setup. |session-file|
*viminfo-read*
When Vim is started and the 'viminfo' option is non-empty, the contents of
the viminfo file are read and the info can be used in the appropriate places.
The marks are not read in at startup (but file marks are). See
|initialization| for how to set the 'viminfo' option upon startup.
The |v:oldfiles| variable is filled. The marks are not read in at startup
(but file marks are). See |initialization| for how to set the 'viminfo'
option upon startup.
*viminfo-write*
When Vim exits and 'viminfo' is non-empty, the info is stored in the viminfo
@@ -1373,6 +1374,8 @@ cursor position when the file was last exited. No marks are saved for files
that start with any string given with the "r" flag in 'viminfo'. This can be
used to avoid saving marks for files on removable media (for MS-DOS you would
use "ra:,rb:", for Amiga "rdf0:,rdf1:,rdf2:").
The |v:oldfiles| variable is filled with the file names that the viminfo file
has marks for.
*viminfo-file-marks*
Uppercase marks ('A to 'Z) are stored when writing the viminfo file. The
@@ -1464,8 +1467,8 @@ most of the information will be restored).
*:rv* *:rviminfo* *E195*
:rv[iminfo][!] [file] Read from viminfo file [file] (default: see above).
If [!] is given, then any information that is
already set (registers, marks, etc.) will be
overwritten. {not in Vi}
already set (registers, marks, |v:oldfiles|, etc.)
will be overwritten {not in Vi}
*:wv* *:wviminfo* *E137* *E138* *E574*
:wv[iminfo][!] [file] Write to viminfo file [file] (default: see above).
@@ -1480,4 +1483,20 @@ most of the information will be restored).
the .viminfo file.
{not in Vi}
*:ol* *:oldfiles*
:ol[dfiles] List the files that have marks stored in the viminfo
file. This list is read on startup and only changes
afterwards with ":rviminfo!". Also see |v:oldfiles|.
The number can be used with |c_#<|.
{not in Vi, only when compiled with the +eval feature}
:bro[wse] ol[dfiles][!]
List file names as with |:oldfiles|, and then prompt
for a number. When the number is valid that file from
the list is edited.
If you get the |press-enter| prompt you can press "q"
and still get the prompt to enter a file number.
Use ! to abondon a modified buffer. |abandon|
{not when compiled with tiny or small features}
vim:tw=78:ts=8:ft=help:norl:
+44 -2
View File
@@ -1,4 +1,4 @@
*usr_21.txt* For Vim version 7.2. Last change: 2007 May 01
*usr_21.txt* For Vim version 7.2. Last change: 2008 Nov 09
VIM USER MANUAL - by Bram Moolenaar
@@ -153,7 +153,7 @@ information. This may cause information that previously exiting Vims stored
to be lost. Each item can be remembered only once.
GETTING BACK TO WHERE YOU WERE
GETTING BACK TO WHERE YOU STOPPED VIM
You are halfway editing a file and it's time to leave for holidays. You exit
Vim and go enjoy yourselves, forgetting all about your work. After a couple
@@ -168,6 +168,48 @@ Mark '9 is lost.
The |:marks| command is useful to find out where '0 to '9 will take you.
GETTING BACK TO SOME FILE
If you want to go back to a file that you edited recently, but not when
exiting Vim, there is a slightly more complicated way. You can see a list of
files by typing the command: >
:oldfiles
< 1: ~/.viminfo ~
2: ~/text/resume.txt ~
3: /tmp/draft ~
Now you would like to edit the second file, which is in the list preceded by
"2:". You type: >
:e #<2
Instead of ":e" you can use any command that has a file name argument, the
"#<2" item works in the same place as "%" (current file name) and "#"
(alternate file name). So you can also split the window to edit the third
file: >
:split #<3
That #<123 thing is a bit complicated when you just want to edit a file.
Fortunately there is a simpler way: >
:browse oldfiles
< 1: ~/.viminfo ~
2: ~/text/resume.txt ~
3: /tmp/draft ~
-- More --
You get the same list of files as with |:oldfiles|. If you want to edit
"resume.txt" first press "q" to stop the listing. You will get a prompt:
Type number and <Enter> (empty cancels): ~
Type "2" and press <Enter> to edit the second file.
More info at |:oldfiles|, |v:oldfiles| and |c_#<|.
MOVE INFO FROM ONE VIM TO ANOTHER
You can use the ":wviminfo" and ":rviminfo" commands to save and restore the
+3
View File
@@ -623,6 +623,9 @@ if has("gui")
call <SID>BinOptionG("fullscreen", &fullscreen)
call append("$", "fuoptions\tcontrol how fullscreen mode should behave")
call <SID>OptionG("fuoptions", &fuoptions)
call append("$", "macmeta\tuse option as meta key")
call append("$", "\t(local to buffer)")
call <SID>BinOptionL("mmta")
endif
endif
-2
View File
@@ -76,8 +76,6 @@
<dict>
<key>atsuiButtonClicked</key>
<string>id</string>
<key>fakeEscModifierKeyChanged</key>
<string>id</string>
<key>loginShellButtonClicked</key>
<string>id</string>
<key>quickstartButtonClicked</key>
+1 -1
View File
@@ -13,7 +13,7 @@
<integer>115</integer>
</array>
<key>IBSystem Version</key>
<string>9F33</string>
<string>9E17</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
Binary file not shown.
+3 -1
View File
@@ -558,7 +558,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>36</string>
<string>37</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
@@ -617,6 +617,8 @@
</array>
<key>SUFeedURL</key>
<string>http://bjorn.winckler.googlepages.com/macvim_latest.xml</string>
<key>NSAppleScriptEnabled</key>
<true/>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
+12 -10
View File
@@ -154,6 +154,9 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
+ (void)initialize
{
// Avoid zombies (we fork Vim processes which we don't want to wait for).
signal(SIGCHLD, SIG_IGN);
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:NO], MMNoWindowKey,
[NSNumber numberWithInt:64], MMTabMinWidthKey,
@@ -185,10 +188,6 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
[NSNumber numberWithBool:NO], MMVerticalSplitKey,
[NSNumber numberWithInt:0], MMPreloadCacheSizeKey,
[NSNumber numberWithInt:0], MMLastWindowClosedBehaviorKey,
[NSNumber numberWithInt:MMDisableFakeEsc],
MMFakeEscModifierKey,
[NSNumber numberWithFloat:0.3], MMFakeEscTimeoutKey,
[NSNumber numberWithBool:NO], MMFakeEscOnKeyDownKey,
nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
@@ -235,11 +234,6 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
[connection setRequestTimeout:MMRequestTimeout];
[connection setReplyTimeout:MMReplyTimeout];
// NOTE: When the user is resizing the window the AppKit puts the run
// loop in event tracking mode. Unless the connection listens to
// request in this mode, live resizing won't work.
[connection addRequestMode:NSEventTrackingRunLoopMode];
// NOTE! If the name of the connection changes here it must also be
// updated in MMBackend.m.
NSString *name = [NSString stringWithFormat:@"%@-connection",
@@ -642,7 +636,8 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
[win setFrameTopLeftPoint:topLeft];
if ([win frame].origin.y < [[win screen] frame].origin.y) {
NSPoint screenOrigin = [[win screen] frame].origin;
if ([win frame].origin.y < screenOrigin.y) {
// Try to avoid shifting the new window downwards if it means that
// the bottom of the window will be off the screen. E.g. if the
// user has set windows to open maximized in the vertical direction
@@ -650,6 +645,13 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
topLeft.y = oldTopLeft.y;
[win setFrameTopLeftPoint:topLeft];
}
if ([win frame].origin.y < screenOrigin.y) {
// Move the window to the top of the screen if the bottom of the
// window is still obscured.
topLeft.y = NSMaxY([[win screen] frame]);
[win setFrameTopLeftPoint:topLeft];
}
}
if (1 == [vimControllers count]) {
-9
View File
@@ -12,15 +12,6 @@
@interface MMApplication : NSApplication {
CFAbsoluteTime fakeEscTimeDown;
CFAbsoluteTime fakeEscTimeout;
int fakeEscKeyCode;
unsigned fakeEscModifierMask;
BOOL blockFakeEscEvent;
BOOL blockKeyDown;
BOOL fakeEscOnKeyDown;
}
- (IBAction)fakeEscModifierKeyChanged:(id)sender;
@end
+1 -106
View File
@@ -14,7 +14,6 @@
*/
#import "MMApplication.h"
#import "Miscellaneous.h"
// Ctrl-Tab is broken on pre 10.5, so we add a hack to make it work.
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
@@ -27,88 +26,11 @@
@implementation MMApplication
- (void)awakeFromNib
{
[self fakeEscModifierKeyChanged:nil];
}
- (void)sendEvent:(NSEvent *)event
{
NSEventType type = [event type];
unsigned flags = [event modifierFlags];
// The following hack allows the user to set one modifier key of choice
// (Ctrl, Alt, or Cmd) to generate an Esc key press event. In order for
// the key to still be used as a modifier we only send the "faked" Esc
// event if the modifier was pressed and released without any other keys
// being pressed in between. The user may elect to have the chosen
// modifier sending Esc on key down, since sending it on key up makes it
// appear a bit sluggish. However, this effectively disables the modifier
// key (but only the left key and not the right one, in case there are two
// on the keyboard).
//
// This hack is particularly useful in conjunction with Mac OS X's ability
// to turn Caps-Lock into a modifier key of choice because it enables us to
// turn Caps-Lock into a quasi-Esc key! (This remapping be done inside
// "System Preferences -> Keyboard & Mouse -> Modifier Keys...".)
//
if (fakeEscKeyCode != 0) {
if (NSFlagsChanged == type && [event keyCode] == fakeEscKeyCode) {
BOOL sendEsc = NO;
CFAbsoluteTime timeNow = CFAbsoluteTimeGetCurrent();
if ((flags & fakeEscModifierMask) == 0) {
// The chosen modifier was released. If the modifier was
// recently pressed then convert this event to a "fake" Esc key
// press event.
if (!blockFakeEscEvent && !fakeEscOnKeyDown &&
timeNow - fakeEscTimeDown < fakeEscTimeout)
sendEsc = YES;
blockFakeEscEvent = YES;
blockKeyDown = NO;
} else {
// The chosen modifier was pressed.
blockFakeEscEvent = NO;
fakeEscTimeDown = timeNow;
if (fakeEscOnKeyDown) {
sendEsc = YES;
// Block key down while the fake Esc modifier key is held,
// otherwise "marked text" may pop up if a key is pressed
// while the fake Esc modifier is held (which looks ugly,
// but is harmless).
blockKeyDown = YES;
}
}
if (sendEsc) {
NSEvent *e = [NSEvent keyEventWithType:NSKeyDown
location:[event locationInWindow]
modifierFlags:flags & 0x0000ffffU
timestamp:[event timestamp]
windowNumber:[event windowNumber]
context:[event context]
characters:@"\x1b" // Esc
charactersIgnoringModifiers:@"\x1b"
isARepeat:NO
keyCode:53];
[self postEvent:e atStart:YES];
return;
}
} else if (type != NSKeyUp) {
// Another event occurred, so don't send any fake Esc events now
// (else the modifier would not function as a modifier key any
// more).
blockFakeEscEvent = YES;
}
if (blockKeyDown && type == NSKeyDown)
return;
}
#ifdef MM_CTRL_TAB_HACK
NSResponder *firstResponder = [[self keyWindow] firstResponder];
@@ -129,7 +51,7 @@
// key event.
if ((NSKeyDown == type || NSKeyUp == type) && (flags & NSHelpKeyMask)) {
flags &= ~NSHelpKeyMask;
NSEvent *e = [NSEvent keyEventWithType:[event type]
event = [NSEvent keyEventWithType:[event type]
location:[event locationInWindow]
modifierFlags:flags
timestamp:[event timestamp]
@@ -139,9 +61,6 @@
charactersIgnoringModifiers:[event charactersIgnoringModifiers]
isARepeat:[event isARepeat]
keyCode:[event keyCode]];
[self postEvent:e atStart:YES];
return;
}
[super sendEvent:event];
@@ -164,28 +83,4 @@
nil]];
}
- (IBAction)fakeEscModifierKeyChanged:(id)sender
{
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
switch ([ud integerForKey:MMFakeEscModifierKey]) {
case MMCtrlFakeEsc:
fakeEscKeyCode = 59;
fakeEscModifierMask = NSControlKeyMask;
break;
case MMAltFakeEsc:
fakeEscKeyCode = 58;
fakeEscModifierMask = NSAlternateKeyMask;
break;
case MMCmdFakeEsc:
fakeEscKeyCode = 55;
fakeEscModifierMask = NSCommandKeyMask;
break;
default:
fakeEscKeyCode = fakeEscModifierMask = 0;
}
fakeEscTimeout = [ud floatForKey:MMFakeEscTimeoutKey];
fakeEscOnKeyDown = [ud boolForKey:MMFakeEscOnKeyDownKey];
}
@end
+4 -2
View File
@@ -710,10 +710,12 @@ defaultLineHeightForFont(NSFont *font)
[self endDrawing];
[self setNeedsDisplay:YES];
// NOTE: During resizing, Cocoa only sends draw messages before Vim's rows
// and columns are changed (due to ipc delays). Force a redraw here.
[self setNeedsDisplay:YES];
// [self displayIfNeeded];
if ([self inLiveResize])
[self display];
#if MM_DEBUG_DRAWING
NSLog(@"<==== END %s", _cmd);
+56 -12
View File
@@ -1521,10 +1521,13 @@ static NSString *MMSymlinkWarningString =
// We take this approach of "pushing" the state to MacVim to avoid having
// to make synchronous calls from MacVim to Vim in order to get state.
BOOL mmta = curbuf ? curbuf->b_p_mmta : NO;
NSDictionary *vimState = [NSDictionary dictionaryWithObjectsAndKeys:
[[NSFileManager defaultManager] currentDirectoryPath], @"pwd",
[NSNumber numberWithInt:p_mh], @"p_mh",
[NSNumber numberWithBool:[self unusedEditor]], @"unusedEditor",
[NSNumber numberWithBool:mmta], @"p_mmta",
nil];
// Put the state before all other messages.
@@ -1695,13 +1698,18 @@ static NSString *MMSymlinkWarningString =
if (SetTextRowsMsgID == msgid || SetTextColumnsMsgID == msgid) {
int dim[2] = { rows, cols };
d = [NSData dataWithBytes:dim length:2*sizeof(int)];
msgid = SetTextDimensionsMsgID;
msgid = SetTextDimensionsReplyMsgID;
}
if (SetTextDimensionsMsgID == msgid)
msgid = SetTextDimensionsReplyMsgID;
// NOTE! Vim doesn't call gui_mch_set_shellsize() after
// gui_resize_shell(), so we have to manually set the rows and columns
// here. (MacVim doesn't change the rows and columns to avoid
// inconsistent states between Vim and MacVim.)
// here since MacVim doesn't change the rows and columns to avoid
// inconsistent states between Vim and MacVim. The message sent back
// indicates that it is a reply to a message that originated in MacVim
// since we need to be able to determine where a message originated.
[self queueMessage:msgid data:d];
//NSLog(@"[VimTask] Resizing shell to %dx%d.", cols, rows);
@@ -1796,6 +1804,7 @@ static NSString *MMSymlinkWarningString =
- (void)handleKeyDown:(NSString *)key modifiers:(int)mods
{
// TODO: This code is a horrible mess -- clean up!
char_u special[3];
char_u modChars[3];
char_u *chars = (char_u*)[key UTF8String];
@@ -1858,9 +1867,52 @@ static NSString *MMSymlinkWarningString =
}
mods &= ~MOD_MASK_ALT;
}
} else if (1 == length && chars[0] < 0x80 && (mods & MOD_MASK_ALT)) {
// META key is treated separately. This code was taken from gui_w48.c
// and gui_gtk_x11.c.
char_u string[7];
int ch = simplify_key(chars[0], &mods);
// Remove the SHIFT modifier for keys where it's already included,
// e.g., '(' and '*'
if (ch < 0x100 && !isalpha(ch) && isprint(ch))
mods &= ~MOD_MASK_SHIFT;
// Interpret the ALT key as making the key META, include SHIFT, etc.
ch = extract_modifiers(ch, &mods);
if (ch == CSI)
ch = K_CSI;
int len = 0;
if (mods) {
string[len++] = CSI;
string[len++] = KS_MODIFIER;
string[len++] = mods;
}
if (IS_SPECIAL(ch)) {
string[len++] = CSI;
string[len++] = K_SECOND(ch);
string[len++] = K_THIRD(ch);
} else {
string[len++] = ch;
#ifdef FEAT_MBYTE
// TODO: What if 'enc' is not "utf-8"?
if (enc_utf8 && (ch & 0x80)) { // convert to utf-8
string[len++] = ch & 0xbf;
string[len-2] = ((unsigned)ch >> 6) + 0xc0;
if (string[len-1] == CSI) {
string[len++] = KS_EXTRA;
string[len++] = (int)KE_CSI;
}
}
#endif
}
add_to_input_buf(string, len);
return;
} else if (length > 0) {
unichar c = [key characterAtIndex:0];
//NSLog(@"non-special: %@ (hex=%x, mods=%d)", key,
// [key characterAtIndex:0], mods);
@@ -1875,14 +1927,6 @@ static NSString *MMSymlinkWarningString =
//NSLog(@"clear shift ctrl");
}
// HACK! All Option+key presses go via 'insert text' messages, except
// for <M-Space>. If the Alt flag is not cleared for <M-Space> it does
// not work to map to it.
if (0xa0 == c && !(mods & MOD_MASK_CMD)) {
//NSLog(@"clear alt");
mods &= ~MOD_MASK_ALT;
}
#ifdef FEAT_MBYTE
if (input_conv.vc_type != CONV_NONE) {
conv_str = string_convert(&input_conv, chars, &length);
+2 -1
View File
@@ -287,7 +287,8 @@
// NOTE: During resizing, Cocoa only sends draw messages before Vim's rows
// and columns are changed (due to ipc delays). Force a redraw here.
[self displayIfNeeded];
if ([self inLiveResize])
[self display];
#if MM_DEBUG_DRAWING
NSLog(@"<==== END %s", _cmd);
+12 -1
View File
@@ -111,6 +111,17 @@ static float MMDragAreaSize = 73.0f;
} else {
[self dispatchKeyEvent:event];
}
} else if ((flags & NSAlternateKeyMask) &&
[[[[self vimController] vimState] objectForKey:@"p_mmta"]
boolValue]) {
// If the 'macmeta' option is set, then send Alt+key presses directly
// to Vim without interpreting the key press.
NSString *unmod = [event charactersIgnoringModifiers];
int len = [unmod lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
const char *bytes = [unmod UTF8String];
[self sendKeyDown:bytes length:len modifiers:flags
isARepeat:[event isARepeat]];
} else {
[textView interpretKeyEvents:[NSArray arrayWithObject:event]];
}
@@ -161,7 +172,7 @@ static float MMDragAreaSize = 73.0f;
NSMutableData *data = [NSMutableData data];
int len = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
int flags = [event modifierFlags] & 0xffff0000U;
if ([event isARepeat])
if ([event type] == NSKeyDown && [event isARepeat])
flags |= 1;
[data appendBytes:&flags length:sizeof(int)];
+20 -11
View File
@@ -18,7 +18,7 @@
*
* Output from the backend is received in processCommandQueue:. Input is sent
* to the backend via sendMessage:data: or addVimInput:. The latter allows
* execution of arbitrary stings in the Vim process, much like the Vim script
* execution of arbitrary strings in the Vim process, much like the Vim script
* function remote_send() does. The messages that may be passed between
* frontend and backend are defined in an enum in MacVim.h.
*/
@@ -599,6 +599,13 @@ static BOOL isUnsafeMessage(int msgid);
// that did happen anyway, the command queue could get processed out of
// order.
// See comment below why this is called here and not later.
[windowController processCommandQueueDidFinish];
// NOTE: Ensure that no calls are made after this "if" clause that may call
// sendMessage::. If this happens anyway, such messages will be put on the
// send queue and then the queue will not be flushed until the next time
// this method is called.
if ([sendQueue count] > 0) {
@try {
[backendProxy processInputAndData:sendQueue];
@@ -611,7 +618,6 @@ static BOOL isUnsafeMessage(int msgid);
[sendQueue removeAllObjects];
}
[windowController processCommandQueueDidFinish];
[receiveQueue removeAllObjects];
inProcessCommandQueue = NO;
}
@@ -667,12 +673,12 @@ static BOOL isUnsafeMessage(int msgid);
BOOL inDefaultMode = [[[NSRunLoop currentRunLoop] currentMode]
isEqual:NSDefaultRunLoopMode];
if (!inDefaultMode && isUnsafeMessage(msgid)) {
// NOTE: Because we listen to DO messages in 'event tracking'
// mode we have to take extra care when doing things like
// releasing view items (and other Cocoa objects). Messages
// that may be potentially "unsafe" are delayed until the run
// loop is back to default mode at which time they are safe to
// call again.
// NOTE: Because we may be listening to DO messages in "event
// tracking mode" we have to take extra care when doing things
// like releasing view items (and other Cocoa objects).
// Messages that may be potentially "unsafe" are delayed until
// the run loop is back to default mode at which time they are
// safe to call again.
// A problem with this approach is that it is hard to
// classify which messages are unsafe. As a rule of thumb, if
// a message may release an object used by the Cocoa framework
@@ -736,13 +742,16 @@ static BOOL isUnsafeMessage(int msgid);
[windowController showTabBar:YES];
} else if (HideTabBarMsgID == msgid) {
[windowController showTabBar:NO];
} else if (SetTextDimensionsMsgID == msgid || LiveResizeMsgID == msgid) {
} else if (SetTextDimensionsMsgID == msgid || LiveResizeMsgID == msgid ||
SetTextDimensionsReplyMsgID == msgid) {
const void *bytes = [data bytes];
int rows = *((int*)bytes); bytes += sizeof(int);
int cols = *((int*)bytes); bytes += sizeof(int);
[windowController setTextDimensionsWithRows:rows columns:cols
live:(LiveResizeMsgID==msgid)];
[windowController setTextDimensionsWithRows:rows
columns:cols
isLive:(LiveResizeMsgID==msgid)
isReply:(SetTextDimensionsReplyMsgID==msgid)];
} else if (SetWindowTitleMsgID == msgid) {
const void *bytes = [data bytes];
int len = *((int*)bytes); bytes += sizeof(int);
+21
View File
@@ -22,6 +22,7 @@
#import "MMTextView.h"
#import "MMVimController.h"
#import "MMVimView.h"
#import "MMWindowController.h"
#import "Miscellaneous.h"
#import <PSMTabBarControl.h>
@@ -909,4 +910,24 @@ enum {
[[(MMVimView*)vimView textView] scrollWheel:event];
}
- (void)mouseDown:(NSEvent *)event
{
// TODO: This is an ugly way of getting the connection to the backend.
NSConnection *connection = nil;
id wc = [[self window] windowController];
if ([wc isKindOfClass:[MMWindowController class]]) {
MMVimController *vc = [(MMWindowController*)wc vimController];
id proxy = [vc backendProxy];
connection = [(NSDistantObject*)proxy connectionForProxy];
}
// NOTE: The scroller goes into "event tracking mode" when the user clicks
// (and holds) the mouse button. We have to manually add the backend
// connection to this mode while the mouse button is held, else DO messages
// from Vim will not be processed until the mouse button is released.
[connection addRequestMode:NSEventTrackingRunLoopMode];
[super mouseDown:event];
[connection removeRequestMode:NSEventTrackingRunLoopMode];
}
@end // MMScroller
+1
View File
@@ -14,6 +14,7 @@
@interface MMWindow : NSWindow {
NSBox *tablineSeparator;
NSRect userFrame;
}
- (id)initWithContentRect:(NSRect)rect
+21
View File
@@ -140,4 +140,25 @@
return YES;
}
- (IBAction)zoom:(id)sender
{
NSRect frame = [self frame];
NSRect defaultFrame = [[self screen] visibleFrame];
defaultFrame = [[self delegate] windowWillUseStandardFrame:self
defaultFrame:defaultFrame];
// TODO: Check if width & height differs by cellSize or more.
BOOL isZoomed = ((abs(frame.size.width - defaultFrame.size.width) < 8) &&
(abs(frame.size.height - defaultFrame.size.height) < 8));
if (isZoomed) {
if (userFrame.size.width > 0 && userFrame.size.height > 0)
defaultFrame = userFrame;
} else {
userFrame = frame;
}
[self setFrame:defaultFrame display:YES];
}
@end // MMWindow
+3 -1
View File
@@ -22,6 +22,7 @@
MMVimView *vimView;
BOOL setupDone;
BOOL shouldResizeVimView;
BOOL keepOnScreen;
BOOL fullscreenEnabled;
NSString *windowAutosaveKey;
MMFullscreenWindow *fullscreenWindow;
@@ -39,7 +40,8 @@
- (void)showWindow;
- (void)updateTabsWithData:(NSData *)data;
- (void)selectTabWithIndex:(int)idx;
- (void)setTextDimensionsWithRows:(int)rows columns:(int)cols live:(BOOL)live;
- (void)setTextDimensionsWithRows:(int)rows columns:(int)cols isLive:(BOOL)live
isReply:(BOOL)reply;
- (void)setTitle:(NSString *)title;
- (void)setDocumentFilename:(NSString *)filename;
- (void)setToolbar:(NSToolbar *)toolbar;
+115 -20
View File
@@ -72,8 +72,10 @@
@interface MMWindowController (Private)
- (NSSize)contentSize;
- (void)resizeWindowToFitContentSize:(NSSize)contentSize;
- (void)resizeWindowToFitContentSize:(NSSize)contentSize
keepOnScreen:(BOOL)onScreen;
- (NSSize)constrainContentSizeToScreenSize:(NSSize)contentSize;
- (NSRect)constrainFrame:(NSRect)frame;
- (void)updateResizeConstraints;
- (NSTabViewItem *)addNewTabViewItem;
- (BOOL)askBackendForStarRegister:(NSPasteboard *)pb;
@@ -271,7 +273,8 @@
setupDone = YES;
[self updateResizeConstraints];
[self resizeWindowToFitContentSize:[vimView desiredSize]];
[self resizeWindowToFitContentSize:[vimView desiredSize]
keepOnScreen:YES];
}
- (void)showWindow
@@ -295,10 +298,11 @@
[vimView selectTabWithIndex:idx];
}
- (void)setTextDimensionsWithRows:(int)rows columns:(int)cols live:(BOOL)live
- (void)setTextDimensionsWithRows:(int)rows columns:(int)cols isLive:(BOOL)live
isReply:(BOOL)reply
{
//NSLog(@"setTextDimensionsWithRows:%d columns:%d live:%s", rows, cols,
// live ? "YES" : "NO");
//NSLog(@"setTextDimensionsWithRows:%d columns:%d isLive:%d isReply:%d",
// rows, cols, live, reply);
// NOTE: The only place where the (rows,columns) of the vim view are
// modified is here and when entering/leaving full-screen. Setting these
@@ -310,11 +314,17 @@
// resize when this message is received. We refrain from changing the view
// size when this flag is set, otherwise the window might jitter when the
// user drags to resize the window.
//
// The 'reply' flag indicates that this resize originated in MacVim and
// that Vim is now replying to that resize to make sure that it comes into
// effect.
[vimView setDesiredRows:rows columns:cols];
if (setupDone && !live)
if (setupDone && !live) {
shouldResizeVimView = YES;
keepOnScreen = !reply;
}
}
- (void)setTitle:(NSString *)title
@@ -432,8 +442,11 @@
[[fullscreenWindow contentView] setNeedsDisplay:YES];
[fullscreenWindow centerView];
} else {
[self resizeWindowToFitContentSize:contentSize];
[self resizeWindowToFitContentSize:contentSize
keepOnScreen:keepOnScreen];
}
keepOnScreen = NO;
}
}
@@ -500,16 +513,33 @@
- (void)liveResizeWillStart
{
if (!setupDone) return;
// Save the original title, if we haven't already.
if (lastSetTitle == nil) {
lastSetTitle = [[decoratedWindow title] retain];
}
// NOTE: During live resize Cocoa goes into "event tracking mode". We have
// to add the backend connection to this mode in order for resize messages
// from Vim to reach MacVim. We do not wish to always listen to requests
// in event tracking mode since then MacVim could receive DO messages at
// unexpected times (e.g. when a key equivalent is pressed and the menu bar
// momentarily lights up).
id proxy = [vimController backendProxy];
NSConnection *connection = [(NSDistantObject*)proxy connectionForProxy];
[connection addRequestMode:NSEventTrackingRunLoopMode];
}
- (void)liveResizeDidEnd
{
if (!setupDone) return;
// See comment above regarding event tracking mode.
id proxy = [vimController backendProxy];
NSConnection *connection = [(NSDistantObject*)proxy connectionForProxy];
[connection removeRequestMode:NSEventTrackingRunLoopMode];
// NOTE: During live resize messages from MacVim to Vim are often dropped
// (because too many messages are sent at once). This may lead to
// inconsistent states between Vim and MacVim; to avoid this we send a
@@ -533,7 +563,8 @@
// Sending of synchronous message failed. Force the window size to
// match the last dimensions received from Vim, otherwise we end up
// with inconsistent states.
[self resizeWindowToFitContentSize:[vimView desiredSize]];
[self resizeWindowToFitContentSize:[vimView desiredSize]
keepOnScreen:NO];
}
// If we saved the original title while resizing, restore it.
@@ -736,6 +767,24 @@
}
}
- (NSSize)windowWillResize:(NSWindow *)win toSize:(NSSize)proposedFrameSize
{
// Make sure the window isn't resized to be larger than the "visible frame"
// for the current screen. Do this here instead of setting the window max
// size in updateResizeConstraints since the screen's visible frame may
// change at any time (dock could move, resolution could change, window
// could be moved to another screen, ...).
NSRect maxFrame = [self constrainFrame:[[win screen] visibleFrame]];
if (proposedFrameSize.width > maxFrame.size.width)
proposedFrameSize.width = maxFrame.size.width;
if (proposedFrameSize.height > maxFrame.size.height)
proposedFrameSize.height = maxFrame.size.height;
return proposedFrameSize;
}
- (void)windowDidResize:(id)sender
{
if (!setupDone || fullscreenEnabled) return;
@@ -762,6 +811,11 @@
BOOL zoomBoth = [[NSUserDefaults standardUserDefaults]
boolForKey:MMZoomBothKey];
// The "default frame" represents the maximal size of a zoomed window.
// Constrain this frame so that the content fits an even number of rows and
// columns.
frame = [self constrainFrame:frame];
if (!((zoomBoth && !cmdLeftClick) || (!zoomBoth && cmdLeftClick))) {
// Zoom in horizontal direction only.
NSRect currentFrame = [win frame];
@@ -769,16 +823,6 @@
frame.origin.x = currentFrame.origin.x;
}
// HACK! The window frame is often higher than the 'defaultFrame' (the fact
// that 'defaultFrame' doesn't cover the entire area up to the menu bar
// seems like a Cocoa bug). To ensure that the window doesn't move
// downwards when the zoom button is clicked we check for this situation
// and return a frame whose max Y coordinate is no lower than the current
// max Y coordinate.
float delta = NSMaxY([win frame]) - NSMaxY(frame);
if (delta > 0)
frame.origin.y += delta;
return frame;
}
@@ -806,6 +850,20 @@
return [self askBackendForStarRegister:pboard];
}
- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard
{
// Replace the current selection with the text on the pasteboard.
NSArray *types = [pboard types];
if ([types containsObject:NSStringPboardType]) {
NSString *input = [NSString stringWithFormat:@"s%@",
[pboard stringForType:NSStringPboardType]];
[vimController addVimInput:input];
return YES;
}
return NO;
}
@end // MMWindowController
@@ -822,6 +880,7 @@
}
- (void)resizeWindowToFitContentSize:(NSSize)contentSize
keepOnScreen:(BOOL)onScreen
{
NSRect frame = [decoratedWindow frame];
NSRect contentRect = [decoratedWindow contentRectForFrameRect:frame];
@@ -830,8 +889,29 @@
contentRect.origin.y -= contentSize.height - contentRect.size.height;
contentRect.size = contentSize;
frame = [decoratedWindow frameRectForContentRect:contentRect];
[decoratedWindow setFrame:frame display:YES];
NSRect newFrame = [decoratedWindow frameRectForContentRect:contentRect];
// Ensure that the window fits inside the visible part of the screen.
NSRect maxFrame = [[decoratedWindow screen] visibleFrame];
maxFrame = [self constrainFrame:maxFrame];
if (newFrame.size.width > maxFrame.size.width) {
newFrame.size.width = maxFrame.size.width;
newFrame.origin.x = maxFrame.origin.x;
}
if (newFrame.size.height > maxFrame.size.height) {
newFrame.size.height = maxFrame.size.height;
newFrame.origin.y = maxFrame.origin.y;
}
if (onScreen) {
if (newFrame.origin.y < maxFrame.origin.y)
newFrame.origin.y = maxFrame.origin.y;
if (NSMaxX(newFrame) > NSMaxX(maxFrame))
newFrame.origin.x = NSMaxX(maxFrame) - newFrame.size.width;
}
[decoratedWindow setFrame:newFrame display:YES];
}
- (NSSize)constrainContentSizeToScreenSize:(NSSize)contentSize
@@ -847,6 +927,21 @@
return contentSize;
}
- (NSRect)constrainFrame:(NSRect)frame
{
// Constrain the given (window) frame so that it fits an even number of
// rows and columns.
NSRect contentRect = [decoratedWindow contentRectForFrameRect:frame];
NSSize constrainedSize = [vimView constrainRows:NULL
columns:NULL
toSize:contentRect.size];
contentRect.origin.y += contentRect.size.height - constrainedSize.height;
contentRect.size = constrainedSize;
return [decoratedWindow frameRectForContentRect:contentRect];
}
- (void)updateResizeConstraints
{
if (!setupDone) return;
+2 -1
View File
@@ -124,6 +124,8 @@ enum {
SetTextRowsMsgID,
SetTextColumnsMsgID,
SetTextDimensionsMsgID,
LiveResizeMsgID,
SetTextDimensionsReplyMsgID,
SetWindowTitleMsgID,
ScrollWheelMsgID,
MouseDownMsgID,
@@ -166,7 +168,6 @@ enum {
SetPreEditPositionMsgID,
TerminateNowMsgID,
XcodeModMsgID,
LiveResizeMsgID,
EnableAntialiasMsgID,
DisableAntialiasMsgID,
SetVimStateMsgID,
+2 -1
View File
@@ -31,6 +31,8 @@ char *MessageStrings[] =
"SetTextRowsMsgID",
"SetTextColumsMsgID",
"SetTextDimensionsMsgID",
"LiveResizeMsgID",
"SetTextDimensionsReplyMsgID",
"SetWindowTitleMsgID",
"ScrollWheelMsgID",
"MouseDownMsgID",
@@ -73,7 +75,6 @@ char *MessageStrings[] =
"SetPreEditPositionMsgID",
"TerminateNowMsgID",
"XcodeModMsgID",
"LiveResizeMsgID",
"EnableAntialiasMsgID",
"DisableAntialiasMsgID",
"SetVimStateMsgID",
+7 -7
View File
@@ -190,7 +190,7 @@
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
1D09AB3F0C6A4D520045497E /* MMTypesetter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MMTypesetter.h; sourceTree = "<group>"; };
1D09AB400C6A4D520045497E /* MMTypesetter.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MMTypesetter.m; sourceTree = "<group>"; };
1D0E051B0BA5F83800B6049E /* Colors.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Colors.plist; sourceTree = "<group>"; };
1D0E051B0BA5F83800B6049E /* Colors.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Colors.plist; sourceTree = "<group>"; };
1D145C7D0E5227CE00691AA0 /* MMTextViewHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTextViewHelper.h; sourceTree = "<group>"; };
1D145C7E0E5227CE00691AA0 /* MMTextViewHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTextViewHelper.m; sourceTree = "<group>"; };
1D1474950C56703C0038FA2B /* MacVim.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MacVim.h; sourceTree = "<group>"; };
@@ -263,13 +263,13 @@
1DD66ECB0C803D3600EBDAB3 /* MMApplication.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MMApplication.h; sourceTree = "<group>"; };
1DD66ECC0C803D3600EBDAB3 /* MMApplication.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MMApplication.m; sourceTree = "<group>"; };
1DD703B80BA9D15D008679E9 /* vim_gloss.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = vim_gloss.icns; sourceTree = "<group>"; };
1DD704300BA9F9C2008679E9 /* SpecialKeys.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = SpecialKeys.plist; sourceTree = "<group>"; };
1DD9F5E40C85D60500E8D5A5 /* SystemColors.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = SystemColors.plist; sourceTree = "<group>"; };
1DD704300BA9F9C2008679E9 /* SpecialKeys.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SpecialKeys.plist; sourceTree = "<group>"; };
1DD9F5E40C85D60500E8D5A5 /* SystemColors.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SystemColors.plist; sourceTree = "<group>"; };
1DE3F8E60D50F80500052B9E /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/Preferences.nib; sourceTree = "<group>"; };
1DE3F8E80D50F84600052B9E /* MMPreferenceController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MMPreferenceController.h; sourceTree = "<group>"; };
1DE3F8E90D50F84600052B9E /* MMPreferenceController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MMPreferenceController.m; sourceTree = "<group>"; };
1DE602470C587FD10055263D /* runtime */ = {isa = PBXFileReference; lastKnownFileType = folder; name = runtime; path = ../../runtime; sourceTree = SOURCE_ROOT; };
1DE8CC610C5E2AAD003F56E3 /* Actions.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Actions.plist; sourceTree = "<group>"; };
1DE8CC610C5E2AAD003F56E3 /* Actions.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Actions.plist; sourceTree = "<group>"; };
1DE9B94D0D341AB8008FEDD4 /* MMWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MMWindow.h; sourceTree = "<group>"; };
1DE9B94E0D341AB8008FEDD4 /* MMWindow.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MMWindow.m; sourceTree = "<group>"; };
1DED785F0C6DE43D0079945F /* vimrc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = vimrc; sourceTree = "<group>"; };
@@ -766,7 +766,7 @@
i386,
);
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 36;
CURRENT_PROJECT_VERSION = 37;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
@@ -807,7 +807,7 @@
buildSettings = {
ARCHS = "$(NATIVE_ARCH)";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 36;
CURRENT_PROJECT_VERSION = 37;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
@@ -839,7 +839,7 @@
buildSettings = {
ARCHS = "$(NATIVE_ARCH)";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 36;
CURRENT_PROJECT_VERSION = 37;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
-11
View File
@@ -53,9 +53,6 @@ extern NSString *MMOpenLayoutKey;
extern NSString *MMVerticalSplitKey;
extern NSString *MMPreloadCacheSizeKey;
extern NSString *MMLastWindowClosedBehaviorKey;
extern NSString *MMFakeEscModifierKey;
extern NSString *MMFakeEscTimeoutKey;
extern NSString *MMFakeEscOnKeyDownKey;
// Enum for MMUntitledWindowKey
@@ -82,14 +79,6 @@ enum {
MMTerminateWhenLastWindowClosed = 2,
};
// Enum for MMFakeEscModifierKey
enum {
MMDisableFakeEsc = 0,
MMCtrlFakeEsc = 1,
MMAltFakeEsc = 2,
MMCmdFakeEsc = 3
};
-3
View File
@@ -44,9 +44,6 @@ NSString *MMOpenLayoutKey = @"MMOpenLayout";
NSString *MMVerticalSplitKey = @"MMVerticalSplit";
NSString *MMPreloadCacheSizeKey = @"MMPreloadCacheSize";
NSString *MMLastWindowClosedBehaviorKey = @"MMLastWindowClosedBehavior";
NSString *MMFakeEscModifierKey = @"MMFakeEscModifier";
NSString *MMFakeEscTimeoutKey = @"MMFakeEscTimeout";
NSString *MMFakeEscOnKeyDownKey = @"MMFakeEscOnKeyDown";
+3 -1
View File
@@ -323,8 +323,10 @@ gui_macvim_draw_string(int row, int col, char_u *s, int len, int flags)
// wide and vice versa.
for (i = 0; i < len; i += cl) {
c = utf_ptr2char(s + i);
cl = utf_ptr2len(s + i);
cn = utf_char2cells(c);
cl = utf_ptr2len(s + i);
if (0 == cl)
len = i; // len must be wrong (shouldn't happen)
if (!utf_iscomposing(c)) {
if ((cn > 1 && !wide) || (cn <= 1 && wide)) {
+40
View File
@@ -40,6 +40,46 @@
Sparkle supports updates in zip, tar, tbz, tgz, or dmg format.
-->
<item>
<title>Snapshot 37 released</title>
<description><![CDATA[
<h1>MacVim snapshot 37 released</h1>
<p> Changes since snapshot 36:
<ul>
<li> Fix bug where Vim would crash when resizing a window with double-width characters </li>
<li> Add option 'macmeta' to use "alt/option" as meta key to allow bindings to &lt;M-..&gt; (see ":h 'macmeta') </li>
<li> Add basic support for AppleScript (Jason Foreman). E.g. to zoom a window:
<pre>
tell application MacVim
set zoomed of first window to true
end tell
</pre>
</li>
<li> Fix various bugs relating to initial window positioning </li>
<li> Keep window is visible on ":set lines=..." and "set columns=..." </li>
<li> Inserting text from "Special Characters" palette works again </li>
<li> Remove the functionality to use a modifier key as Esc (use the PCKeyboardHack app instead, see ":h macvim-hints | /esc") </li>
<li> More help on keyboard shortcuts (":h macvim-shortcuts") and the mvim script (see ":h mvim") </li>
<li> Speed up live resize </li>
<li> Support mvim script symlinks to [m|g]ex and rmvim (see ":h mvim") </li>
<li> Tentative support for receiving input from system services (Try this: insert "2+3", select the text, then hit Cmd-*. Result: "2+3" is replaced with "5". Sometimes it seems you have to choose "MacVim-&gt;Services-&gt;Script Editor-&gt;Get Result of AppleScript" instead of pressing Cmd-* for this to work.) </li>
<li> No more Vim zombie processes </li>
<li> Add "Reload"/"Ignore All" buttons to the file changed dialog </li>
<li> (Almost) Latest runtime files, and Vim patches </li>
</ul>
</p>
]]></description>
<pubDate>Sat, 15 Nov 2008 13:04 CET</pubDate>
<enclosure type="application/octet-stream"
url="http://newmacvim.muskokamug.org/mirror/files/MacVim-snapshot-37.tbz"
length="8007921"
sparkle:version="37"
sparkle:shortVersionString="7.2"
/>
</item>
<item>
<title>Snapshot 36 released</title>
<description><![CDATA[
+5 -2
View File
@@ -39,12 +39,12 @@ gui=
opts=
# GUI mode, implies forking
case "$name" in m*|g*|rg*) gui=true ;; esac
case "$name" in m*|g*|rm*|rg*) gui=true ;; esac
# Restricted mode
case "$name" in r*) opts="$opts -Z";; esac
# vimdiff and view
# vimdiff, view, and ex mode
case "$name" in
*vimdiff)
opts="$opts -dO"
@@ -52,6 +52,9 @@ case "$name" in
*view)
opts="$opts -R"
;;
*ex)
opts="$opts -e"
;;
esac
# Last step: fire up vim.
+116 -7
View File
@@ -348,6 +348,7 @@ static struct vimvar
{VV_NAME("mouse_col", VAR_NUMBER), 0},
{VV_NAME("operator", VAR_STRING), VV_RO},
{VV_NAME("searchforward", VAR_NUMBER), 0},
{VV_NAME("oldfiles", VAR_LIST), 0},
};
/* shorthand */
@@ -355,6 +356,7 @@ static struct vimvar
#define vv_nr vv_di.di_tv.vval.v_number
#define vv_float vv_di.di_tv.vval.v_float
#define vv_str vv_di.di_tv.vval.v_string
#define vv_list vv_di.di_tv.vval.v_list
#define vv_tv vv_di.di_tv
/*
@@ -426,7 +428,6 @@ static long list_find_nr __ARGS((list_T *l, long idx, int *errorp));
static long list_idx_of_item __ARGS((list_T *l, listitem_T *item));
static void list_append __ARGS((list_T *l, listitem_T *item));
static int list_append_tv __ARGS((list_T *l, typval_T *tv));
static int list_append_string __ARGS((list_T *l, char_u *str, int len));
static int list_append_number __ARGS((list_T *l, varnumber_T n));
static int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item));
static int list_extend __ARGS((list_T *l1, list_T *l2, listitem_T *bef));
@@ -845,8 +846,13 @@ eval_clear()
p = &vimvars[i];
if (p->vv_di.di_tv.v_type == VAR_STRING)
{
vim_free(p->vv_di.di_tv.vval.v_string);
p->vv_di.di_tv.vval.v_string = NULL;
vim_free(p->vv_str);
p->vv_str = NULL;
}
else if (p->vv_di.di_tv.v_type == VAR_LIST)
{
list_unref(p->vv_list);
p->vv_list = NULL;
}
}
hash_clear(&vimvarht);
@@ -3287,7 +3293,7 @@ ex_call(eap)
if (*startarg != '(')
{
EMSG2(_("E107: Missing braces: %s"), eap->arg);
EMSG2(_("E107: Missing parentheses: %s"), eap->arg);
goto end;
}
@@ -6056,6 +6062,25 @@ list_find_nr(l, idx, errorp)
return get_tv_number_chk(&li->li_tv, errorp);
}
/*
* Get list item "l[idx - 1]" as a string. Returns NULL for failure.
*/
char_u *
list_find_str(l, idx)
list_T *l;
long idx;
{
listitem_T *li;
li = list_find(l, idx - 1);
if (li == NULL)
{
EMSGN(_(e_listidx), idx);
return NULL;
}
return get_tv_string(&li->li_tv);
}
/*
* Locate "item" list "l" and return its index.
* Returns -1 when "item" is not in the list.
@@ -6147,7 +6172,7 @@ list_append_dict(list, dict)
* When "len" >= 0 use "str[len]".
* Returns FAIL when out of memory.
*/
static int
int
list_append_string(l, str, len)
list_T *l;
char_u *str;
@@ -6507,6 +6532,9 @@ garbage_collect()
set_ref_in_ht(&fc->l_avars.dv_hashtab, copyID);
}
/* v: vars */
set_ref_in_ht(&vimvarht, copyID);
/*
* 2. Go through the list of dicts and free items without the copyID.
*/
@@ -6597,7 +6625,7 @@ set_ref_in_item(tv, copyID)
{
case VAR_DICT:
dd = tv->vval.v_dict;
if (dd->dv_copyID != copyID)
if (dd != NULL && dd->dv_copyID != copyID)
{
/* Didn't see this dict yet. */
dd->dv_copyID = copyID;
@@ -6607,7 +6635,7 @@ set_ref_in_item(tv, copyID)
case VAR_LIST:
ll = tv->vval.v_list;
if (ll->lv_copyID != copyID)
if (ll != NULL && ll->lv_copyID != copyID)
{
/* Didn't see this list yet. */
ll->lv_copyID = copyID;
@@ -18125,6 +18153,17 @@ get_vim_var_str(idx)
return get_tv_string(&vimvars[idx].vv_tv);
}
/*
* Get List v: variable value. Caller must take care of reference count when
* needed.
*/
list_T *
get_vim_var_list(idx)
int idx;
{
return vimvars[idx].vv_list;
}
/*
* Set v:count, v:count1 and v:prevcount.
*/
@@ -18160,6 +18199,20 @@ set_vim_var_string(idx, val, len)
vimvars[idx].vv_str = vim_strnsave(val, len);
}
/*
* Set List v: variable to "val".
*/
void
set_vim_var_list(idx, val)
int idx;
list_T *val;
{
list_unref(vimvars[idx].vv_list);
vimvars[idx].vv_list = val;
if (val != NULL)
++val->lv_refcount;
}
/*
* Set v:register if needed.
*/
@@ -21920,6 +21973,62 @@ last_set_msg(scriptID)
}
}
/*
* List v:oldfiles in a nice way.
*/
/*ARGSUSED*/
void
ex_oldfiles(eap)
exarg_T *eap;
{
list_T *l = vimvars[VV_OLDFILES].vv_list;
listitem_T *li;
int nr = 0;
if (l == NULL)
msg((char_u *)_("No old files"));
else
{
msg_start();
msg_scroll = TRUE;
for (li = l->lv_first; li != NULL && !got_int; li = li->li_next)
{
msg_outnum((long)++nr);
MSG_PUTS(": ");
msg_outtrans(get_tv_string(&li->li_tv));
msg_putchar('\n');
out_flush(); /* output one line at a time */
ui_breakcheck();
}
/* Assume "got_int" was set to truncate the listing. */
got_int = FALSE;
#ifdef FEAT_BROWSE_CMD
if (cmdmod.browse)
{
quit_more = FALSE;
nr = prompt_for_number(FALSE);
msg_starthere();
if (nr > 0)
{
char_u *p = list_find_str(get_vim_var_list(VV_OLDFILES),
(long)nr);
if (p != NULL)
{
p = expand_env_save(p);
eap->arg = p;
eap->cmdidx = CMD_edit;
cmdmod.browse = FALSE;
do_exedit(eap, NULL);
vim_free(p);
}
}
}
#endif
}
}
#endif /* FEAT_EVAL */
+19 -21
View File
@@ -24,7 +24,7 @@ static int linelen __ARGS((int *has_tab));
static void do_filter __ARGS((linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out));
#ifdef FEAT_VIMINFO
static char_u *viminfo_filename __ARGS((char_u *));
static void do_viminfo __ARGS((FILE *fp_in, FILE *fp_out, int want_info, int want_marks, int force_read));
static void do_viminfo __ARGS((FILE *fp_in, FILE *fp_out, int flags));
static int viminfo_encoding __ARGS((vir_T *virp));
static int read_viminfo_up_to_marks __ARGS((vir_T *virp, int forceit, int writing));
#endif
@@ -1676,14 +1676,12 @@ viminfo_error(errnum, message, line)
/*
* read_viminfo() -- Read the viminfo file. Registers etc. which are already
* set are not over-written unless force is TRUE. -- webb
* set are not over-written unless "flags" includes VIF_FORCEIT. -- webb
*/
int
read_viminfo(file, want_info, want_marks, forceit)
char_u *file;
int want_info;
int want_marks;
int forceit;
read_viminfo(file, flags)
char_u *file; /* file name or NULL to use default name */
int flags; /* VIF_WANT_INFO et al. */
{
FILE *fp;
char_u *fname;
@@ -1691,7 +1689,7 @@ read_viminfo(file, want_info, want_marks, forceit)
if (no_viminfo())
return FAIL;
fname = viminfo_filename(file); /* may set to default if NULL */
fname = viminfo_filename(file); /* get file name in allocated buffer */
if (fname == NULL)
return FAIL;
fp = mch_fopen((char *)fname, READBIN);
@@ -1701,8 +1699,9 @@ read_viminfo(file, want_info, want_marks, forceit)
verbose_enter();
smsg((char_u *)_("Reading viminfo file \"%s\"%s%s%s"),
fname,
want_info ? _(" info") : "",
want_marks ? _(" marks") : "",
(flags & VIF_WANT_INFO) ? _(" info") : "",
(flags & VIF_WANT_MARKS) ? _(" marks") : "",
(flags & VIF_GET_OLDFILES) ? _(" oldfiles") : "",
fp == NULL ? _(" FAILED") : "");
verbose_leave();
}
@@ -1712,10 +1711,9 @@ read_viminfo(file, want_info, want_marks, forceit)
return FAIL;
viminfo_errcnt = 0;
do_viminfo(fp, NULL, want_info, want_marks, forceit);
do_viminfo(fp, NULL, flags);
fclose(fp);
return OK;
}
@@ -1968,7 +1966,7 @@ write_viminfo(file, forceit)
}
viminfo_errcnt = 0;
do_viminfo(fp_in, fp_out, !forceit, !forceit, FALSE);
do_viminfo(fp_in, fp_out, forceit ? 0 : (VIF_WANT_INFO | VIF_WANT_MARKS));
fclose(fp_out); /* errors are ignored !? */
if (fp_in != NULL)
@@ -2041,12 +2039,10 @@ viminfo_filename(file)
* do_viminfo() -- Should only be called from read_viminfo() & write_viminfo().
*/
static void
do_viminfo(fp_in, fp_out, want_info, want_marks, force_read)
do_viminfo(fp_in, fp_out, flags)
FILE *fp_in;
FILE *fp_out;
int want_info;
int want_marks;
int force_read;
int flags;
{
int count = 0;
int eof = FALSE;
@@ -2061,8 +2057,9 @@ do_viminfo(fp_in, fp_out, want_info, want_marks, force_read)
if (fp_in != NULL)
{
if (want_info)
eof = read_viminfo_up_to_marks(&vir, force_read, fp_out != NULL);
if (flags & VIF_WANT_INFO)
eof = read_viminfo_up_to_marks(&vir,
flags & VIF_FORCEIT, fp_out != NULL);
else
/* Skip info, find start of marks */
while (!(eof = viminfo_readline(&vir))
@@ -2092,8 +2089,9 @@ do_viminfo(fp_in, fp_out, want_info, want_marks, force_read)
write_viminfo_bufferlist(fp_out);
count = write_viminfo_marks(fp_out);
}
if (fp_in != NULL && want_marks)
copy_viminfo_marks(&vir, fp_out, count, eof);
if (fp_in != NULL
&& (flags & (VIF_WANT_MARKS | VIF_GET_OLDFILES | VIF_FORCEIT)))
copy_viminfo_marks(&vir, fp_out, count, eof, flags);
vim_free(vir.vir_line);
#ifdef FEAT_MBYTE
+5 -3
View File
@@ -278,7 +278,7 @@ EX(CMD_cquit, "cquit", ex_cquit,
EX(CMD_crewind, "crewind", ex_cc,
RANGE|NOTADR|COUNT|TRLBAR|BANG),
EX(CMD_cscope, "cscope", do_cscope,
EXTRA|NOTRLCOM|SBOXOK|XFILE),
EXTRA|NOTRLCOM|XFILE),
EX(CMD_cstag, "cstag", do_cstag,
BANG|TRLBAR|WORD1),
EX(CMD_cunmap, "cunmap", ex_unmap,
@@ -506,7 +506,7 @@ EX(CMD_lchdir, "lchdir", ex_cd,
EX(CMD_lclose, "lclose", ex_cclose,
RANGE|NOTADR|COUNT|TRLBAR),
EX(CMD_lcscope, "lcscope", do_cscope,
EXTRA|NOTRLCOM|SBOXOK|XFILE),
EXTRA|NOTRLCOM|XFILE),
EX(CMD_left, "left", ex_align,
TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
EX(CMD_leftabove, "leftabove", ex_wrongmodifier,
@@ -657,6 +657,8 @@ EX(CMD_nunmenu, "nunmenu", ex_menu,
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
EX(CMD_open, "open", ex_open,
RANGE|EXTRA),
EX(CMD_oldfiles, "oldfiles", ex_oldfiles,
BANG|TRLBAR|SBOXOK|CMDWIN),
EX(CMD_omap, "omap", ex_map,
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
EX(CMD_omapclear, "omapclear", ex_mapclear,
@@ -808,7 +810,7 @@ EX(CMD_scriptnames, "scriptnames", ex_scriptnames,
EX(CMD_scriptencoding, "scriptencoding", ex_scriptencoding,
WORD1|TRLBAR|CMDWIN),
EX(CMD_scscope, "scscope", do_scscope,
EXTRA|NOTRLCOM|SBOXOK),
EXTRA|NOTRLCOM),
EX(CMD_set, "set", ex_set,
TRLBAR|EXTRA|CMDWIN|SBOXOK),
EX(CMD_setfiletype, "setfiletype", ex_setfiletype,
+42 -13
View File
@@ -366,6 +366,7 @@ static void ex_tag_cmd __ARGS((exarg_T *eap, char_u *name));
# define ex_function ex_ni
# define ex_delfunction ex_ni
# define ex_return ex_ni
# define ex_oldfiles ex_ni
#endif
static char_u *arg_all __ARGS((void));
#ifdef FEAT_SESSION
@@ -1777,7 +1778,7 @@ do_one_cmd(cmdlinep, sourcing,
}
if (checkforcmd(&ea.cmd, "browse", 3))
{
#ifdef FEAT_BROWSE
#ifdef FEAT_BROWSE_CMD
cmdmod.browse = TRUE;
#endif
continue;
@@ -3616,6 +3617,7 @@ set_one_cmd_context(xp, buff)
return set_context_in_autocmd(xp, arg, FALSE);
case CMD_doautocmd:
case CMD_doautoall:
return set_context_in_autocmd(xp, arg, TRUE);
#endif
case CMD_set:
@@ -9527,24 +9529,50 @@ eval_vars(src, srcstart, usedlen, lnump, errormsg, escaped)
break;
}
s = src + 1;
if (*s == '<') /* "#<99" uses v:oldfiles */
++s;
i = (int)getdigits(&s);
*usedlen = (int)(s - src); /* length of what we expand */
buf = buflist_findnr(i);
if (buf == NULL)
if (src[1] == '<')
{
*errormsg = (char_u *)_("E194: No alternate file name to substitute for '#'");
if (*usedlen < 2)
{
/* Should we give an error message for #<text? */
*usedlen = 1;
return NULL;
}
#ifdef FEAT_EVAL
result = list_find_str(get_vim_var_list(VV_OLDFILES),
(long)i);
if (result == NULL)
{
*errormsg = (char_u *)"";
return NULL;
}
#else
*errormsg = (char_u *)_("E809: #< is not available without the +eval feature");
return NULL;
}
if (lnump != NULL)
*lnump = ECMD_LAST;
if (buf->b_fname == NULL)
{
result = (char_u *)"";
valid = 0; /* Must have ":p:h" to be valid */
#endif
}
else
result = buf->b_fname;
{
buf = buflist_findnr(i);
if (buf == NULL)
{
*errormsg = (char_u *)_("E194: No alternate file name to substitute for '#'");
return NULL;
}
if (lnump != NULL)
*lnump = ECMD_LAST;
if (buf->b_fname == NULL)
{
result = (char_u *)"";
valid = 0; /* Must have ":p:h" to be valid */
}
else
result = buf->b_fname;
}
break;
#ifdef FEAT_SEARCHPATH
@@ -10727,7 +10755,8 @@ ex_viminfo(eap)
p_viminfo = (char_u *)"'100";
if (eap->cmdidx == CMD_rviminfo)
{
if (read_viminfo(eap->arg, TRUE, TRUE, eap->forceit) == FAIL)
if (read_viminfo(eap->arg, VIF_WANT_INFO | VIF_WANT_MARKS
| (eap->forceit ? VIF_FORCEIT : 0)) == FAIL)
EMSG(_("E195: Cannot open viminfo file for reading"));
}
else
+6 -2
View File
@@ -770,9 +770,13 @@
/*
* +browse ":browse" command.
* or just the ":browse" command modifier
*/
#if defined(FEAT_NORMAL) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) || defined(FEAT_GUI_MACVIM))
# define FEAT_BROWSE
#if defined(FEAT_NORMAL)
# define FEAT_BROWSE_CMD
# if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) || defined(FEAT_GUI_MACVIM)
# define FEAT_BROWSE
# endif
#endif
/*
+35 -2
View File
@@ -2711,7 +2711,7 @@ check_marks_read()
{
if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0
&& curbuf->b_ffname != NULL)
read_viminfo(NULL, FALSE, TRUE, FALSE);
read_viminfo(NULL, VIF_WANT_MARKS);
/* Always set b_marks_read; needed when 'viminfo' is changed to include
* the ' parameter after opening a buffer. */
@@ -6232,6 +6232,9 @@ vim_rename(from, to)
}
static int already_warned = FALSE;
#ifdef FEAT_GUI_MACVIM
static int default_reload_choice = 0;
#endif
/*
* Check if any not hidden buffer has been changed.
@@ -6274,6 +6277,9 @@ check_timestamps(focus)
++no_wait_return;
did_check_timestamps = TRUE;
already_warned = FALSE;
#ifdef FEAT_GUI_MACVIM
default_reload_choice = 0;
#endif
for (buf = firstbuf; buf != NULL; )
{
/* Only check buffers in a window. */
@@ -6292,6 +6298,9 @@ check_timestamps(focus)
}
buf = buf->b_next;
}
#ifdef FEAT_GUI_MACVIM
default_reload_choice = 0;
#endif
--no_wait_return;
need_check_timestamps = FALSE;
if (need_wait_return && didit == 2)
@@ -6551,9 +6560,33 @@ buf_check_timestamp(buf, focus)
STRCAT(tbuf, "\n");
STRCAT(tbuf, mesg2);
}
# ifdef FEAT_GUI_MACVIM
if (default_reload_choice > 0)
{
if (default_reload_choice == 2)
reload = TRUE;
}
else
{
switch (do_dialog(VIM_WARNING, (char_u *)_("Warning"), tbuf,
(char_u *)_("&OK\n&Load File\nLoad &All\n&Ignore All"),
1, NULL))
{
case 3:
default_reload_choice = 2;
case 2:
reload = TRUE;
break;
case 4:
default_reload_choice = 1;
break;
}
}
# else
if (do_dialog(VIM_WARNING, (char_u *)_("Warning"), tbuf,
(char_u *)_("&OK\n&Load File"), 1, NULL) == 2)
reload = TRUE;
# endif
}
else
#endif
@@ -9113,7 +9146,7 @@ static int include_groups = FALSE;
set_context_in_autocmd(xp, arg, doautocmd)
expand_T *xp;
char_u *arg;
int doautocmd; /* TRUE for :doautocmd, FALSE for :autocmd */
int doautocmd; /* TRUE for :doauto*, FALSE for :autocmd */
{
char_u *p;
int group;
+3 -2
View File
@@ -660,11 +660,12 @@ main
#ifdef FEAT_VIMINFO
/*
* Read in registers, history etc, but not marks, from the viminfo file
* Read in registers, history etc, but not marks, from the viminfo file.
* This is where v:oldfiles gets filled.
*/
if (*p_viminfo != NUL)
{
read_viminfo(NULL, TRUE, FALSE, FALSE);
read_viminfo(NULL, VIF_WANT_INFO | VIF_GET_OLDFILES);
TIME_MSG("reading viminfo");
}
#endif
+24 -4
View File
@@ -1627,15 +1627,17 @@ write_one_mark(fp_out, c, pos)
/*
* Handle marks in the viminfo file:
* fp_out == NULL read marks for current buffer only
* fp_out != NULL copy marks for buffers not in buffer list
* fp_out != NULL: copy marks for buffers not in buffer list
* fp_out == NULL && (flags & VIF_WANT_MARKS): read marks for curbuf only
* fp_out == NULL && (flags & VIF_GET_OLDFILES | VIF_FORCEIT): fill v:oldfiles
*/
void
copy_viminfo_marks(virp, fp_out, count, eof)
copy_viminfo_marks(virp, fp_out, count, eof, flags)
vir_T *virp;
FILE *fp_out;
int count;
int eof;
int flags;
{
char_u *line = virp->vir_line;
buf_T *buf;
@@ -1647,10 +1649,23 @@ copy_viminfo_marks(virp, fp_out, count, eof)
char_u *p;
char_u *name_buf;
pos_T pos;
#ifdef FEAT_EVAL
list_T *list = NULL;
#endif
if ((name_buf = alloc(LSIZE)) == NULL)
return;
*name_buf = NUL;
#ifdef FEAT_EVAL
if (fp_out == NULL && (flags & (VIF_GET_OLDFILES | VIF_FORCEIT)))
{
list = list_alloc();
if (list != NULL)
set_vim_var_list(VV_OLDFILES, list);
}
#endif
num_marked_files = get_viminfo_parameter('\'');
while (!eof && (count < num_marked_files || fp_out == NULL))
{
@@ -1681,6 +1696,11 @@ copy_viminfo_marks(virp, fp_out, count, eof)
p++;
*p = NUL;
#ifdef FEAT_EVAL
if (list != NULL)
list_append_string(list, str, -1);
#endif
/*
* If fp_out == NULL, load marks for current buffer.
* If fp_out != NULL, copy marks for buffers not in buflist.
@@ -1688,7 +1708,7 @@ copy_viminfo_marks(virp, fp_out, count, eof)
load_marks = copy_marks_out = FALSE;
if (fp_out == NULL)
{
if (curbuf->b_ffname != NULL)
if ((flags & VIF_WANT_MARKS) && curbuf->b_ffname != NULL)
{
if (*name_buf == NUL) /* only need to do this once */
home_replace(NULL, curbuf->b_ffname, name_buf, LSIZE, TRUE);
+2 -2
View File
@@ -3245,9 +3245,9 @@ prompt_for_number(mouse_used)
/* When using ":silent" assume that <CR> was entered. */
if (mouse_used != NULL)
MSG_PUTS(_("Type number or click with mouse (<Enter> cancels): "));
MSG_PUTS(_("Type number and <Enter> or click with mouse (empty cancels): "));
else
MSG_PUTS(_("Choice number (<Enter> cancels): "));
MSG_PUTS(_("Type number and <Enter> (empty cancels): "));
/* Set the state such that text can be selected/copied/pasted and we still
* get mouse events. */
+17 -3
View File
@@ -183,6 +183,8 @@ static void nv_drop __ARGS((cmdarg_T *cap));
static void nv_cursorhold __ARGS((cmdarg_T *cap));
#endif
static char *e_noident = N_("E349: No identifier under cursor");
/*
* Function to be called for a Normal or Visual mode command.
* The argument is a cmdarg_T.
@@ -1132,7 +1134,8 @@ getcount:
out_flush();
#endif
#ifdef FEAT_AUTOCMD
did_cursorhold = FALSE;
if (ca.cmdchar != K_IGNORE)
did_cursorhold = FALSE;
#endif
State = NORMAL;
@@ -3511,7 +3514,7 @@ find_ident_at_pos(wp, lnum, startcol, string, find_type)
if (find_type & FIND_STRING)
EMSG(_("E348: No string under cursor"));
else
EMSG(_("E349: No identifier under cursor"));
EMSG(_(e_noident));
return 0;
}
ptr += col;
@@ -5490,8 +5493,17 @@ nv_ident(cap)
{
/* An external command will probably use an argument starting
* with "-" as an option. To avoid trouble we skip the "-". */
while (*ptr == '-')
while (*ptr == '-' && n > 0)
{
++ptr;
--n;
}
if (n == 0)
{
EMSG(_(e_noident)); /* found dashes only */
vim_free(buf);
return;
}
/* When a count is given, turn it into a range. Is this
* really what we want? */
@@ -5538,7 +5550,9 @@ nv_ident(cap)
if (cmdchar == 'K' && !kp_help)
{
/* Escape the argument properly for a shell command */
ptr = vim_strnsave(ptr, n);
p = vim_strsave_shellescape(ptr, TRUE);
vim_free(ptr);
if (p == NULL)
{
vim_free(buf);
+27 -3
View File
@@ -138,6 +138,9 @@
#define PV_ML OPT_BUF(BV_ML)
#define PV_MOD OPT_BUF(BV_MOD)
#define PV_MPS OPT_BUF(BV_MPS)
#ifdef FEAT_GUI_MACVIM
#define PV_MMTA OPT_BUF(BV_MMTA)
#endif
#define PV_NF OPT_BUF(BV_NF)
#ifdef FEAT_OSFILETYPE
# define PV_OFT OPT_BUF(BV_OFT)
@@ -322,6 +325,9 @@ static int p_lisp;
#endif
static int p_ml;
static int p_ma;
#ifdef FEAT_GUI_MACVIM
static int p_mmta;
#endif
static int p_mod;
static char_u *p_mps;
static char_u *p_nf;
@@ -1658,6 +1664,13 @@ static struct vimoption
(char_u *)&p_macatsui, PV_NONE,
{(char_u *)TRUE, (char_u *)0L}},
#endif
{"macmeta", "mmta", P_BOOL|P_VI_DEF,
#ifdef FEAT_GUI_MACVIM
(char_u *)&p_mmta, PV_MMTA,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)0L}},
{"magic", NULL, P_BOOL|P_VI_DEF,
(char_u *)&p_magic, PV_NONE,
{(char_u *)TRUE, (char_u *)0L}},
@@ -2618,13 +2631,13 @@ static struct vimoption
#ifdef FEAT_VIMINFO
(char_u *)&p_viminfo, PV_NONE,
#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
{(char_u *)"", (char_u *)"'20,<50,s10,h,rA:,rB:"}
{(char_u *)"", (char_u *)"'100,<50,s10,h,rA:,rB:"}
#else
# ifdef AMIGA
{(char_u *)"",
(char_u *)"'20,<50,s10,h,rdf0:,rdf1:,rdf2:"}
(char_u *)"'100,<50,s10,h,rdf0:,rdf1:,rdf2:"}
# else
{(char_u *)"", (char_u *)"'20,<50,s10,h"}
{(char_u *)"", (char_u *)"'100,<50,s10,h"}
# endif
#endif
#else
@@ -8089,6 +8102,11 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags)
else /* curwin->w_p_scr > curwin->w_height */
curwin->w_p_scr = curwin->w_height;
}
if (p_hi < 0)
{
errmsg = e_positive;
p_hi = 0;
}
if (p_report < 0)
{
errmsg = e_positive;
@@ -9235,6 +9253,9 @@ get_varp(p)
#endif
case PV_ML: return (char_u *)&(curbuf->b_p_ml);
case PV_MPS: return (char_u *)&(curbuf->b_p_mps);
#ifdef FEAT_GUI_MACVIM
case PV_MMTA: return (char_u *)&(curbuf->b_p_mmta);
#endif
case PV_MA: return (char_u *)&(curbuf->b_p_ma);
case PV_MOD: return (char_u *)&(curbuf->b_changed);
case PV_NF: return (char_u *)&(curbuf->b_p_nf);
@@ -9606,6 +9627,9 @@ buf_copy_options(buf, flags)
#ifdef FEAT_KEYMAP
buf->b_p_keymap = vim_strsave(p_keymap);
buf->b_kmap_state |= KEYMAP_INIT;
#endif
#ifdef FEAT_GUI_MACVIM
buf->b_p_mmta = p_mmta;
#endif
/* This isn't really an option, but copying the langmap and IME
* state from the current buffer is better than resetting it. */
+3
View File
@@ -981,6 +981,9 @@ enum
, BV_ML
, BV_MOD
, BV_MPS
#ifdef FEAT_GUI_MACVIM
, BV_MMTA
#endif
, BV_NF
#ifdef FEAT_OSFILETYPE
, BV_OFT
+6 -1
View File
@@ -17,7 +17,7 @@ void eval_patch __ARGS((char_u *origfile, char_u *difffile, char_u *outfile));
int eval_to_bool __ARGS((char_u *arg, int *error, char_u **nextcmd, int skip));
char_u *eval_to_string_skip __ARGS((char_u *arg, char_u **nextcmd, int skip));
int skip_expr __ARGS((char_u **pp));
char_u *eval_to_string __ARGS((char_u *arg, char_u **nextcmd, int dolist));
char_u *eval_to_string __ARGS((char_u *arg, char_u **nextcmd, int convert));
char_u *eval_to_string_safe __ARGS((char_u *arg, char_u **nextcmd, int use_sandbox));
int eval_to_number __ARGS((char_u *expr));
list_T *eval_spell_expr __ARGS((char_u *badword, char_u *expr));
@@ -46,7 +46,9 @@ list_T *list_alloc __ARGS((void));
void list_unref __ARGS((list_T *l));
void list_free __ARGS((list_T *l, int recurse));
dictitem_T *dict_lookup __ARGS((hashitem_T *hi));
char_u *list_find_str __ARGS((list_T *l, long idx));
int list_append_dict __ARGS((list_T *list, dict_T *dict));
int list_append_string __ARGS((list_T *l, char_u *str, int len));
int garbage_collect __ARGS((void));
dict_T *dict_alloc __ARGS((void));
int dict_add_nr_str __ARGS((dict_T *d, char *key, long nr, char_u *str));
@@ -58,8 +60,10 @@ long do_searchpair __ARGS((char_u *spat, char_u *mpat, char_u *epat, int dir, ch
void set_vim_var_nr __ARGS((int idx, long val));
long get_vim_var_nr __ARGS((int idx));
char_u *get_vim_var_str __ARGS((int idx));
list_T *get_vim_var_list __ARGS((int idx));
void set_vcount __ARGS((long count, long count1));
void set_vim_var_string __ARGS((int idx, char_u *val, int len));
void set_vim_var_list __ARGS((int idx, list_T *val));
void set_reg_var __ARGS((int c));
char_u *v_exception __ARGS((char_u *oldval));
char_u *v_throwpoint __ARGS((char_u *oldval));
@@ -94,6 +98,7 @@ int read_viminfo_varlist __ARGS((vir_T *virp, int writing));
void write_viminfo_varlist __ARGS((FILE *fp));
int store_session_globals __ARGS((FILE *fd));
void last_set_msg __ARGS((scid_T scriptID));
void ex_oldfiles __ARGS((exarg_T *eap));
int modify_fname __ARGS((char_u *src, int *usedlen, char_u **fnamep, char_u **bufp, int *fnamelen));
char_u *do_string_sub __ARGS((char_u *str, char_u *pat, char_u *sub, char_u *flags));
/* vim: set ft=c : */
+1 -1
View File
@@ -11,7 +11,7 @@ void do_shell __ARGS((char_u *cmd, int flags));
char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
void append_redir __ARGS((char_u *buf, char_u *opt, char_u *fname));
int viminfo_error __ARGS((char *errnum, char *message, char_u *line));
int read_viminfo __ARGS((char_u *file, int want_info, int want_marks, int forceit));
int read_viminfo __ARGS((char_u *file, int flags));
void write_viminfo __ARGS((char_u *file, int forceit));
int viminfo_readline __ARGS((vir_T *virp));
char_u *viminfo_readstring __ARGS((vir_T *virp, int off, int convert));
+1 -1
View File
@@ -26,5 +26,5 @@ int read_viminfo_filemark __ARGS((vir_T *virp, int force));
void write_viminfo_filemarks __ARGS((FILE *fp));
int removable __ARGS((char_u *name));
int write_viminfo_marks __ARGS((FILE *fp_out));
void copy_viminfo_marks __ARGS((vir_T *virp, FILE *fp_out, int count, int eof));
void copy_viminfo_marks __ARGS((vir_T *virp, FILE *fp_out, int count, int eof, int flags));
/* vim: set ft=c : */
+11 -3
View File
@@ -2439,9 +2439,17 @@ fold_line(wp, fold_count, foldinfo, lnum, row)
#ifdef FEAT_SYN_HL
/* Show 'cursorcolumn' in the fold line. */
if (wp->w_p_cuc && (int)wp->w_virtcol + txtcol < W_WIDTH(wp))
ScreenAttrs[off + wp->w_virtcol + txtcol] = hl_combine_attr(
ScreenAttrs[off + wp->w_virtcol + txtcol], hl_attr(HLF_CUC));
if (wp->w_p_cuc)
{
txtcol += wp->w_virtcol;
if (wp->w_p_wrap)
txtcol -= wp->w_skipcol;
else
txtcol -= wp->w_leftcol;
if (txtcol >= 0 && txtcol < W_WIDTH(wp))
ScreenAttrs[off + txtcol] = hl_combine_attr(
ScreenAttrs[off + txtcol], hl_attr(HLF_CUC));
}
#endif
SCREEN_LINE(row + W_WINROW(wp), W_WINCOL(wp), (int)W_WIDTH(wp),
+4 -1
View File
@@ -459,7 +459,7 @@ typedef struct expand
typedef struct
{
int hide; /* TRUE when ":hide" was used */
# ifdef FEAT_BROWSE
# ifdef FEAT_BROWSE_CMD
int browse; /* TRUE to invoke file dialog */
# endif
# ifdef FEAT_WINDOWS
@@ -1456,6 +1456,9 @@ struct file_buffer
char_u *b_p_dict; /* 'dictionary' local value */
char_u *b_p_tsr; /* 'thesaurus' local value */
#endif
#ifdef FEAT_GUI_MACVIM
int b_p_mmta; /* 'macmeta' local value */
#endif
/* end of buffer options */
+20
View File
@@ -691,6 +691,26 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
32,
/**/
31,
/**/
30,
/**/
29,
/**/
28,
/**/
27,
/**/
26,
/**/
25,
/**/
24,
/**/
23,
/**/
22,
/**/
+8 -1
View File
@@ -1731,7 +1731,8 @@ typedef int proftime_T; /* dummy for function prototypes */
#define VV_MOUSE_COL 51
#define VV_OP 52
#define VV_SEARCHFORWARD 53
#define VV_LEN 54 /* number of v: vars */
#define VV_OLDFILES 54
#define VV_LEN 55 /* number of v: vars */
#ifdef FEAT_CLIPBOARD
@@ -2057,4 +2058,10 @@ typedef int VimClipboard; /* This is required for the prototypes. */
#define DOSO_VIMRC 1 /* loading vimrc file */
#define DOSO_GVIMRC 2 /* loading gvimrc file */
/* flags for read_viminfo() and children */
#define VIF_WANT_INFO 1 /* load non-mark info */
#define VIF_WANT_MARKS 2 /* load file marks */
#define VIF_FORCEIT 4 /* overwrite info already read */
#define VIF_GET_OLDFILES 8 /* load v:oldfiles */
#endif /* VIM__H */