Compare commits

...

48 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
Bjorn Winckler ee1fd606dd Snapshot 36 2008-10-04 19:26:05 +02:00
Bjorn Winckler ac3900639d Update credits 2008-10-04 17:27:58 +02:00
Bjorn Winckler aa3ac2d303 Add Find & Replace dialog box 2008-10-04 17:25:07 +02:00
Bjorn Winckler e84420f7d1 Remove TODO 2008-10-03 16:26:33 +02:00
vimboss 678ceed917 updated for version 7.2-025 2008-10-02 20:55:54 +00:00
Bjorn Winckler f3c411fafe Add help on "modifier key as Esc" 2008-10-02 22:53:17 +02:00
vimboss 1506bb79d9 updated for version 7.2-024 2008-10-02 20:48:41 +00:00
Bjorn Winckler d366864ff5 Add preference to change fake Esc modifier key 2008-10-02 22:28:52 +02:00
vimboss 69742a596f updated for version 7.2-023 2008-10-02 16:04:05 +00:00
Bjorn Winckler 3d2d6a810e Modifier key sends Esc
Adds possibility to make the left Ctrl, Alt, or Cmd key function as a
second Esc key.  The key will still function as a modifier if held down
in conjunction with another key.  Enable by setting the user default
"MMFakeEscModifier" to:
    1 = Left Ctrl
    2 = Left Alt
    3 = Left Cmd
    any other number disables this functionality

By remapping Caps-Lock to one of the above modifier keys this enables
the use of Caps-Lock as a second (and easy to reach) Esc key.  Caps-Lock
can be remapped inside "System Preferences -> Keyboard & Mouse ->
Modifier Keys...".

The Esc event is sent when the modifier key is released.  If the key is
not released within a predefined timeout, then no Esc event is
generated.  The timeout can be changed by setting the user default
MMFakeEscTimeout (a float, specifying the timeout in seconds).

The fact that the Esc event is sent on release makes it feel somewhat
sluggish.  It is possible to have the event sent when the modifier key
is pressed by setting the user default "MMFakeEscOnKeyDown" but then the
left modifier key can only be used as an Esc key.
2008-09-30 22:06:30 +02:00
Jonathon Mah 6fb7a6f38b Added dragging to tab bar
Dragging a file to a tab will open it in that tab.
Dragging files to the end of the tab bar will open them in new tabs.
2008-09-30 02:09:17 +09:30
Jonathon Mah cf7a0a71bd Added tool tips for tabs when tab labels are truncated 2008-09-29 22:06:54 +09:30
Jonathon Mah 6e1e046cbb Fixed memory leak in -[MMAppController openFiles:withArguments:] 2008-09-29 21:20:28 +09:30
Bjorn Winckler 2d1fc65b0e Don't drop non-repeating keyboard input
Keyboard input is not dropped, unless the input was received due to a
key being automatically repeated (as a consequence of the key being held
down).  This way characters are never dropped while typing, but it also
avoids situations where the screen doesn't stop scrolling immediately
when "j" is released after being held.
2008-09-28 23:50:39 +02:00
Bjorn Winckler e378d7332b Add keyboard shortcuts to help file 2008-09-28 22:07:07 +02:00
58 changed files with 1524 additions and 458 deletions
+2 -2
View File
@@ -806,13 +806,13 @@ This replaces each 'E' character with a euro sign. Read more in |<Char->|.
:promptf[ind] [string]
Put up a Search dialog. When [string] is given, it is
used as the initial search string.
{only for Win32, Motif and GTK GUI}
{only for Win32, Motif, GTK and MacVim GUI}
*:promptr* *:promptrepl*
:promptr[epl] [string]
Put up a Search/Replace dialog. When [string] is
given, it is used as the initial search string.
{only for Win32, Motif and GTK GUI}
{only for Win32, Motif, GTK and MacVim GUI}
4.4 Changing tabs *change-tabs*
+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>,
+126 -45
View File
@@ -1,4 +1,4 @@
*gui_mac.txt* For Vim version 7.2. Last change: 2008 Jul 12
*gui_mac.txt* For Vim version 7.2. Last change: 2008 Oct 25
VIM REFERENCE MANUAL by Bjorn Winckler
@@ -16,8 +16,9 @@ The MacVim Graphical User Interface *macvim* *gui-macvim*
7. Dialogs |macvim-dialogs|
8. System services |macvim-services|
9. mvim:// URL handler |macvim-url-handler|
10. Known bugs/missing features |macvim-todo|
11. Hints |macvim-hints|
10. Keyboard shortcuts |macvim-shortcuts|
11. Known bugs/missing features |macvim-todo|
12. Hints |macvim-hints|
Other relevant documentation:
|gui.txt| For generic items of the GUI.
@@ -76,16 +77,6 @@ file at all. In this situation, you will need to set both 'encoding' and
'fileencodings' to a simple single-byte encoding such as Latin1 so that when
the file is read into memory, the original bytes are left untouched.
*macvim-movement*
Some Mac OS X standard key mappings involving Cmd or Option and an arrow key
are set up by default in "$VIM/gvimrc". You can quickly disable all of these
by adding the following lines to your "~/.vimrc" (not .gvimrc) file: >
if has("gui_macvim")
let macvim_skip_cmd_opt_movement = 1
endif
Note: These are the only key mappings that MacVim makes (not counting menu key
equivalents which are not set up with :map).
*macvim-shift-movement*
Text editors on Mac OS X lets the user hold down shift+movement key to extend
the selection. Also, pressing a printable key whilst selecting replaces the
@@ -180,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
@@ -195,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.
@@ -386,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
@@ -412,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
@@ -503,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
@@ -520,28 +532,86 @@ 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.
==============================================================================
10. Known bugs/missing features *macvim-todo*
10. Keyboard shortcuts *macvim-shortcuts*
Here are some of the bigger bugs in MacVim. Of course there are others, but
these are ones that are know and/or which were judged major.
Most keyboard shortcuts in MacVim are bound to menu items and can be
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
hence be used instead of Esc to exit insert mode (in
case you find Esc a bit hard to reach).
*Cmd-`* *<D-`>*
Cmd-` Cycle to the next window. On an American keyboard the
`-key is located under the Esc-key. On European
keyboards this key is often adjacent to the left
Shift-key and it may be not even be marked with "`".
*Cmd-Left* *<D-Left>*
Cmd-Left Move cursor to the beginning of the line
(see |cmd-movement|).
*Cmd-Right* *<D-Right>*
Cmd-Right Move cursor to the end of the line (see |cmd-movement|).
*Cmd-Up* *<D-Up>*
Cmd-Up Move cursor to the first line (see |cmd-movement|).
*Cmd-Down* *<D-Down>*
Cmd-Down Move cursor to the last line (see |cmd-movement|).
*Alt-Left* *<M-Left>*
Alt-Left Move cursor to the beginning of the previous word
(see |alt-movement|).
*Alt-Right* *<M-Right>*
Alt-Right Move cursor to the beginning of the next word
(see |alt-movement|).
*Alt-Up* *<M-Up>*
Alt-Up Move cursor one paragraph forward (see |alt-movement|).
*Alt-Down* *<M-Down>*
Alt-Down Move cursor to the previous paragraph
(see |alt-movement|).
*cmd-movement* *alt-movement*
The above mappings involving Cmd/Alt + arrow key are enabled by default in the
system gvimrc file "$VIM/gvimrc". You can quickly disable all of these by
adding the following lines to your "~/.vimrc" (not .gvimrc) file: >
if has("gui_macvim")
let macvim_skip_cmd_opt_movement = 1
endif
Note: These are the only key mappings that MacVim makes (not counting menu key
equivalents which are not set up with :map).
See |macvim-shift-movement| if you want Shift to select text when used in
conjunction with the above Cmd/Alt movement shortcuts.
==============================================================================
11. Known bugs/missing features *macvim-todo*
This list is by no means exhaustive, it only enumerates some of the more
prominent bugs/missing features.
- Localized menus are not supported. Choosing anything but "English" in the
"International" pane of "System Prefences" may break the menus (and
@@ -552,7 +622,7 @@ these are ones that are know and/or which were judged major.
automatic font substitution by setting 'guifontwide' manually.
- Printing. As a temporary solution <D-p> creates a PostScript file which is
then opened in Preview where it may be printed.
- No find/replace dialog
- The toolbar looks ugly and is not very useful.
If you find new bugs then add a new issue at http://code.google.com/p/macvim/
or post your findings to the |vim_mac| mailing list. If you are missing
@@ -561,7 +631,7 @@ might be simple to implement, but unless somebody asks for a particular
feature then there is little incentive to add it.
==============================================================================
11. Hints *macvim-hints*
12. Hints *macvim-hints*
In this section some general (not necessarily MacVim specific) hints are
given.
@@ -595,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.
@@ -652,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 -1
View File
@@ -1,4 +1,4 @@
{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf330
{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf350
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\vieww9000\viewh8400\viewkind0
@@ -30,6 +30,7 @@ Kyle Lippincott\
Matt Tolton\
Kaoru Yoshida\
Ron Olson\
Jonathon Mah\
\i0 \
...and many others who have helped by reporting bugs etc.\
+87
View File
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBClasses</key>
<array>
<dict>
<key>CLASS</key>
<string>RBSplitView</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>OUTLETS</key>
<dict>
<key>delegate</key>
<string>id</string>
</dict>
<key>SUPERCLASS</key>
<string>RBSplitSubview</string>
</dict>
<dict>
<key>CLASS</key>
<string>RBSplitSubview</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSView</string>
</dict>
<dict>
<key>ACTIONS</key>
<dict>
<key>findAndReplace</key>
<string>id</string>
</dict>
<key>CLASS</key>
<string>FirstResponder</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSObject</string>
</dict>
<dict>
<key>CLASS</key>
<string>NSMenu</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSObject</string>
</dict>
<dict>
<key>ACTIONS</key>
<dict>
<key>didAdjustSubviews</key>
<string>RBSplitView</string>
<key>willAdjustSubviews</key>
<string>RBSplitView</string>
</dict>
<key>CLASS</key>
<string>NSObject</string>
<key>LANGUAGE</key>
<string>ObjC</string>
</dict>
<dict>
<key>CLASS</key>
<string>MMFindReplaceController</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>OUTLETS</key>
<dict>
<key>backwardButton</key>
<string>NSButton</string>
<key>findBox</key>
<string>NSTextField</string>
<key>ignoreCaseButton</key>
<string>NSButton</string>
<key>matchWordButton</key>
<string>NSButton</string>
<key>replaceBox</key>
<string>NSTextField</string>
</dict>
<key>SUPERCLASS</key>
<string>NSWindowController</string>
</dict>
</array>
<key>IBVersion</key>
<string>1</string>
</dict>
</plist>
+20
View File
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBFramework Version</key>
<string>629</string>
<key>IBLastKnownRelativeProjectPath</key>
<string>../MacVim.xcodeproj</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>7</integer>
</array>
<key>IBSystem Version</key>
<string>9F33</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
</plist>
Binary file not shown.
+3 -1
View File
@@ -558,7 +558,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>35</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>
+13 -7
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,
@@ -231,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",
@@ -638,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
@@ -646,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]) {
@@ -761,7 +767,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
// arguments for each launching process can be looked up by its PID (in the
// pidArguments dictionary).
NSMutableDictionary *arguments = (args ? [args mutableCopy]
NSMutableDictionary *arguments = (args ? [[args mutableCopy] autorelease]
: [NSMutableDictionary dictionary]);
//
+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);
+130 -42
View File
@@ -91,7 +91,7 @@ static NSString *MMSymlinkWarningString =
- (void)processInputQueue;
- (void)handleInputEvent:(int)msgid data:(NSData *)data;
+ (NSDictionary *)specialKeys;
- (void)handleInsertText:(NSData *)data;
- (void)handleInsertText:(NSString *)text;
- (void)handleKeyDown:(NSString *)key modifiers:(int)mods;
- (void)queueMessage:(int)msgid data:(NSData *)data;
- (void)connectionDidDie:(NSNotification *)notification;
@@ -109,6 +109,7 @@ static NSString *MMSymlinkWarningString =
- (void)addInput:(NSString *)input;
- (BOOL)unusedEditor;
- (void)redrawScreen;
- (void)handleFindReplace:(NSDictionary *)args;
@end
@@ -1048,11 +1049,16 @@ static NSString *MMSymlinkWarningString =
BOOL interrupt = NO;
if (msgid == InterruptMsgID) {
interrupt = YES;
} else if (InsertTextMsgID == msgid && data != nil && [data length] == 1) {
char_u *str = (char_u*)[data bytes];
if ((str[0] == Ctrl_C && ctrl_c_interrupts) ||
(str[0] == intr_char && intr_char != Ctrl_C))
interrupt = YES;
} else if (InsertTextMsgID == msgid && data != nil) {
const void *bytes = [data bytes];
bytes += sizeof(int);
int len = *((int*)bytes); bytes += sizeof(int);
if (1 == len) {
char_u *str = (char_u*)bytes;
if ((str[0] == Ctrl_C && ctrl_c_interrupts) ||
(str[0] == intr_char && intr_char != Ctrl_C))
interrupt = YES;
}
}
if (interrupt) {
@@ -1063,18 +1069,36 @@ static NSString *MMSymlinkWarningString =
// Remove all previous instances of this message from the input queue, else
// the input queue may fill up as a result of Vim not being able to keep up
// with the speed at which new messages are received. This avoids annoying
// situations such as when the keyboard repeat rate is higher than what Vim
// can cope with (which would cause a 'stutter' when scrolling by holding
// down 'j' and then when 'j' was released the screen kept scrolling for a
// little while).
// with the speed at which new messages are received.
// Keyboard input is never dropped, unless the input represents and
// auto-repeated key.
int i, count = [inputQueue count];
for (i = 1; i < count; i+=2) {
if ([[inputQueue objectAtIndex:i-1] intValue] == msgid) {
[inputQueue removeObjectAtIndex:i];
[inputQueue removeObjectAtIndex:i-1];
break;
BOOL isKeyRepeat = NO;
BOOL isKeyboardInput = NO;
if (data && (InsertTextMsgID == msgid || KeyDownMsgID == msgid ||
CmdKeyMsgID == msgid)) {
isKeyboardInput = YES;
// The lowest bit of the first int is set if this key is a repeat.
int flags = *((int*)[data bytes]);
if (flags & 1)
isKeyRepeat = YES;
}
// Keyboard input is not removed from the queue; repeats are ignored if
// there already is keyboard input on the input queue.
if (isKeyRepeat || !isKeyboardInput) {
int i, count = [inputQueue count];
for (i = 1; i < count; i+=2) {
if ([[inputQueue objectAtIndex:i-1] intValue] == msgid) {
if (isKeyRepeat)
return;
[inputQueue removeObjectAtIndex:i];
[inputQueue removeObjectAtIndex:i-1];
break;
}
}
}
@@ -1497,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.
@@ -1539,18 +1566,21 @@ static NSString *MMSymlinkWarningString =
- (void)handleInputEvent:(int)msgid data:(NSData *)data
{
if (InsertTextMsgID == msgid) {
[self handleInsertText:data];
} else if (KeyDownMsgID == msgid || CmdKeyMsgID == msgid) {
if (InsertTextMsgID == msgid || KeyDownMsgID == msgid ||
CmdKeyMsgID == msgid) {
if (!data) return;
const void *bytes = [data bytes];
int mods = *((int*)bytes); bytes += sizeof(int);
int len = *((int*)bytes); bytes += sizeof(int);
NSString *key = [[NSString alloc] initWithBytes:bytes length:len
encoding:NSUTF8StringEncoding];
NSString *key = [[NSString alloc] initWithBytes:bytes
length:len
encoding:NSUTF8StringEncoding];
mods = eventModifierFlagsToVimModMask(mods);
[self handleKeyDown:key modifiers:mods];
if (InsertTextMsgID == msgid)
[self handleInsertText:key];
else
[self handleKeyDown:key modifiers:mods];
[key release];
} else if (ScrollWheelMsgID == msgid) {
@@ -1668,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);
@@ -1713,6 +1748,8 @@ static NSString *MMSymlinkWarningString =
[self handleXcodeMod:data];
} else if (OpenWithArgumentsMsgID == msgid) {
[self handleOpenWithArguments:[NSDictionary dictionaryWithData:data]];
} else if (FindReplaceMsgID == msgid) {
[self handleFindReplace:[NSDictionary dictionaryWithData:data]];
} else {
NSLog(@"WARNING: Unknown message received (msgid=%d)", msgid);
}
@@ -1732,14 +1769,12 @@ static NSString *MMSymlinkWarningString =
return specialKeys;
}
- (void)handleInsertText:(NSData *)data
- (void)handleInsertText:(NSString *)text
{
if (!data) return;
if (!text) return;
NSString *key = [[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding];
char_u *str = (char_u*)[key UTF8String];
int i, len = [key lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
char_u *str = (char_u*)[text UTF8String];
int i, len = [text lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
#ifdef FEAT_MBYTE
char_u *conv_str = NULL;
@@ -1765,11 +1800,11 @@ static NSString *MMSymlinkWarningString =
if (conv_str)
vim_free(conv_str);
#endif
[key release];
}
- (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];
@@ -1832,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);
@@ -1849,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);
@@ -2486,6 +2556,24 @@ static NSString *MMSymlinkWarningString =
redrawcmdline();
}
- (void)handleFindReplace:(NSDictionary *)args
{
if (!args) return;
NSString *findString = [args objectForKey:@"find"];
if (!findString) return;
char_u *find = [findString vimStringSave];
char_u *replace = [[args objectForKey:@"replace"] vimStringSave];
int flags = [[args objectForKey:@"flags"] intValue];
// NOTE: The flag 0x100 is used to indicate a backward search.
gui_do_findrepl(flags, find, replace, (flags & 0x100) == 0);
vim_free(find);
vim_free(replace);
}
@end // MMBackend (Private)
+29
View File
@@ -0,0 +1,29 @@
/* vi:set ts=8 sts=4 sw=4 ft=objc:
*
* VIM - Vi IMproved by Bram Moolenaar
* MacVim GUI port by Bjorn Winckler
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
#import <Cocoa/Cocoa.h>
@interface MMFindReplaceController : NSWindowController {
IBOutlet NSTextField *findBox;
IBOutlet NSTextField *replaceBox;
IBOutlet NSButton *ignoreCaseButton;
IBOutlet NSButton *matchWordButton;
}
+ (MMFindReplaceController *)sharedInstance;
- (void)showWithText:(NSString *)text flags:(int)flags;
- (NSString *)findString;
- (NSString *)replaceString;
- (BOOL)ignoreCase;
- (BOOL)matchWord;
@end
+63
View File
@@ -0,0 +1,63 @@
/* vi:set ts=8 sts=4 sw=4 ft=objc:
*
* VIM - Vi IMproved by Bram Moolenaar
* MacVim GUI port by Bjorn Winckler
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
#import "MMFindReplaceController.h"
@implementation MMFindReplaceController
+ (MMFindReplaceController *)sharedInstance
{
static MMFindReplaceController *singleton = nil;
if (!singleton) {
singleton = [[MMFindReplaceController alloc]
initWithWindowNibName:@"FindAndReplace"];
[singleton setWindowFrameAutosaveName:@"FindAndReplace"];
}
return singleton;
}
- (void)showWithText:(NSString *)text flags:(int)flags
{
// Ensure that the window has been loaded by calling this first.
NSWindow *window = [self window];
if (text && [text length] > 0)
[findBox setStringValue:text];
// NOTE: The 'flags' values must match the FRD_ defines in gui.h.
[matchWordButton setState:(flags & 0x08 ? NSOnState : NSOffState)];
[ignoreCaseButton setState:(flags & 0x10 ? NSOffState : NSOnState)];
[window makeKeyAndOrderFront:self];
}
- (NSString *)findString
{
return [findBox stringValue];
}
- (NSString *)replaceString
{
return [replaceBox stringValue];
}
- (BOOL)ignoreCase
{
return [ignoreCaseButton state] == NSOnState;
}
- (BOOL)matchWord
{
return [matchWordButton state] == NSOnState;
}
@end // MMFindReplaceController
+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);
+39 -6
View File
@@ -38,7 +38,8 @@ static float MMDragAreaSize = 73.0f;
- (MMWindowController *)windowController;
- (MMVimController *)vimController;
- (void)dispatchKeyEvent:(NSEvent *)event;
- (void)sendKeyDown:(const char *)chars length:(int)len modifiers:(int)flags;
- (void)sendKeyDown:(const char *)chars length:(int)len modifiers:(int)flags
isARepeat:(BOOL)isARepeat;
- (void)hideMouseCursor;
- (void)startDragTimerWithInterval:(NSTimeInterval)t;
- (void)dragTimerFired:(NSTimer *)timer;
@@ -110,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]];
}
@@ -157,8 +169,17 @@ static float MMDragAreaSize = 73.0f;
//NSLog(@"send InsertTextMsgID: %@", string);
[[self vimController] sendMessage:InsertTextMsgID
data:[string dataUsingEncoding:NSUTF8StringEncoding]];
NSMutableData *data = [NSMutableData data];
int len = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
int flags = [event modifierFlags] & 0xffff0000U;
if ([event type] == NSKeyDown && [event isARepeat])
flags |= 1;
[data appendBytes:&flags length:sizeof(int)];
[data appendBytes:&len length:sizeof(int)];
[data appendBytes:[string UTF8String] length:len];
[[self vimController] sendMessage:InsertTextMsgID data:data];
}
- (void)doCommandBySelector:(SEL)selector
@@ -193,7 +214,8 @@ static float MMDragAreaSize = 73.0f;
chars = MMKeypadEnter;
}
[self sendKeyDown:chars length:len modifiers:[event modifierFlags]];
[self sendKeyDown:chars length:len modifiers:[event modifierFlags]
isARepeat:[event isARepeat]];
} else {
[self dispatchKeyEvent:event];
}
@@ -214,7 +236,7 @@ static float MMDragAreaSize = 73.0f;
// stroke (some input methods use e.g. arrow keys). The function key down
// event will still reach Vim though (via keyDown:). The exceptions to
// this rule are: PageUp/PageDown (keycode 116/121).
int flags = [event modifierFlags];
int flags = [event modifierFlags] & 0xffff0000U;
if ([event type] != NSKeyDown || flags & NSFunctionKeyMask
&& !(116 == [event keyCode] || 121 == [event keyCode]))
return NO;
@@ -272,6 +294,9 @@ static float MMDragAreaSize = 73.0f;
len = [unmodchars lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
}
if ([event isARepeat])
flags |= 1;
[data appendBytes:&flags length:sizeof(int)];
[data appendBytes:&len length:sizeof(int)];
[data appendBytes:[unmodchars UTF8String] length:len];
@@ -748,14 +773,22 @@ static float MMDragAreaSize = 73.0f;
bytes = [chars UTF8String];
}
[self sendKeyDown:bytes length:len modifiers:mods];
[self sendKeyDown:bytes length:len modifiers:mods
isARepeat:[event isARepeat]];
}
- (void)sendKeyDown:(const char *)chars length:(int)len modifiers:(int)flags
isARepeat:(BOOL)isARepeat
{
if (chars && len > 0) {
NSMutableData *data = [NSMutableData data];
// The low 16 bits are not used for modifier flags by NSEvent. Use
// these bits for custom flags.
flags &= 0xffff0000;
if (isARepeat)
flags |= 1;
[data appendBytes:&flags length:sizeof(int)];
[data appendBytes:&len length:sizeof(int)];
[data appendBytes:chars length:len];
+2
View File
@@ -55,6 +55,8 @@
- (NSDate *)creationDate;
- (void)cleanup;
- (void)dropFiles:(NSArray *)filenames forceOpen:(BOOL)force;
- (void)file:(NSString *)filename draggedToTabAtIndex:(NSUInteger)tabIndex;
- (void)filesDraggedToTabBar:(NSArray *)filenames;
- (void)dropString:(NSString *)string;
- (void)passArguments:(NSDictionary *)args;
- (void)sendMessage:(int)msgid data:(NSData *)data;
+51 -11
View File
@@ -18,13 +18,14 @@
*
* 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.
*/
#import "MMAppController.h"
#import "MMAtsuiTextView.h"
#import "MMFindReplaceController.h"
#import "MMTextView.h"
#import "MMVimController.h"
#import "MMVimView.h"
@@ -255,6 +256,29 @@ static BOOL isUnsafeMessage(int msgid);
[self sendMessage:DropFilesMsgID data:[args dictionaryAsData]];
}
- (void)file:(NSString *)filename draggedToTabAtIndex:(NSUInteger)tabIndex
{
NSString *fnEsc = [filename stringByEscapingSpecialFilenameCharacters];
NSString *input = [NSString stringWithFormat:@"<C-\\><C-N>:silent "
"tabnext %d |"
"edit! %@<CR>", tabIndex + 1, fnEsc];
[self addVimInput:input];
}
- (void)filesDraggedToTabBar:(NSArray *)filenames
{
NSUInteger i, count = [filenames count];
NSMutableString *input = [NSMutableString stringWithString:@"<C-\\><C-N>"
":silent! tabnext 9999"];
for (i = 0; i < count; i++) {
NSString *fn = [filenames objectAtIndex:i];
NSString *fnEsc = [fn stringByEscapingSpecialFilenameCharacters];
[input appendFormat:@"|tabedit %@", fnEsc];
}
[input appendString:@"<CR>"];
[self addVimInput:input];
}
- (void)dropString:(NSString *)string
{
int len = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 1;
@@ -575,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];
@@ -587,7 +618,6 @@ static BOOL isUnsafeMessage(int msgid);
[sendQueue removeAllObjects];
}
[windowController processCommandQueueDidFinish];
[receiveQueue removeAllObjects];
inProcessCommandQueue = NO;
}
@@ -643,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
@@ -712,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);
@@ -928,6 +961,13 @@ static BOOL isUnsafeMessage(int msgid);
NSColor *color = [NSColor colorWithRgbInt:*bg];
[windowController setFullscreenBackgroundColor:color];
} else if (ShowFindReplaceDialogMsgID == msgid) {
NSDictionary *dict = [NSDictionary dictionaryWithData:data];
if (dict) {
[[MMFindReplaceController sharedInstance]
showWithText:[dict objectForKey:@"text"]
flags:[[dict objectForKey:@"flags"] intValue]];
}
// IMPORTANT: When adding a new message, make sure to update
// isUnsafeMessage() if necessary!
} else {
+57
View File
@@ -22,6 +22,7 @@
#import "MMTextView.h"
#import "MMVimController.h"
#import "MMVimView.h"
#import "MMWindowController.h"
#import "Miscellaneous.h"
#import <PSMTabBarControl.h>
@@ -132,6 +133,8 @@ enum {
[[tabBarControl addTabButton] setTarget:self];
[[tabBarControl addTabButton] setAction:@selector(addNewTab:)];
[tabBarControl setAllowsDragBetweenWindows:NO];
[tabBarControl registerForDraggedTypes:
[NSArray arrayWithObject:NSFilenamesPboardType]];
[tabBarControl setAutoresizingMask:NSViewWidthSizable|NSViewMinYMargin];
@@ -498,6 +501,40 @@ enum {
[vimController sendMessage:DraggedTabMsgID data:data];
}
- (NSDragOperation)tabBarControl:(PSMTabBarControl *)theTabBarControl
draggingEntered:(id <NSDraggingInfo>)sender
forTabAtIndex:(unsigned)tabIndex
{
NSPasteboard *pb = [sender draggingPasteboard];
return [[pb types] containsObject:NSFilenamesPboardType]
? NSDragOperationCopy
: NSDragOperationNone;
}
- (BOOL)tabBarControl:(PSMTabBarControl *)theTabBarControl
performDragOperation:(id <NSDraggingInfo>)sender
forTabAtIndex:(unsigned)tabIndex
{
NSPasteboard *pb = [sender draggingPasteboard];
if ([[pb types] containsObject:NSFilenamesPboardType]) {
NSArray *filenames = [pb propertyListForType:NSFilenamesPboardType];
if ([filenames count] == 0)
return NO;
if (tabIndex != NSNotFound) {
// If dropping on a specific tab, only open one file
[vimController file:[filenames objectAtIndex:0]
draggedToTabAtIndex:tabIndex];
} else {
// Files were dropped on empty part of tab bar; open them all
[vimController filesDraggedToTabBar:filenames];
}
return YES;
} else {
return NO;
}
}
// -- NSView customization ---------------------------------------------------
@@ -873,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
+4 -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;
@@ -75,5 +77,6 @@
- (IBAction)vimToolbarItemAction:(id)sender;
- (IBAction)fontSizeUp:(id)sender;
- (IBAction)fontSizeDown:(id)sender;
- (IBAction)findAndReplace:(id)sender;
@end
+144 -20
View File
@@ -57,6 +57,7 @@
#import "MMAppController.h"
#import "MMAtsuiTextView.h"
#import "MMFindReplaceController.h"
#import "MMFullscreenWindow.h"
#import "MMTextView.h"
#import "MMTypesetter.h"
@@ -71,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;
@@ -270,7 +273,8 @@
setupDone = YES;
[self updateResizeConstraints];
[self resizeWindowToFitContentSize:[vimView desiredSize]];
[self resizeWindowToFitContentSize:[vimView desiredSize]
keepOnScreen:YES];
}
- (void)showWindow
@@ -294,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
@@ -309,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
@@ -431,8 +442,11 @@
[[fullscreenWindow contentView] setNeedsDisplay:YES];
[fullscreenWindow centerView];
} else {
[self resizeWindowToFitContentSize:contentSize];
[self resizeWindowToFitContentSize:contentSize
keepOnScreen:keepOnScreen];
}
keepOnScreen = NO;
}
}
@@ -499,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
@@ -532,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.
@@ -660,6 +692,34 @@
[NSNumber numberWithInt:NSSizeDownFontAction]];
}
- (IBAction)findAndReplace:(id)sender
{
int tag = [sender tag];
MMFindReplaceController *fr = [MMFindReplaceController sharedInstance];
int flags = 0;
// NOTE: The 'flags' values must match the FRD_ defines in gui.h (except
// for 0x100 which we use to indicate a backward search).
switch (tag) {
case 1: flags = 0x100; break;
case 2: flags = 3; break;
case 3: flags = 4; break;
}
if ([fr matchWord])
flags |= 0x08;
if (![fr ignoreCase])
flags |= 0x10;
NSDictionary *args = [NSDictionary dictionaryWithObjectsAndKeys:
[fr findString], @"find",
[fr replaceString], @"replace",
[NSNumber numberWithInt:flags], @"flags",
nil];
[vimController sendMessage:FindReplaceMsgID data:[args dictionaryAsData]];
}
- (BOOL)validateMenuItem:(NSMenuItem *)item
{
if ([item action] == @selector(vimMenuItemAction:)
@@ -707,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;
@@ -733,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];
@@ -740,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;
}
@@ -777,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
@@ -793,6 +880,7 @@
}
- (void)resizeWindowToFitContentSize:(NSSize)contentSize
keepOnScreen:(BOOL)onScreen
{
NSRect frame = [decoratedWindow frame];
NSRect contentRect = [decoratedWindow contentRectForFrameRect:frame];
@@ -801,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
@@ -818,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;
+4 -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,
@@ -175,6 +176,8 @@ enum {
CloseWindowMsgID,
InterruptMsgID,
SetFullscreenColorMsgID,
ShowFindReplaceDialogMsgID,
FindReplaceMsgID,
};
+4 -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",
@@ -82,6 +83,8 @@ char *MessageStrings[] =
"CloseWindowMsgID",
"InterruptMsgID",
"SetFullscreenColorMsgID",
"ShowFindReplaceDialogMsgID",
"FindReplaceMsgID",
};
+17 -7
View File
@@ -30,6 +30,8 @@
1D3D19140CA690FF0004A0A5 /* DejaVuSansMono.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1D3D19100CA690FF0004A0A5 /* DejaVuSansMono.ttf */; };
1D493D580C5247BF00AB718C /* Vim in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1D493D570C5247BF00AB718C /* Vim */; };
1D493DBA0C52534300AB718C /* PSMTabBarControl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */; };
1D6008830E96886D003763F0 /* FindAndReplace.nib in Resources */ = {isa = PBXBuildFile; fileRef = 1D6008820E96886D003763F0 /* FindAndReplace.nib */; };
1D60088B0E96A0B2003763F0 /* MMFindReplaceController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */; };
1D71ACB40BC702AB002F2B60 /* doc-bm-c.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1D71ACA90BC702AB002F2B60 /* doc-bm-c.icns */; };
1D71ACB50BC702AC002F2B60 /* doc-bm-h.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1D71ACAA0BC702AB002F2B60 /* doc-bm-h.icns */; };
1D71ACB60BC702AC002F2B60 /* doc-bm-html.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1D71ACAB0BC702AB002F2B60 /* doc-bm-html.icns */; };
@@ -188,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>"; };
@@ -210,6 +212,9 @@
1D3D19100CA690FF0004A0A5 /* DejaVuSansMono.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = DejaVuSansMono.ttf; path = "dejavu-ttf/DejaVuSansMono.ttf"; sourceTree = "<group>"; };
1D493D570C5247BF00AB718C /* Vim */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = Vim; path = ../Vim; sourceTree = SOURCE_ROOT; };
1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PSMTabBarControl.xcodeproj; path = PSMTabBarControl/PSMTabBarControl.xcodeproj; sourceTree = "<group>"; };
1D6008820E96886D003763F0 /* FindAndReplace.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = FindAndReplace.nib; sourceTree = "<group>"; };
1D6008890E96A0B2003763F0 /* MMFindReplaceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMFindReplaceController.h; sourceTree = "<group>"; };
1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMFindReplaceController.m; sourceTree = "<group>"; };
1D71ACA90BC702AB002F2B60 /* doc-bm-c.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "doc-bm-c.icns"; sourceTree = "<group>"; };
1D71ACAA0BC702AB002F2B60 /* doc-bm-h.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "doc-bm-h.icns"; sourceTree = "<group>"; };
1D71ACAB0BC702AB002F2B60 /* doc-bm-html.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "doc-bm-html.icns"; sourceTree = "<group>"; };
@@ -258,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>"; };
@@ -328,6 +333,8 @@
080E96DDFE201D6D7F000001 /* MacVim Source */ = {
isa = PBXGroup;
children = (
1D6008890E96A0B2003763F0 /* MMFindReplaceController.h */,
1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */,
1D145C7D0E5227CE00691AA0 /* MMTextViewHelper.h */,
1D145C7E0E5227CE00691AA0 /* MMTextViewHelper.m */,
1D8059220E118663001699D1 /* Miscellaneous.h */,
@@ -510,6 +517,7 @@
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
1D6008820E96886D003763F0 /* FindAndReplace.nib */,
1D22374A0E45DF4800E6FFFF /* Advanced.png */,
BD9DF09F0DB2BA020025C97C /* PlugInView.nib */,
1DD3D51D0D82D4C9006E4320 /* ibeam.png */,
@@ -668,6 +676,7 @@
1DCD00D10E50B2B700460166 /* SaveSesn.png in Resources */,
1DCD00D20E50B2B700460166 /* TagJump.png in Resources */,
1DCD00D30E50B2B700460166 /* Undo.png in Resources */,
1D6008830E96886D003763F0 /* FindAndReplace.nib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -702,6 +711,7 @@
BD9DF0B00DB41E780025C97C /* PlugInGUI.m in Sources */,
BD9DF0FB0DB48C860025C97C /* CTGradient.m in Sources */,
1D145C7F0E5227CE00691AA0 /* MMTextViewHelper.m in Sources */,
1D60088B0E96A0B2003763F0 /* MMFindReplaceController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -756,7 +766,7 @@
i386,
);
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 35;
CURRENT_PROJECT_VERSION = 37;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
@@ -797,7 +807,7 @@
buildSettings = {
ARCHS = "$(NATIVE_ARCH)";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 35;
CURRENT_PROJECT_VERSION = 37;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
@@ -829,7 +839,7 @@
buildSettings = {
ARCHS = "$(NATIVE_ARCH)";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 35;
CURRENT_PROJECT_VERSION = 37;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
@@ -68,7 +68,9 @@ enum {
// drag and drop
NSEvent *_lastMouseDownEvent; // keep this for dragging reference
BOOL _allowsDragBetweenWindows;
BOOL _allowsDragBetweenWindows;
BOOL _delegateHandlingDrag;
NSDragOperation _delegateInitialDragOperation;
// MVC help
IBOutlet id delegate;
@@ -121,4 +123,11 @@ enum {
- (void)tabView:(NSTabView *)aTabView willCloseTabViewItem:(NSTabViewItem *)tabViewItem;
- (void)tabView:(NSTabView *)aTabView didCloseTabViewItem:(NSTabViewItem *)tabViewItem;
- (void)tabView:(NSTabView *)aTabView didDragTabViewItem:(NSTabViewItem *)tabViewItem toIndex:(int)idx;
- (NSDragOperation)tabBarControl:(PSMTabBarControl *)theTabBarControl draggingEntered:(id <NSDraggingInfo>)sender forTabAtIndex:(unsigned)tabIndex;
- (NSDragOperation)tabBarControl:(PSMTabBarControl *)theTabBarControl draggingUpdated:(id <NSDraggingInfo>)sender forTabAtIndex:(unsigned)tabIndex;
- (void)tabBarControl:(PSMTabBarControl *)theTabBarControl draggingExited:(id <NSDraggingInfo>)sender forTabAtIndex:(unsigned)tabIndex;
- (BOOL)tabBarControl:(PSMTabBarControl *)theTabBarControl prepareForDragOperation:(id <NSDraggingInfo>)sender forTabAtIndex:(unsigned)tabIndex;
- (BOOL)tabBarControl:(PSMTabBarControl *)theTabBarControl performDragOperation:(id <NSDraggingInfo>)sender forTabAtIndex:(unsigned)tabIndex;
- (void)tabBarControl:(PSMTabBarControl *)theTabBarControl concludeDragOperation:(id <NSDraggingInfo>)sender forTabAtIndex:(unsigned)tabIndex;
@end
@@ -57,6 +57,8 @@
// convenience
- (id)cellForPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame;
- (unsigned)indexOfCellAtPoint:(NSPoint)point;
- (unsigned)indexOfCellAtPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame;
- (PSMTabBarCell *)lastVisibleTab;
- (int)numberOfVisibleTabs;
@@ -98,6 +100,7 @@
// default config
_allowsDragBetweenWindows = YES;
_delegateHandlingDrag = NO;
_canCloseOnlyTab = NO;
_showAddTabButton = NO;
_hideForSingleTab = NO;
@@ -644,7 +647,10 @@
[self removeTrackingRect:[cell cellTrackingTag]];
}
}
// nuke old tool tips
[self removeAllToolTips];
// calculate number of cells to fit in control and cell widths
float availableWidth = [self availableCellWidth];
NSMutableArray *newWidths = [NSMutableArray arrayWithCapacity:cellCount];
@@ -757,7 +763,11 @@
tag = [self addTrackingRect:cellRect owner:cell userData:nil assumeInside:NO];
[cell setCellTrackingTag:tag];
[cell setEnabled:YES];
// add tool tip if label will be truncated
if ([cell desiredWidthOfCell] > NSWidth([cell frame]))
[self addToolTipRect:cellRect owner:[cell stringValue] userData:NULL];
// selected? set tab states...
if([[cell representedObject] isEqualTo:[tabView selectedTabViewItem]]){
[cell setState:NSOnState];
@@ -975,16 +985,28 @@
return YES;
}
- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation
{
[[PSMTabDragAssistant sharedDragAssistant] draggedImageEndedAt:aPoint operation:operation];
}
// NSDraggingDestination
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
{
NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil];
_delegateHandlingDrag = NO;
if([[[sender draggingPasteboard] types] indexOfObject:@"PSMTabBarControlItemPBType"] != NSNotFound) {
if ([sender draggingSource] != self && ![self allowsDragBetweenWindows])
return NSDragOperationNone;
[[PSMTabDragAssistant sharedDragAssistant] draggingEnteredTabBar:self atPoint:[self convertPoint:[sender draggingLocation] fromView:nil]];
[[PSMTabDragAssistant sharedDragAssistant] draggingEnteredTabBar:self atPoint:point];
return NSDragOperationMove;
} else if (delegate && [delegate respondsToSelector:@selector(tabBarControl:draggingEntered:forTabAtIndex:)]) {
NSDragOperation op = [delegate tabBarControl:self draggingEntered:sender forTabAtIndex:[self indexOfCellAtPoint:point]];
_delegateHandlingDrag = (op != NSDragOperationNone);
_delegateInitialDragOperation = op;
return op;
}
return NSDragOperationNone;
@@ -992,13 +1014,19 @@
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender
{
NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil];
if ([[[sender draggingPasteboard] types] indexOfObject:@"PSMTabBarControlItemPBType"] != NSNotFound) {
if ([sender draggingSource] != self && ![self allowsDragBetweenWindows])
return NSDragOperationNone;
[[PSMTabDragAssistant sharedDragAssistant] draggingUpdatedInTabBar:self atPoint:[self convertPoint:[sender draggingLocation] fromView:nil]];
[[PSMTabDragAssistant sharedDragAssistant] draggingUpdatedInTabBar:self atPoint:point];
return NSDragOperationMove;
} else if (_delegateHandlingDrag) {
if ([delegate respondsToSelector:@selector(tabBarControl:draggingUpdated:forTabAtIndex:)])
return [delegate tabBarControl:self draggingUpdated:sender forTabAtIndex:[self indexOfCellAtPoint:point]];
else
return _delegateInitialDragOperation;
}
return NSDragOperationNone;
@@ -1006,44 +1034,61 @@
- (void)draggingExited:(id <NSDraggingInfo>)sender
{
[[PSMTabDragAssistant sharedDragAssistant] draggingExitedTabBar:self];
if (!_delegateHandlingDrag) {
[[PSMTabDragAssistant sharedDragAssistant] draggingExitedTabBar:self];
} else if ([delegate respondsToSelector:@selector(tabBarControl:draggingExited:forTabAtIndex:)]) {
NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil];
[delegate tabBarControl:self draggingExited:sender forTabAtIndex:[self indexOfCellAtPoint:point]];
}
}
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
if (_delegateHandlingDrag && [delegate respondsToSelector:@selector(tabBarControl:prepareForDragOperation:forTabAtIndex:)]) {
NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil];
return [delegate tabBarControl:self prepareForDragOperation:sender forTabAtIndex:[self indexOfCellAtPoint:point]];
}
return YES;
}
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
if (!_delegateHandlingDrag) {
#if 1
// HACK! Used below.
NSTabViewItem *tvi = [[[PSMTabDragAssistant sharedDragAssistant] draggedCell] representedObject];
// HACK! Used below.
NSTabViewItem *tvi = [[[PSMTabDragAssistant sharedDragAssistant] draggedCell] representedObject];
#endif
[[PSMTabDragAssistant sharedDragAssistant] performDragOperation];
[[PSMTabDragAssistant sharedDragAssistant] performDragOperation];
#if 1
// HACK! Notify the delegate that a tab was dragged to a new position.
if (delegate && [delegate respondsToSelector:@selector(tabView:didDragTabViewItem:toIndex:)]) {
int idx = [[self representedTabViewItems] indexOfObject:tvi];
if (NSNotFound != idx) {
[delegate tabView:[self tabView] didDragTabViewItem:tvi toIndex:idx];
// HACK! Notify the delegate that a tab was dragged to a new position.
if (delegate && [delegate respondsToSelector:@selector(tabView:didDragTabViewItem:toIndex:)]) {
int idx = [[self representedTabViewItems] indexOfObject:tvi];
if (NSNotFound != idx) {
[delegate tabView:[self tabView] didDragTabViewItem:tvi toIndex:idx];
}
}
#endif
} else {
if ([delegate respondsToSelector:@selector(tabBarControl:performDragOperation:forTabAtIndex:)]) {
NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil];
return [delegate tabBarControl:self performDragOperation:sender forTabAtIndex:[self indexOfCellAtPoint:point]];
} else {
return NO;
}
}
#endif
return YES;
}
- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation
{
[[PSMTabDragAssistant sharedDragAssistant] draggedImageEndedAt:aPoint operation:operation];
}
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender
{
if (_delegateHandlingDrag && [delegate respondsToSelector:@selector(tabBarControl:concludeDragOperation:forTabAtIndex:)]) {
NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil];
[delegate tabBarControl:self concludeDragOperation:sender forTabAtIndex:[self indexOfCellAtPoint:point]];
}
}
#pragma mark -
@@ -1350,11 +1395,25 @@
}
- (id)cellForPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame
{
unsigned i = [self indexOfCellAtPoint:point cellFrame:outFrame];
if (i == NSNotFound)
return nil;
PSMTabBarCell *cell = [_cells objectAtIndex:i];
return cell;
}
- (unsigned)indexOfCellAtPoint:(NSPoint)point
{
return [self indexOfCellAtPoint:point cellFrame:NULL];
}
- (unsigned)indexOfCellAtPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame
{
NSRect aRect = [self genericCellRect];
if(!NSPointInRect(point,aRect)){
return nil;
return NSNotFound;
}
int i, cnt = [_cells count];
@@ -1367,11 +1426,11 @@
if(outFrame){
*outFrame = aRect;
}
return cell;
return i;
}
aRect.origin.x += width;
}
return nil;
return NSNotFound;
}
- (PSMTabBarCell *)lastVisibleTab
-185
View File
@@ -1,185 +0,0 @@
Active:
- transparent text view
- Listen to NSSystemColorsDidChangeNotification and update highlighting
- Add support for 'mousehide' (needs to check p_mh)
- Build Vim (make) from Xcode project
- Cmd-W in about box sends vimMenuAction: instead of performClose:
- Terminal support. :!bash -> no cursor, arrow keys mucks up display
- Press Cmd-n multiple times and quickly press Cmd-q; sometimes two or more
instances of MacVim opens up
- hide toolbar, open new tab, show toolbar: baseline sepearator still visible
(seems like a drawing bug in PSMTabBarControl)
- file modified outside vim dialog sometimes only appear after pressing a key
- let user choose file encoding and format in open/save dialogs
- autosave settings ?
- encoding -- convert strings from vim to utf-8
- main menu (buffers menu, window menu)
- standardize NSString usage (initialization & how it is passed in messages)
- autosave window rows&columns?
- improve drag and drop support (modifier keys are ignored)
- grey out menus which can't be used: Tab Next/Prev/Close, Undo/Redo, etc.
- find/replace toolbar item (FIND_REPLACE_DIALOG)
- drag-to-resize, delay if mouse button held down
- ability to modify key equivalents at any time (?)
- validate menu actions for when no windows are open (e.g. selectNextWindow:)
- need E??? numbers for vim errors
- tab-completion for :action command?
- proper font handling
- check for memory leaks
- i8n
- change building procedure so that the Makefile compiles and links VimTask and
then calls pbxbuild to build MacVim (and put MacVim.app) in the src folder
- icons for all built in toolbar items
- window title is never set when starting with terminal vim and typing :gui
- forking doesn't work with :gui (i think)
- make sure [NSMutableData appendByte:length:] is never called with 0 length
(this will lead to a crash)
- update speed whilst resizing with mouse is excruciatingly slow
- window count should be typeset nicely in tab ?
- track pad scrolling is jerky
- sanity check all input in handlePortMessage: etc.
- nice looking cursors (both the block and in insert mode) ?
- support project builder external editor
http://www.codingmonkeys.de/techpubs/externaleditor/pbxexternaleditor.html
- dock icon menu
- horizontal scrolling with trackpad does not work
- got this error when clicking to close second last tab:
2007-07-23 08:19:29.398 MacVim[335] *** Assertion failure in -[PSMTabBarControl lockFocus], AppKit.subproj/NSView.m:3248
2007-07-23 08:19:29.410 MacVim[335] lockFocus sent to a view whose window is deferred and does not yet have a corresponding platform window
Pending:
- marked text
- set gfn=*
- improve drag and drop support (drop in command line mode not working)
- System colors don't come out the same as in other apps (as measure with
Digital Color Meter)
- Select-mode for <S-Key>
- Insertion point blinking
- Hollow insertion point drawing does not always work
- cursor in replace mode
- should ignore action message if is called too often (e.g. in addNewTab:)
- application:openFiles: should open in tabs in current window instead of in a
new window, only if user default is set
- Mouse cursor changes depeding on context
- Ctrl-C does not update screen until another key press (in command window)
- Underline color is never set properly (sp_color)
- Lock up when opening large session files (increasing MMFlushTimeoutInterval
alleviates this problem)
- Respond to "should change" instead of "will change" tab messages
- scrolling when mouse is over scrollbar doesn't work
- gui dialogs (FEAT_GUI_DIALOG)
- no warning when buffer modified outside vim (implement gui_mch_dialog())
- call gui_focus_change() when appropriate
- ability to interrupt vim (needs to check the run-loop for interrupts)
- got this error on Cmd-N with no other windows open:
2007-07-27 22:00:17.680 MacVim[454] *** -[NSToolbarView frameDidChange:]: selector not recognized [self = 0x39ba80]
2007-07-27 22:00:17.690 MacVim[454] Exception raised during posting of notification. Ignored. exception: *** -[NSToolbarView frameDidChange:]: selector not recognized [self = 0x39ba80]
- got this error when opening MacVim from terminal (with 'gvim gvimrc&'):
Frost:~/Projects/vim7/src/MacVim winckler$ 2007-08-05 13:25:01.151 MacVim[223] *** -[NSThemeFrame frameDidChange:]: selector not recognized [self = 0x3baa30]
2007-08-05 13:25:01.152 MacVim[223] Exception raised during posting of notification. Ignored. exception: *** -[NSThemeFrame frameDidChange:]: selector not recognized [self = 0x3baa30]
2007-08-05 13:25:01.155 MacVim[223] *** -[NSThemeFrame frameDidChange:]: selector not recognized [self = 0x3baa30]
2007-08-05 13:25:01.156 MacVim[223] Exception raised during posting of notification. Ignored. exception: *** -[NSThemeFrame frameDidChange:]: selector not recognized [self = 0x3baa30]
2007-08-05 13:25:01.246 MacVim[223] *** -[NSThemeFrame frameDidChange:]: selector not recognized [self = 0x3baa30]
2007-08-05 13:25:01.247 MacVim[223] Exception raised during posting of notification. Ignored. exception: *** -[NSThemeFrame frameDidChange:]: selector not recognized [self = 0x3baa30]
- toogle toolbar off, maximize window, toolbar on -> text view under toolbar
- clicking pill button does not update 'guioptions'
- detect Cmd-. (and Ctrl-C) for interrupt
Done:
- :popup
- popup menus
- when only one tab open make <D-w> close window
- cscope, ctags
- Ctrl-O in insert mode
- remember window position
- font selection dialog (:set gfn=*)
- services menu
- wide characters are badly supported: they render as too wide
- dropping directories does not work
- memory leak with text view? (need to release text storage)
- drag and drop inside view (FEAT_GUI_DND, gui_handle_drop())
- hide baseline separator when tabbar is visible (and make sure clicking the
hide/show toolbar button in the top right of the corner does not show it
again)
- toolbar drawing bug
- Cmd-zoom -> no input received, drawing broken
- scrollbars not positioned over resize box
- offset text away from left edge
- add menu options with key equiv:
Cmd+Option+Left/Right to change tab, Cmd+x/c/v cut/copy/paste,
Cmd+z/Z undo/redo, Cmd+o open, Cmd+w/W close tab/window,
Cmd+Option+T special characters,
etc.
- menu key equivalents
- startup is a bit flakey (up until openWindowWithRows:columns:)
- background color of text view doesn't get set if :colorscheme is in .gvimrc,
since textView=nil when setDefaultColorsBackground:foreground: is called
- resize window on font change
- don't clear the text storage on setMaxRows:: so that display does not go
blank when dragging to resize
- zoom&resize broken
- add user default for min/max tab size
- :colorscheme elflord, :set lines+=3 --> colors are not updated properly
- use DO to communicate between GUI and Vim (only for two-way communication,
one-way communication should still use mach ports)
- make scrollbar inactive if it is too small to display properly
- make vertical scrollbars cover command line as well
- setting font in .gvimrc has no effect since textStorage has not been init'ed
- fonts
- scroll bars
- Make MacVim project depend on PSMTabBarControl project
- Change Makefile so that it builds a vim executable and copy this into the
MacVim.app from the MacVim project
- warning before closing modified buffer
- On quitting, warn user if modified files are open
- An untitled window should not open when the GUI is started from the terminal
(figure out how to pass '-nowindow yes' option when launching GUI)
- support using VimTask as a standalone terminal app, with support for :gui
- path is set to / when not starting from command line, set it to $HOME instead
- input of wide characters does not work
- tab completion doesn't work on iMac
- close icons on tabs don't appear on iMac
- toolbar
- copy runtime files to bundle properly (only works for debug at the moment)
- don't resize to make window bigger than what can fit on screen
- window resizing using mouse & zoom
- cmd-click to maximize window, :tabnew...the text view overlaps the tabline
- colorscheme changes are buggy (open two tabs, change colorscheme, open new
tab; the new tab has wrong color on first and last lines.)
- tab selection bug: open three tabs, selct middle, drag last tab so it becomes
middle without selecting it, select middle tab...selects middle, then last
- tab selection bug #2: :tabnew, drag tab #2 to pos #1, press enter. tab #2 is
selected.
- this stuffs up the display: set go-=e; :tabnew
- with 2 tabs: closing one tab using mouse makes screen flash (does not happen
if tab is closed using :q)
- resize to fit every draw update
- insertion point
- copy/paste
- compute text storage size based on actual content
- color changes (:colorscheme)
- set text storage dimensions properly when creating text view
- text dimension changes
- notify vim task when user closes/selects tabs
- mouse handling in text view
- file type associations (Info.plist)
- drag and drop onto app icon
- remove tab update hack when flushing (edit vim code to call update)
- crash when typing :browse e $vim (but not :browse e $vim/)
- maintain queue of messages to send from task (to ensure they are passed in
the same order they arrive)
- do not include shift flag in chars that are already shifted (%, A, etc.)
- open file(s) in tab(s) (never open in new window?)
- key handling:
<M-Space> works, <M-S-Space> does not
clean up dispatchKeyEvent
- reordering tab pages (gui tabs must have same order as vim tabs)
- make sure tab is wide enough to fit label
- encoding (did_set_string_option, option.c, line 5675)
in init:
set_option_value((char_u *)"termencoding", 0L, (char_u *)"utf-8", 0);
+45 -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)) {
@@ -1231,6 +1233,48 @@ im_get_status(void)
// -- Find & Replace dialog -------------------------------------------------
#ifdef FIND_REPLACE_DIALOG
static void
macvim_find_and_replace(char_u *arg, BOOL replace)
{
// TODO: Specialized dialog for find without replace?
int wholeWord = FALSE;
int matchCase = !p_ic;
char_u *text = get_find_dialog_text(arg, &wholeWord, &matchCase);
int flags = 0;
if (wholeWord) flags |= FRD_WHOLE_WORD;
if (matchCase) flags |= FRD_MATCH_CASE;
NSDictionary *args = [NSDictionary dictionaryWithObjectsAndKeys:
[NSString stringWithVimString:text], @"text",
[NSNumber numberWithInt:flags], @"flags",
nil];
[[MMBackend sharedInstance] queueMessage:ShowFindReplaceDialogMsgID
properties:args];
}
void
gui_mch_find_dialog(exarg_T *eap)
{
macvim_find_and_replace(eap->arg, NO);
}
void
gui_mch_replace_dialog(exarg_T *eap)
{
macvim_find_and_replace(eap->arg, YES);
}
#endif // FIND_REPLACE_DIALOG
// -- Unsorted --------------------------------------------------------------
+10 -6
View File
@@ -1,7 +1,7 @@
" System gvimrc file for MacVim
"
" Maintainer: Bjorn Winckler <bjorn.winckler@gmail.com>
" Last Change: Sun Aug 03 2008
" Last Change: Sun Oct 04 2008
"
" This is a work in progress. If you feel so inclined, please help me improve
" this file.
@@ -60,17 +60,21 @@ an 10.350 File.Save\ As\.\.\.<Tab>:sav :browse confirm saveas<CR>
" Edit menu
" The following function is aken from menu.vim
fun! s:FixFText()
" Fix text in nameless register to be used with :promptfind.
return substitute(@", "[\r\n]", '\\n', 'g')
endfun
aunmenu Edit.Find
aunmenu Edit.Find\ and\ Replace
an 20.410.10 Edit.Find.Find\.\.\.<Tab>/ /
an <silent> 20.410.10 Edit.Find.Find\.\.\. :promptfind<CR>
vunmenu Edit.Find.Find\.\.\.
vnoremenu <silent> Edit.Find.Find\.\.\. y:promptfind <C-R>=<SID>FixFText()<CR><CR>
an 20.410.20 Edit.Find.Find\ Next <Nop>
an 20.410.30 Edit.Find.Find\ Previous <Nop>
vmenu 20.410.35 Edit.Find.Use\ Selection\ for\ Find y:let @/=@"<CR>:<BS>
an 20.410.40 Edit.Find.-SEP1- <Nop>
an 20.410.50 Edit.Find.Find\ and\ Replace\.\.\.<Tab>:%s :%s/
vunmenu Edit.Find.Find\ and\ Replace\.\.\.<Tab>:%s
vnoremenu Edit.Find.Find\ and\ Replace\.\.\.<Tab>:s :s/
an 20.460 Edit.-SEP4- <Nop>
an 20.465.10 Edit.Font.Show\ Fonts <Nop>
+66
View File
@@ -40,6 +40,72 @@
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[
<h1>MacVim snapshot 36 released</h1>
<p> This snapshot fixes a problem with dropped characters that was introduced with snapshot 35. Other changes since snapshot 35:
<ul>
<li> More help file updates </li>
<li> Fixed memory leak (Jonathon Mah) </li>
<li> Tool tips for truncated tab labels (Jonathon Mah) </li>
<li> Support drag and drop on tabs and on tabline (Jonathon Mah) </li>
<li> Modifier key can be used as Esc (useful for turning Caps Lock into Esc, see ":h macvim-esc") </li>
<li> Added "Find & Replace" dialog box (Cmd-f) </li>
</ul>
</p>
]]></description>
<pubDate>Sat, 04 Oct 2008 18:38 CET</pubDate>
<enclosure type="application/octet-stream"
url="http://newmacvim.muskokamug.org/mirror/files/MacVim-snapshot-36.tbz"
length="8005820"
sparkle:version="36"
sparkle:shortVersionString="7.2"
/>
</item>
<item>
<title>Snapshot 35 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,
+44 -14
View File
@@ -220,7 +220,8 @@ static void ex_popup __ARGS((exarg_T *eap));
#ifndef FEAT_GUI_MSWIN
# define ex_simalt ex_ni
#endif
#if !defined(FEAT_GUI_MSWIN) && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MOTIF)
#if !(defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) || \
defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_MACVIM))
# define gui_mch_find_dialog ex_ni
# define gui_mch_replace_dialog ex_ni
#endif
@@ -365,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
@@ -1776,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;
@@ -3615,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:
@@ -9526,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
@@ -10726,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
+7 -3
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
/*
@@ -1099,7 +1103,7 @@
#endif
#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MOTIF) \
|| defined(MSWIN_FIND_REPLACE)
|| defined(MSWIN_FIND_REPLACE) || defined(FEAT_GUI_MACVIM)
# define FIND_REPLACE_DIALOG 1
#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));
+5
View File
@@ -207,3 +207,8 @@ int is_valid_macaction(char_u *action);
void gui_macvim_wait_for_startup();
void gui_macvim_get_window_layout(int *count, int *layout);
void
gui_mch_find_dialog(exarg_T *eap);
void
gui_mch_replace_dialog(exarg_T *eap);
+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 */