Commit Graph

1776 Commits

Author SHA1 Message Date
Nico Weber 08e7634e76 Documentation updates
Added some info about forking on Mac OS X and some other minor improvements.
2007-12-14 19:17:29 +01:00
Bjorn Winckler 621f94828e Fix memory leak in window controller
The NSWindow object for a window controller was alloc'ed but never released
when initializing the window controller.
2007-12-14 18:56:18 +01:00
Nico Weber c9304c3b82 Fix forking infinite loop 2007-12-04 21:09:31 +01:00
Nico Weber 86ba888201 Fix tab color flicker problem on Leopard 2007-12-04 20:50:31 +01:00
Bjorn Winckler 922a70fafc Fix initial window placement
When ~/Library/Preferences/org.vim.MacVim.plist does not exist the window will
be placed according to the frame passed when initializing the NSWindow, so set
some sane default values.
2007-12-02 16:48:24 +01:00
Bjorn Winckler 81a1de822a Add mvim script, update credits 2007-12-02 15:57:54 +01:00
Bjorn Winckler 5fafa98d5f Cursor line & column darker when bg=dark in macvim color scheme 2007-12-02 15:22:47 +01:00
Nico Weber d4855706c0 Nicer looking tabs on Leopard
Make the tabs look almost identical to the Leopard Terminal.app tabs (only on
Leopard, the Tiger tabs are unchanged).
2007-12-02 15:00:37 +01:00
Nico Weber b86eee82f8 Add fork support
If vim is started via '-g', it forks and exec()s a new (!) vim instance in the
child process. But if the gui is started via `:gui`, no forking is done.

In MacVim, pass the '-f' flag when starting a new Vim process (should not fork
in this instance).
2007-12-02 13:05:14 +01:00
Bjorn Winckler 88d1e3c664 Parse selection range when opening files from Xcode
Xcode sets the 'keyAEPosition' parameter in the 'odoc' Apple event. This
contains information on the line range to select when opening files.
2007-11-28 20:12:44 +01:00
Bjorn Winckler 809f415bda Docs updated on ODB support, fixed Info.plist 2007-11-27 21:38:19 +01:00
Bjorn Winckler f99ce72a11 ODB Editor protocol (aka 'external editor') support
Programs that support ODB asks MacVim to open files. When a file is written or
closed, MacVim notifies the program of these events. (At the moment the 'Burl'
parameter is parsed but ignored. The 'RdEV' parameter is ignored.)
2007-11-27 21:07:08 +01:00
Bjorn Winckler 3a36672982 Improved support for Ctrl-mappings
Ctrl-letter keys are passed directly to the input buffer so that the backend
can separate e.g. <C-i> and <C-Tab>.
2007-11-19 21:20:56 +01:00
Bjorn Winckler 2fbfb74a77 MMLoginShell defaults to NO
Starting a tcsh shell with -c and -l doesn't work so disable this user default
until further notice.
2007-11-18 14:18:12 +01:00
Bjorn Winckler 240bb64660 Constrain window frame to screen after live resize
Always send SetTextDimensionsMsgID to Vim at the end of live resize to ensure
that resizeWindowToFit gets called.  Otherwise the window can be too big and
will then automatically resize when a dialog sheet is presented or when the
window is moved, which feels strange.
2007-11-18 14:16:42 +01:00
Bjorn Winckler 2e105da555 Fix a wide character bug
When replacing characters in the text storage it could happen that a row 'lost'
one column when a wide character was replaced with a normal one.
2007-11-17 18:03:47 +01:00
Bjorn Winckler 00e0971705 MacVim color scheme supports dark background
Change background color with ":set background=dark" (see :h 'background')
2007-11-17 15:03:56 +01:00
Bjorn Winckler 2d5e4ef21d Removed stray debug log message 2007-11-15 22:09:01 +01:00
Bjorn Winckler 8df6521434 Preserve swap files after crash
Before terminating gracefully, send a TerminateNowMsgID to every Vim process so
that they can determine whether MacVim quit or crashed.  If MacVim quits, call
getout() to exit Vim (this removes swap files), otherwise call
getout_preserve_modified() (this preserves swap files).
2007-11-15 22:04:06 +01:00
Bjorn Winckler 5ba1fac486 Fix autocommands in macvim color scheme
Calling ':set bg=dark' in .gvimrc clears colors_name which caused an error
message to pop up every time the focus changed due to the autocommands
installed in macvim.vim accessing colors_name.
2007-11-15 20:40:09 +01:00
Bjorn Winckler e3cd69d29c Improved marked text handling
Delete, enter, escape, all work as expected with marked text visible.
2007-11-13 20:18:16 +01:00
Bjorn Winckler f7e4a83a92 Add IM control support
When the default system keyboard script is non-roman the input manager is
automatically switched to a roman keyboard script when going to normal mode.
See 'imd', 'imc', 'imi' for some relevant options.  MacVim uses an
over-the-spot style of IM support.
2007-11-13 19:15:11 +01:00
Bjorn Winckler eaaacf8af6 Disable login shell with "MMLoginShell"
New Vim processes are by default launched via a login shell so that the user's
environment gets profiled.  This behavior can be disabled by setting the user
default "MMLoginShell" to 0.
2007-11-12 20:17:57 +01:00
Nico Weber 3306ace54e Enable trackpad scrolling over the black area in full-screen 2007-11-11 20:34:57 +01:00
Bjorn Winckler 8e8f563178 Support file-open check for multiple files
When dropping multiple files, make sure none of the files are already open.  If
all files were already open, then select the window and tab of the first file
that was open.  If at least one file was not already open, then simply ignore
the open files and open the unopened ones.

Also don't check if files exists inside application:openFiles: since files that
are passed here are assumed to already exists.  The existence check has been
moved to the system services message openFile:userData:error:.
2007-11-11 20:27:03 +01:00
Bjorn Winckler ea9acd7e15 Updated help files
Updated gui_mac.txt to reflect better handling of Unicode.

Not all occurrences of ":action" and ":menukeyequiv" had been changed to
":macaction" and ":macmenukey".

Updated 'guifontwide' entry.
2007-11-11 15:46:04 +01:00
Bjorn Winckler 9d16bac368 New text drawing model, better unicode support, 'gfw' support, etc.
Characters and columns are no longer assumed to be in one-to-one
correspondence.  Thus when modifying the text storage a (row,column) pair must
be searched for.  This is managed using
    [NSString rangeOfComposedCharacterSequenceAtIndex:]
and by marking wide characters with an attribute (called "MMWideChar").  We
also provide an optimized code path for when characters and columns are in
one-to-one correspondence (no wide chars, only chars that can be represented by
one utf16 character).

A new typesetter is also used.  Instead of overriding
layoutGlyphsInLayoutManager:::: we override willSetLineFragmentRect::::.  This
typesetter can handle composing characters, whereas the old typesetter couldn't
(it can still be used by setting the user default "MMTypesetter" to
"MMTypesetter2".)

Note that text rendering still has flaws, the Cocoa Text System and Vim has
different opinions on how much space certain characters take up and this
results in display bugs.  (E.g. nonspacing marks such as U+064C are
problematic.)  Also, sometimes the layout manager hides glyphs but Vim assumes
that each character is displayed (resulting in yet more display bugs).

Added support for 'guifontwide'.  This can be set to anything (different font
size); it is quite possible to set it so that the display becomes completely
messed up.
2007-11-11 15:09:22 +01:00
Bjorn Winckler 94e4efed2d Don't attempt to open dropped file that is already open
When a file is dropped, each Vim process is checked to see if the file is
already open.  If so, raise the corresponding window and select the tab that
holds the opened file.  Only works when one file is dropped.
2007-11-08 20:14:34 +01:00
Bjorn Winckler 702917f6ed Add eval & add input methods to MacVim, apply to file open
Now possible to evaluate expressions in a Vim process from MacVim [MMBackend
evaluateExpression:], and to send arbitrary input to Vim [MMVimController
addVimInput:].  Expression evaluation is used to query Vim state from within
MacVim.

When opening a file use these methods to check if it is already loaded, if so
raise the corresponding window (doesn't work for multiple files).
2007-11-07 23:46:52 +01:00
Bjorn Winckler 4d517a0f74 Changed application termination procedure
On applicationShoulTerminate: check the 'documentEdited' flag of each window to
decide whether any buffers were modified instead of making a DO call to each
Vim process.
2007-11-07 22:07:21 +01:00
Bjorn Winckler 0a1ac7a24e Launch Vim process via login shell, handle spaces in file names
The user environment is not always sourced when MacVim starts.  To solve this
each Vim process is launched via a login shell like this:
    $SHELL -l -c "exec /path/to/Vim -g <args>"
Also make sure that if an argument contains a space then enclose it in quotes.
2007-11-07 21:25:05 +01:00
Bjorn Winckler 5aaf05255c Always open a dropped file in new tab
Always use ":tab drop" when dropping files.  (Used to call ":drop" when only
one file was dropped but this would not open the file in a new tab.)
2007-11-07 19:46:46 +01:00
Bjorn Winckler f1236d0fd3 Disable baseline change for underlined text.
This fixes a display bug on Leopard where lines with underlined text were
higher than lines without underlined text.
2007-11-05 15:44:27 +01:00
Bjorn Winckler 67576e0281 Only respond to left, right and middle mouse clicks.
This effectively ignores mouse clicks when [NSEvent buttonNumber] > 2.
2007-11-04 18:46:03 +01:00
Bjorn Winckler 0b104808a2 Enable compilation without FEAT_MBYTE. 2007-11-02 18:18:17 +01:00
Bjorn Winckler cf69540941 Fixed typo in the credits. 2007-11-02 13:29:17 +01:00
Dan Callahan 855ff922b8 New icon set (Gnome/Matt Ball/Jonas Rask derived) 2007-11-01 17:14:45 -05:00
Nico Weber 9b639cbbe2 Vim view refactoring.
This fixes the ':set lines=1000000' problem in fu mode.  Furthermore, this
fixes a regression that the tab sizes weren't adjusted when changing the window
size.
2007-10-30 21:44:23 +01:00
Bjorn Winckler 36b97011cf Removed stray debug log message. 2007-10-30 18:09:06 +01:00
Chris Willmore 25bf887ced Fix for Leopard Ctl-key bug.
In Leopard Ctrl-key events are sent to performKeyEquivalent: instead of
keyDown:, so we have to deal with them there as well.
2007-10-29 19:19:18 +01:00
Bjorn Winckler 75b61c87cf Optimize speed when 'matchparen' is enabled.
When matchparen is used gui_mch_update() gets called a lot.  This function
checks the run loop for new input which takes a long time.  To speed things up
make sure that the run loop is only checked every 100 ms or so (controlled by
MMUpdateTimeoutInterval in gui_macvim.m).
2007-10-28 13:51:01 +01:00
Bjorn Winckler 3d98b6f1f5 Use "macvim" color scheme as default.
The color scheme is set in $VIM/gvimrc, but only if the color scheme hasn't
already been set (in .vimrc).
2007-10-27 16:05:15 +02:00
Bjorn Winckler 4de2a14060 Ignore DRAW_TRANSP flag.
This flag is supposed to indicate that the background should be "transparent".
However, not setting the background color leads to a rendering artifact where
the character after the cursor sometimes is not drawn.  Simply ignoring the
DRAW_TRANSP flag takes care of this bug.
2007-10-26 19:51:47 +02:00
Tim Allen 85313038f6 Draw the current text view size in the titlebar during resize operations.
It seems that NSWindows get notfied of each step of the live-resize, but
NSViews get notified of the start and end events. So, we make MMTextView
forward these notifications to the window controller, and let the window
controller figure out when to change the title.

Signed-off-by: Tim Allen <screwtape@froup.com>
2007-10-26 14:14:41 +10:00
Adam Mercer 552d2c24a2 Ignore .DS_Store
Signed-off-by: Adam Mercer <ramercer@gmail.com>
2007-10-25 10:51:41 -04:00
Adam Mercer 7635d2201f Ignore the auto generated file src/auto/if_perl.c
Signed-off-by: Adam Mercer <ramercer@gmail.com>
2007-10-25 08:55:45 -04:00
Adam Mercer 9a5185ea2f Sort .gitignore in alphabetical order for consistency
Signed-off-by: Adam Mercer <ramercer@gmail.com>
2007-10-25 08:54:11 -04:00
Bjorn Winckler 1e44f71605 Add input queue to backend, fixing process leak problem.
Mouse and keyboard input is handled immediately, all other input is put on a
queue which is processed whenever gui_mch_update() is called.  This avoids DO
calls to be sent from the backend during processing of another DO call.  (See
comments in MMBackend processInput:data: and processInputQueue.)  One problem
this caused was that connectionDidDie notification was not received when
processInput:data: got called recursively (and thus processes could "leak").

Also did some code cleanup to MMBackend.
2007-10-25 19:29:44 +02:00
Bjorn Winckler d669e9d2a5 Changed DiffText and Constant highlight groups 2007-10-25 16:08:43 +02:00
Bjorn Winckler 1091b43561 Reduce update delay when resizing with mouse.
By forcing an update of the text view at the end of batch processing of draw
commands the update delay when dragging to resize is reduced.
2007-10-23 17:19:54 +02:00