From 7a03a69f20738dc341ab3d789b432f294eac0f6e Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Thu, 18 Oct 2007 12:46:52 +0200 Subject: [PATCH] Applied MacVim r320 patch --- runtime/colors/macvim.vim | 93 ++++++++++ runtime/doc/eval.txt | 3 +- runtime/doc/gui.txt | 25 +-- runtime/doc/gui_mac.txt | 431 ++++++++++++++++++++++++++++++++++++++++++++++ runtime/doc/help.txt | 3 +- runtime/doc/index.txt | 4 +- runtime/doc/options.txt | 93 +++++++--- runtime/doc/quickref.txt | 6 +- runtime/doc/remote.txt | 22 ++- runtime/doc/syntax.txt | 6 +- runtime/doc/tags | 53 +++++- runtime/menu.vim | 3 +- runtime/optwin.vim | 6 + runtime/syntax/vim.vim | 2 +- src/Makefile | 25 +++ src/buffer.c | 6 + src/configure.in | 62 +++++-- src/eval.c | 25 ++- src/ex_cmds.h | 4 + src/ex_docmd.c | 17 +- src/feature.h | 43 ++++- src/fileio.c | 3 +- src/globals.h | 4 +- src/gui.c | 35 +++- src/gui.h | 6 +- src/if_xcmdsrv.c | 3 +- src/main.c | 77 ++++++++- src/menu.c | 149 +++++++++++++++- src/normal.c | 6 +- src/option.c | 79 ++++++++- src/option.h | 9 +- src/os_unix.c | 6 +- src/proto.h | 3 + src/proto/gui_macvim.pro | 196 +++++++++++++++++++++ src/proto/menu.pro | 3 + src/structs.h | 4 + src/syntax.c | 3 +- src/ui.c | 13 +- src/version.c | 31 +++- src/vim.h | 1 + 40 files changed, 1434 insertions(+), 129 deletions(-) create mode 100644 runtime/colors/macvim.vim create mode 100644 runtime/doc/gui_mac.txt create mode 100644 src/proto/gui_macvim.pro diff --git a/runtime/colors/macvim.vim b/runtime/colors/macvim.vim new file mode 100644 index 00000000..b748b6a9 --- /dev/null +++ b/runtime/colors/macvim.vim @@ -0,0 +1,93 @@ +" MacVim colorscheme +" +" Maintainer: Bjorn Winckler +" Last Change: 2007 Oct 11 +" + + +" Tell vim that this is a light color scheme: +set background=light +highlight clear + +" Reset String -> Constant links etc if they were reset +if exists("syntax_on") + syntax reset +endif + +let colors_name = "macvim" + +" `:he highlight-groups` +hi ErrorMsg guibg=Firebrick2 guifg=White +hi IncSearch gui=reverse +hi ModeMsg gui=bold +hi NonText gui=bold guifg=Blue +hi StatusLine gui=NONE guifg=White guibg=DarkSlateGray +hi StatusLineNC gui=NONE guifg=SlateGray guibg=Gray90 +hi VertSplit gui=NONE guifg=DarkSlateGray guibg=Gray90 +hi DiffText gui=NONE guibg=VioletRed +hi PmenuThumb gui=reverse +hi PmenuSbar guibg=Grey +hi TabLineSel gui=bold +hi TabLineFill gui=reverse +hi Cursor guibg=fg guifg=bg +hi CursorIM guibg=fg guifg=bg +hi lCursor guibg=fg guifg=bg + + +hi Directory guifg=#1600FF +hi LineNr guifg=#888888 guibg=#E6E6E6 +hi MoreMsg gui=bold guifg=SeaGreen4 +hi Question gui=bold guifg=Chartreuse4 +hi Search guibg=CadetBlue1 guifg=NONE +hi SpellBad guisp=Firebrick2 gui=undercurl +hi SpellCap guisp=Blue gui=undercurl +hi SpellRare guisp=Magenta gui=undercurl +hi SpellLocal guisp=DarkCyan gui=undercurl +hi Pmenu guibg=LightSteelBlue1 +hi PmenuSel guifg=White guibg=SkyBlue4 +hi SpecialKey guifg=Blue +hi Title gui=bold guifg=DeepSkyBlue3 +hi WarningMsg guifg=Firebrick2 +hi WildMenu guibg=SkyBlue guifg=Black +hi Folded guibg=#E6E6E6 guifg=DarkBlue +hi FoldColumn guibg=Grey guifg=DarkBlue +hi SignColumn guibg=Grey guifg=DarkBlue +hi Visual guibg=MacSelectedTextBackgroundColor +hi DiffAdd guibg=MediumSeaGreen +hi DiffChange guibg=DeepSkyBlue +hi DiffDelete gui=bold guifg=Black guibg=SlateBlue +hi TabLine gui=underline guibg=LightGrey +hi CursorColumn guibg=#F1F5FA +hi CursorLine guibg=#F1F5FA "Data browser list view secondary color +hi MatchParen guifg=White guibg=MediumPurple1 +hi Normal gui=NONE guifg=MacTextColor guibg=MacTextBackgroundColor + + +" Syntax items (`:he group-name` -- more groups are available, these are just +" the top level syntax items for now). + +hi Comment gui=italic guifg=Blue2 guibg=NONE +hi Constant gui=NONE guifg=Magenta1 guibg=NONE +hi String gui=NONE guifg=SkyBlue4 guibg=NONE +hi Boolean gui=NONE guifg=Red3 guibg=NONE +hi Identifier gui=NONE guifg=Aquamarine4 guibg=NONE +hi Statement gui=bold guifg=Maroon guibg=NONE +hi PreProc gui=NONE guifg=DodgerBlue3 guibg=NONE +hi Type gui=bold guifg=Green4 guibg=NONE +hi Special gui=NONE guifg=BlueViolet guibg=NONE +hi Underlined gui=underline guifg=SteelBlue1 +hi Ignore gui=NONE guifg=bg guibg=NONE +hi Error gui=NONE guifg=White guibg=Firebrick3 +hi Todo gui=NONE guifg=DarkGreen guibg=PaleGreen1 + + +" Change the selection color on focus change (but only if the "macvim" +" colorscheme is active). +if !exists("s:augroups_defined") + au FocusLost * if colors_name == "macvim" | hi Visual guibg=MacSecondarySelectedControlColor | endif + au FocusGained * if colors_name == "macvim" | hi Visual guibg=MacSelectedTextBackgroundColor | endif + + let s:augroups_defined = 1 +endif + +" vim: sw=2 diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 6857ee51..2a8931a1 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -5338,7 +5338,8 @@ gui Compiled with GUI enabled. gui_athena Compiled with Athena GUI. gui_gtk Compiled with GTK+ GUI (any version). gui_gtk2 Compiled with GTK+ 2 GUI (gui_gtk is also defined). -gui_mac Compiled with Macintosh GUI. +gui_mac Compiled with Macintosh GUI (Carbon). +gui_macvim Compiled with MacVim GUI. gui_motif Compiled with Motif GUI. gui_photon Compiled with Photon GUI. gui_win32 Compiled with MS Windows Win32 GUI. diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index b5ae414d..c8ce2aaf 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -1,4 +1,4 @@ -*gui.txt* For Vim version 7.1. Last change: 2007 May 11 +*gui.txt* For Vim version 7.1. Last change: 2007 Sep 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -25,8 +25,8 @@ Other GUI documentation: First you must make sure you actually have a version of Vim with the GUI code included. You can check this with the ":version" command, it says "with xxx -GUI", where "xxx" is X11-Motif, X11-Athena, Photon, GTK, GTK2, etc., or -"MS-Windows 32 bit GUI version". +GUI", where "xxx" is Macvim, X11-Motif, X11-Athena, Photon, GTK, GTK2, etc., +or "MS-Windows 32 bit GUI version". How to start the GUI depends on the system used. Mostly you can run the GUI version of Vim with: @@ -93,7 +93,7 @@ and initialize other things that you may want to set up differently from the terminal version. Recommended place for your personal GUI initializations: - Unix $HOME/.gvimrc + Unix and Mac OS X $HOME/.gvimrc OS/2 $HOME/.gvimrc or $VIM/.gvimrc MS-DOS and Win32 $HOME/_gvimrc or $VIM/_gvimrc Amiga s:.gvimrc or $VIM/.gvimrc @@ -665,9 +665,10 @@ because the item will never be selected. Use a single colon to keep it simple. *gui-toolbar* -The toolbar is currently available in the Win32, Athena, Motif, GTK+ (X11), -and Photon GUI. It should turn up in other GUIs in due course. The -default toolbar is setup in menu.vim. +The toolbar is currently available in the MacVim, Win32, Athena, Motif, GTK+ +(X11), and Photon GUI. It should turn up in other GUIs in due course. The +default toolbar is setup in menu.vim. (Note: The MacVim toolbar is modified +in "$VIM/gvimrc".) The display of the toolbar is controlled by the 'guioptions' letter 'T'. You can thus have menu & toolbar together, or either on its own, or neither. The appearance is controlled by the 'toolbar' option. You can chose between @@ -904,9 +905,9 @@ a menu item - you don't need to do a :tunmenu as well. 5.9 Popup Menus -In the Win32 and GTK+ GUI, you can cause a menu to popup at the cursor. -This behaves similarly to the PopUp menus except that any menu tree can -be popped up. +In the Win32, MacVim, and GTK+ GUI, you can cause a menu to popup at the +cursor. This behaves similarly to the PopUp menus except that any menu tree +can be popped up. This command is for backwards compatibility, using it is discouraged, because it behaves in a strange way. @@ -915,7 +916,7 @@ it behaves in a strange way. :popu[p] {name} Popup the menu {name}. The menu named must have at least one subentry, but need not appear on the menu-bar (see |hidden-menus|). - {only available for Win32 and GTK GUI} + {only available for Win32, MacVim, and GTK GUI} :popu[p]! {name} Like above, but use the position of the mouse pointer instead of the cursor. @@ -969,6 +970,8 @@ This section describes other features which are related to the GUI. :set guifont=*-lucidatypewriter-medium-r-normal-*-*-180-*-*-m-*-* elseif has("gui_win32") :set guifont=Luxi_Mono:h12:cANSI + elseif has("gui_macvim") + :set guifont=DejaVu\ Sans\ Mono:h13 endif endif diff --git a/runtime/doc/gui_mac.txt b/runtime/doc/gui_mac.txt new file mode 100644 index 00000000..f43a0841 --- /dev/null +++ b/runtime/doc/gui_mac.txt @@ -0,0 +1,431 @@ +*gui_mac.txt* For Vim version 7.1. Last change: 2007 Oct 14 + + + VIM REFERENCE MANUAL by Bjorn Winckler + + +The MacVim Graphical User Interface *macvim* *gui-macvim* + +0. Important! |macvim-important| +1. MacVim differences |macvim-differences| +2. Starting MacVim |macvim-start| +3. Special colors |macvim-colors| +4. Menus |macvim-menus| +5. Toolbar |macvim-toolbar| +6. Dialogs |macvim-dialogs| +7. System services |macvim-services| +8. Known bugs/missing features |macvim-todo| +9. Hints |macvim-hints| + +Other relevant documentation: +|gui.txt| For generic items of the GUI. +|os_mac.txt| For Mac specific items. + +{Vi does not have a GUI} + +============================================================================== +0. Important! *macvim-important* + +MacVim is still under development...this is not the finished product! If you +have problems with MacVim then make it known either by adding an issue report +on the MacVim project page > + http://code.google.com/p/macvim +or by posting to the vim_mac mailing list > + http://groups.google.com/group/vim_mac + +Remember to keep checking the project page for new snapshots. (If you +downloaded this copy from somewhere else, you might want to go there now to +make sure that you have got the latest version.) + +============================================================================== +1. MacVim differences *macvim-differences* + +One of the goals of MacVim is to make Vim behave like a proper Mac OS X +application. For this reason MacVim behaves slightly different from other GUI +ports of Vim. Most of the modifications are provided in the system gvimrc +file; you can quickly open this file and look at it yourself by typing: > + :tabe $VIM/gvimrc +Note that this file will be overwritten each time you update MacVim, so it is +better to keep your own modifications inside "~/.gvimrc". + + *macvim-windows* +There is some confusion regarding the term "window" in MacVim since it means +one thing to Vim and another to MacVim. A "window" in Vim is what opens up +when you type ":sp", whereas a "window" in MacVim is the GUI window which +contains the text view, scrollbars, toolbar and tabline. To avoid confusion, +the former is referred to as a Vim-window, whereas the latter is simply called +a window. + + *macvim-encoding* +It is not possible to modify 'termencoding' in MacVim; this option is forcibly +set to "utf-8". The option 'encoding' also defaults to "utf-8" (as opposed to +"latin1" in the other GUI ports). + +Note: UTF-8 can represent all characters defined in Unicode, which includes +all characters in all other standard encodings, so it should be perfectly safe +to edit files in any encoding while 'encoding' is set to "utf-8". Of course, +you may need to set 'fileencodings' to auto-detect the encoding of the files +you edit, or force the detection with |++enc| on the command line. + +However, if you are editing files that use multiple encodings (container +formats like MIME or Unix mbox files) or no standard encoding (binary data, +see also |edit-binary|), you may want to prevent MacVim from re-encoding the +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 make (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 +current selection with that character. MacVim can emulate this kind of +behaviour (by providing key bindings and by setting 'keymodel' and +'selectmode' to non-default values) although it is not enabled by default. To +make MacVim behave more like TextEdit and less like Vim, add the following +lines to your "~/.vimrc" (not .gvimrc) file: > + if has("gui_macvim") + let macvim_hig_shift_movement = 1 + endif +< + *macvim-drag-n-drop* +Dragging files and dropping them on a window opens those files in tabs in that +window, unless Vim is in command-line mode. In command-line mode the names of +the files are added to the command line. Holding down modifier keys whilst +dragging is not supported. + + *macvim-default-menu* +The default menu in MacVim has been changed to conform better with the Apple +Human Interface Guidelines (HIG). At the moment this breaks the localized +menus, so only English menus are supported. + +Note: The menus are a work in progress. If you know something about the HIG +and want to contribute to MacVim you could do so by making the menus better. + + *macvim-window-title* +The default window title does not include the argument list because it looks +really bad once you start using tabs. For example, dropping two files, then +dropping two more, and switching back to the first tab would cause weird +strings like "((3) of 2)" to appear in the window title. + + *macvim-options* +These are the non-standard options that MacVim supports: + 'toolbariconsize' 'transparency' + +============================================================================== +2. Starting MacVim *macvim-start* + +The easiest way to start MacVim is by double-clicking its icon in the Finder, +but most users will probably prefer to use the Terminal. First some Finder +related ways of starting MacVim are described, then Terminal is discussed. +Note that you can put MacVim anywhere on your hard drive, but in this help +file it is assumed that you have put it inside your /Applications folder. + +MacVim automatically registers itself as an editor of several standard file +formats. This enables you to double-click a file to open it with MacVim (if +it is not associated with another program), or to right-click a file to bring +up the "Open with" menu. You can also drag and drop files onto the Dock icon +to open them in tabs in a new window, or you can drop them in an already open +window to open the files in tabs in that specific window. Finally, you can +use Mac OS X System Services to open files in MacVim, see |macvim-services|. + +There are essentially two ways to start MacVim from Terminal: either call the +Vim binary with the -g switch > + /Applications/MacVim.app/Contents/MacOS/Vim -g file ... +or use the "open" command (which is of limited use since it cannot be used to +pass parameters to Vim) > + open -a MacVim file ... +< + *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 > + ~/Applications ~/Applications/vim + /Applications /Applications/vim + /Applications/Utilities /Applications/Utilities/vim +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. + +Once in terminal Vim it is possible to start MacVim by using the following +command: + :gui [++opt] [+cmd] [-f|-b] [files...] +Note: Forking ("-b") currently does not work. + +============================================================================== +3. Special colors *macvim-colors* + +The colors in MacVim are defined in two dictionaries inside the "Resources" +folder of the application bundle (MacVim.app/Contents/Resources). It is +possible to add more colors by modifying these files. Color names are case +insensitive when accessed from Vim, but in the dictionary they must be +lowercase. + + *SystemColors.plist* +There are only a few system colors that can be accessed from Vim. These +colors are defined in the dictionary "SystemColors.plist". This dictionary +stores (key, value) pairs where the key is the name of the color and the +value is an NSColor selector name. + +The most useful system colors are: > + MacSelectedTextBackgroundColor + MacSecondarySelectedColor +The former is the "Highlight Color" which can be changed in the "Appearance" +section of the System Preferences. The latter is the selection color used by +a Cocoa application when it is not in focus. + + *Colors.plist* +Apart from the system colors, it is also possible to use the standard X11 +color names (see http://en.wikipedia.org/wiki/X11_color_names) which usually +come in a file called "rgb.txt". MacVim does not have such a file, instead it +keeps these colors in a dictionary called "Colors.plist". The key in this +dictionary is the name of the color and the value is an RGB value on the form +#rrggbb stored as an integer. + + *macvim-colorscheme* +MacVim ships with a custom colorscheme that can be used as an alternative to +the default Vim colorscheme. You can try it out by typing: > + :colorscheme macvim +The colorscheme uses the the system "Highlight Color", which can be changed in +the "Appearance" pane of the System Preferences. It also changes the +highlight color when a window becomes inactive. + +If you have any comments regarding this colorscheme (is it better or worse +than the default?) then post them to vim_mac. + +============================================================================== +4. Menus *macvim-menus* + + *:macm* *:macmenukey* +MacVim has a special way of binding keys to menu items that differs from other +Vim GUI ports. A menu binding is called a "key equivalent" in Mac OS X +terminology, this is displayed on the right side of a menu item. The +":macmenukey" command is used to set the key equivalent of a menu item. This +command takes two parameters, the first names the menu item to bind to, the +second gives the key combination. For example: > + :macmenukey File.New\ Tab +This sets the key equivalent of the "New Tab" menu item under the "File" menu +to Cmd+t. + +Note that key equivalents: + * must contain the Cmd modifier flag () + * take precedence over normal mappings made with ":map" + * can only be modified during startup (e.g. in .gvimrc) + +It is possible to reset a key equivalent by calling :macmenukey with a menu +name but no key. This is so that the default key equivalents can be reset in +"~/.gvimrc". For example, if you would like to free up (which is the +key equivalent of "File.Save") then add the following line to "~/.gvimrc": > + macmenukey File.Save +Now you can use :map to bind to whatever you like. + +It is not necessary to reset a key equivalent if all you want to do is to +change the key equivalent of a menu item. For example, say you want to use + as the key equivalent for "Next Tab", then add the following line +to "~/.gvimrc": > + macmenukey Window.Next\ Tab +< + *:maca* *:macaction* +It is typical for menu items in Cocoa applications to bind to Objective-C +selectors. To support this, MacVim introduces the ":macaction" command. This +command takes the name of an action message as its only parameter. (An action +message is an Objective-C message with "void" return type and a single +parameter of type "id".) For example, the "New Window" menu item on the +"File" menu is created in the following manner: > + :an 10.290 File.New\ Window :macaction newWindow: + +Note 1: A menu item which is bound to ":macaction" will automatically be bound +to that action in all modes (as if ":an" was used). It is not possible to +bind to ":macaction" in one mode only. +Note 2: The action is "nil-targeted", which means it is passed down the first +responder chain. + + *Actions.plist* +Some action messages would not be suitable to call from within Vim, so there +is a dictionary called "Actions.plist" (in the Resources folder of the +application bundle) which contains all actions that may be called. The key in +this dictionary is the name of the action message (case sensitive), the value +is not used. + +Here is a random assortment of actions from Actions.plist which might be +useful. + +Action Description ~ +fontSizeDown: Decrease font size +fontSizeUp: Increase font size +newWindow: Open a new (empty) window +orderFrontCharacterPalette: Show the the "Special Characters" dialog +orderFrontFontPanel: Show the Font panel +performZoom: Zoom window (same as clicking the green blob) +selectNextWindow: Select next window (similar to ) +selectPreviousWindow: Select previous window (similar to ) + +As an example, to map to performZoom: you could do something like this: > + :map :macaction performZoom: +A better way to map to performZoom: would be to set the key equivalent of the +menu item "Window.Zoom" to the above action. This can be done by adding the +following line to "~/.gvimrc": > + macmenukey Window.Zoom +(Note that key equivalents must contain the 'D' flag.) + +============================================================================== +5. Toolbar *macvim-toolbar* + +The toolbar in MacVim works just like in the other GUIs (see |gui-toolbar|), +with the addition of two separator items (see |menu-separator|). You can use +them as follows: > + :an ToolBar.-space1- + :an ToolBar.-flexspace2- +The first example creates an empty space on the toolbar, the second creates an +empty space which will shink or expand so that the items to the right of it +are right-aligned. A space (flexspace) will be created for any toolbar item +whose name begins with "-space" ("-flexspace") and ends with "-" + +Note: Only a subset of the builtin toolbar items presently have icons. If no +icon can be found a warning triangle is displayed instead. + +============================================================================== +6. Dialogs *macvim-dialogs* + +Dialogs can be controlled with the keyboard in two ways. By default each +button in a dialog is bound to a key. The button that is highlighted by blue +is bound to Enter, and any button with the title "Cancel" is bound to Escape. +Other buttons are usually bound to the first letter in the title of the +button. There is no visual feedback to indicate which letter a button is +bound to, so sometimes some experimentation might be required in order to +figure out which key to press. + +The second way of controlling dialogs with the keyboard is to enable "Full +keyboard access" in the "Keyboard & Mouse" pane of the System Preferences (you +can also toggle this on or off by pressing Ctrl-F7). Once keyboard access is +enabled it is possible to move between buttons with Tab and pressing Space to +select the current button. The current button is indicated with a blue +outline. + +============================================================================== +7. System services *macvim-services* + +MacVim supports a few system services. These can be accessed from the MacVim +submenu in the Services menu. For services to work, MacVim.app should be +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 Tab Containing Selection: Opens a new tab in the topmost window and + pastes the currently selected text in that tab. A new window will be + opened if necessary. +* Open Selected File in Tab: If the selected text represents a file + name, then the corresponding file is opened in a new tab in the topmost + window. +* Open Selected File in Window: Same as the above, but always open in a new + window. + +============================================================================== +8. Known bugs/missing features *macvim-todo* + +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. + +- Localized menus are not supported. Choosing anything but "English" in the + "International" pane of "System Prefences" may break the menus (and + toolbar). +- Composing characters are not supported, they will mess up the display +- Sometimes multibyte characters look "too wide", i.e. they overlap the + following character. It might help to change 'ambiwidth'. +- Printing +- No find/replace dialog + +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 feature +X in MacVim then voice your opinion on the vim_mac mailing list; it might be +simple to implement, but unless somebody asks for a particular feature then +there is little incentive to add it. + +============================================================================== +9. Hints *macvim-hints* + +In this section some general (not necessarily MacVim specific) hints are +given. + +Scenario: ~ +You try opening a bunch of files in tabs but not all files get +opened in their own tab. +Solution: ~ +To get around this, set 'tabpagemax' to something big in your +.gvimrc file (e.g. ":set tabpagemax=100"). + +Scenario: ~ +You want to open a file in a tab in an already opened window, but typing +"mvim filename" in Terminal opens it up in a separate window. +Solution: ~ +Use the |--remote-tab| switch. If you have several windows open you +might have to specify which window you want the file to open in by using the +|--servername| switch. The title of a window usually ends in something like +"VIM" or "VIM3" --- this is the server name of that window. So to open a file +named "foobar.txt" in a window whose title ends in "VIM3" you would type (the +order of the arguments matters): > + mvim --servername VIM3 --remote-tab foobar.txt +For more information, consult the |client-server| manual page. + +Scenario: ~ +You like to be able to select text by holding down shift and +pressing the arrow keys and find the Vim way of selecting text strange. +Solution: ~ +See |macvim-shift-movement|. + +Scenario: ~ +You do not want MacVim to set up any key mappings. +Solution: ~ +See |macvim-movement|. + +Scenario: ~ +Enabling localized menus breaks the toolbar and the menus as well. +Solution: ~ +This is a know problem, see |macvim-todo|. + +Scenario: ~ +You dislike the default font (DejaVu Sans Mono). +Solution: ~ +The standard fixed width font on other Mac OS X applications is +Monaco. If you prefer this font then add the following line to your +"~/.gvimrc" (note that Monaco does not come in italic and bold variants): > + set guifont=Monaco:h10 +The suffix ":h10" specifies the point size of the font should be "10" (see +'guifont' for more information on how to set the font). + +Scenario: ~ +When you click the (green) zoom button you want the window to maximize +horizontally as well as vertically. +Solution: ~ +Hold down Cmd and click the zoom button. + +Scenario: ~ +Typing feels sluggish when the cursor is just before a right bracket (i.e. ')', +'}', or ']'). +Solution: ~ +Disable the "matchparen" plugin (see |matchparen|) by typing :NoMatchParen. +If that helps, then you can permanently disable "matchparen" by adding the +following line to your "~/.vimrc": > + let loaded_matchparen=1 +< + +Scenario: ~ +You can't find the information on MacVim you thought should be in +this manual page. +Solution: ~ +Post your question on the vim_mac mailing list and wait for an +answer. + + vim:tw=78:sw=4:ts=8:ft=help:norl: diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index 5bc8800e..9f4f3440 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -1,4 +1,4 @@ -*help.txt* For Vim version 7.1. Last change: 2006 Nov 07 +*help.txt* For Vim version 7.1. Last change: 2007 Sep 18 VIM - main help file k @@ -152,6 +152,7 @@ GUI ~ |gui_w16.txt| Windows 3.1 GUI |gui_w32.txt| Win32 GUI |gui_x11.txt| X11 GUI +|gui_mac.txt| MacVim GUI Interfaces ~ |if_cscop.txt| using Cscope with Vim diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index f587cc90..7ef0a2be 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1,4 +1,4 @@ -*index.txt* For Vim version 7.1. Last change: 2007 May 05 +*index.txt* For Vim version 7.1. Last change: 2007 Sep 18 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1039,6 +1039,7 @@ The commands are sorted on the non-optional part of their name. |:abbreviate| :ab[breviate] enter abbreviation |:abclear| :abc[lear] remove all abbreviations |:aboveleft| :abo[veleft] make split window appear left or above +|:action| :ac[tion] send action message |:all| :al[l] open a window for each file in the argument list |:amenu| :am[enu] enter new menu item for all modes @@ -1295,6 +1296,7 @@ The commands are sorted on the non-optional part of their name. |:marks| :marks list all marks |:match| :mat[ch] define a match to highlight |:menu| :me[nu] enter a new menu item +|:menukeyequiv| :menuk[eyequiv] set key equivalent for menu item |:menutranslate| :menut[ranslate] add a menu translation item |:messages| :mes[sages] view previously displayed messages |:mkexrc| :mk[exrc] write current mappings and settings to a file diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 9ee98502..5cfd8a68 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.1. Last change: 2007 Aug 10 +*options.txt* For Vim version 7.1. Last change: 2007 Sep 30 VIM REFERENCE MANUAL by Bram Moolenaar @@ -669,13 +669,14 @@ A jump table for the options with a short description can be found at |Q_op|. 'antialias' 'anti' boolean (default: off) global {not in Vi} - {only available when compiled with GUI enabled + {only available when compiled with Carbon GUI enabled on Mac OS X} - This option only has an effect in the GUI version of Vim on Mac OS X - v10.2 or later. When on, Vim will use smooth ("antialiased") fonts, - which can be easier to read at certain sizes on certain displays. - Setting this option can sometimes cause problems if 'guifont' is set - to its default (empty string). + This option only has an effect in the Carbon GUI version of Vim on Mac + OS X v10.2 or later. When on, Vim will use smooth ("antialiased") + fonts, which can be easier to read at certain sizes on certain + displays. Setting this option can sometimes cause problems if + 'guifont' is set to its default (empty string). + Note: Antialiasing is handled automatically on MacVim. *'autochdir'* *'acd'* *'noautochdir'* *'noacd'* 'autochdir' 'acd' boolean (default off) @@ -2345,8 +2346,8 @@ A jump table for the options with a short description can be found at |Q_op|. It should normally be kept at its default value, or set when Vim starts up. See |multibyte|. To reload the menus see |:menutrans|. - NOTE: For GTK+ 2 it is highly recommended to set 'encoding' to - "utf-8". Although care has been taken to allow different values of + NOTE: For MacVim and GTK+ 2 it is highly recommended to set 'encoding' + to "utf-8". Although care has been taken to allow different values of 'encoding', "utf-8" is the natural choice for the environment and avoids unnecessary conversion overhead. "utf-8" has not been made the default to prevent different behavior of the GUI and terminal @@ -3027,8 +3028,8 @@ A jump table for the options with a short description can be found at |Q_op|. The expression may be evaluated in the |sandbox|, see |sandbox-option|. - *'fsync'* *'fs'* -'fsync' 'fs' boolean (default on) + *'fsync'* *'fs'* *'nofsync'* *'nofs'* +'fsync' 'fs' boolean (default on) global {not in Vi} When on, the library function fsync() will be called after writing a @@ -3041,6 +3042,20 @@ A jump table for the options with a short description can be found at |Q_op|. off. Also see 'swapsync' for controlling fsync() on swap files. + *'fullscreen'* *'fu'* *'nofullscreen'* *'nofu'* +'fullscreen' 'fu' boolean (default off) + global + {not in Vi} + {only available in the MacVim GUI} + When this option is set, the whole screen is covered by vim. Screen + decorations drawn by the operating system (such as the dock or the + menu bar) are hidden. Most of vim's window chrome is hidden as well + (e.g. toolbar, title bar). The tab bar and scroll bars remains visible. + + Most of the screen is black, only a 'columns' x 'lines' part of the + screen is covered by the actual vim control. The control is centered. + Updates to the window position are ignored in fullscreen mode. + *'gdefault'* *'gd'* *'nogdefault'* *'nogd'* 'gdefault' 'gd' boolean (default off) global @@ -3209,6 +3224,9 @@ A jump table for the options with a short description can be found at |Q_op|. For Win32, GTK, Mac OS and Photon: > :set guifont=* < will bring up a font requester, where you can pick the font you want. + In MacVim ":set guifont=*" calls: > + :action orderFrontFontPanel: +< which is the same as choosing "Show Fonts..." from the main menu. The font name depends on the GUI used. See |setting-guifont| for a way to set 'guifont' for various systems. @@ -3217,12 +3235,15 @@ A jump table for the options with a short description can be found at |Q_op|. :set guifont=Andale\ Mono\ 11 < That's all. XLFDs are no longer accepted. - For Mac OSX you can use something like this: > + For Mac OS X you can use something like this: > :set guifont=Monaco:h10 -< Also see 'macatsui', it can help fix display problems. +< Also see 'macatsui', it can help fix display problems {not in MacVim}. + In MacVim, fonts with spaces are set like this: > + :set guifont=DejaVu\ Sans\ Mono:h13 +< *E236* Note that the fonts must be mono-spaced (all characters have the same - width). An exception is GTK 2: all fonts are accepted, but + width). An exception is MacVim and GTK 2: all fonts are accepted, but mono-spaced fonts look best. To preview a font on X11, you might be able to use the "xfontsel" @@ -3286,7 +3307,7 @@ A jump table for the options with a short description can be found at |Q_op|. Note: The size of these fonts must be exactly twice as wide as the one specified with 'guifont' and the same height. - All GUI versions but GTK+ 2: + All GUI versions but MacVim and GTK+ 2: 'guifontwide' is only used when 'encoding' is set to "utf-8" and 'guifontset' is empty or invalid. @@ -3294,6 +3315,11 @@ A jump table for the options with a short description can be found at |Q_op|. 'guifontwide' is empty Vim will attempt to find a matching double-width font and set 'guifontwide' to it. + MacVim only: *guifontwide_macvim* + + MacVim performs automatic font substitution, setting 'guifontwide' has + no effect. + GTK+ 2 GUI only: *guifontwide_gtk2* If set and valid, 'guifontwide' is always used for double width @@ -4350,7 +4376,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'macatsui'* *'nomacatsui'* 'macatsui' boolean (default on) global - {only available in Mac GUI version} + {only available in Mac Carbon GUI version} This is a workaround for when drawing doesn't work properly. When set and compiled with multi-byte support ATSUI text drawing is used. When not set ATSUI text drawing is not used. Switch this option off when @@ -4362,6 +4388,7 @@ A jump table for the options with a short description can be found at |Q_op|. endif < Another option to check if you have drawing problems is 'termencoding'. + Note: MacVim does not use this option. *'magic'* *'nomagic'* 'magic' boolean (default on) @@ -6700,8 +6727,9 @@ A jump table for the options with a short description can be found at |Q_op|. For further details see |arabic.txt|. *'termencoding'* *'tenc'* -'termencoding' 'tenc' string (default ""; with GTK+ 2 GUI: "utf-8"; with - Macintosh GUI: "macroman") +'termencoding' 'tenc' string (default "" + with GTK+ 2 and MacVim GUIs: "utf-8" + with Macintosh (Carbon) GUI: "macroman") global {only available when compiled with the |+multi_byte| feature} @@ -6710,14 +6738,14 @@ A jump table for the options with a short description can be found at |Q_op|. encoding the keyboard produces and the display will understand. For the GUI it only applies to the keyboard ('encoding' is used for the display). Except for the Mac when 'macatsui' is off, then - 'termencoding' should be "macroman". + 'termencoding' should be "macroman" (for the Carbon GUI). In the Win32 console version the default value is the console codepage when it differs from the ANSI codepage. *E617* - Note: This does not apply to the GTK+ 2 GUI. After the GUI has been - successfully initialized, 'termencoding' is forcibly set to "utf-8". - Any attempts to set a different value will be rejected, and an error - message is shown. + Note: This does not apply to the GTK+ 2 and MacVim GUIs. After the + GUI has been successfully initialized, 'termencoding' is forcibly set + to "utf-8". Any attempts to set a different value will be rejected, + and an error message is shown. For the Win32 GUI 'termencoding' is not used for typed characters, because the Win32 system always passes Unicode characters. When empty, the same encoding is used as for the 'encoding' option. @@ -6954,8 +6982,8 @@ A jump table for the options with a short description can be found at |Q_op|. *'toolbar'* *'tb'* 'toolbar' 'tb' string (default "icons,tooltips") global - {only for |+GUI_GTK|, |+GUI_Athena|, |+GUI_Motif| and - |+GUI_Photon|} + {only for |+GUI_GTK|, |+GUI_Athena|, |+GUI_Motif|, + |+GUI_Photon| and |gui_macvim|} The contents of this option controls various toolbar settings. The possible values are: icons Toolbar buttons are shown with icons. @@ -6965,6 +6993,7 @@ A jump table for the options with a short description can be found at |Q_op|. tooltips Tooltips are active for toolbar buttons. Tooltips refer to the popup help text which appears after the mouse cursor is placed over a toolbar button for a brief moment. + Note: Tooltips are always enabled in MacVim. If you want the toolbar to be shown with icons as well as text, do the following: > @@ -6982,7 +7011,7 @@ A jump table for the options with a short description can be found at |Q_op|. 'toolbariconsize' 'tbis' string (default "small") global {not in Vi} - {only in the GTK+ 2 GUI} + {only in the GTK+ 2 and MacVim GUIs} Controls the size of toolbar icons. The possible values are: tiny Use tiny toolbar icons. small Use small toolbar icons (default). @@ -6990,11 +7019,21 @@ A jump table for the options with a short description can be found at |Q_op|. large Use large toolbar icons. The exact dimensions in pixels of the various icon sizes depend on the current theme. Common dimensions are large=32x32, medium=24x24, - small=20x20 and tiny=16x16. + small=20x20 and tiny=16x16. In MacVim, both tiny and small equal + 24x24, whereas medium and large equal 32x32. If 'toolbariconsize' is empty, the global default size as determined by user preferences or the current theme is used. + *'transparency'* *'transp'* +'transparency' 'transp' number (default 0) + global + {not in Vi} + {only in MacVim GUI} + Transparency of the window background as a percent, with 0 meaning + opaque and 100 meaning completely transparent. Trying to set a value + outside the range 0-100 results in an error. + *'ttybuiltin'* *'tbi'* *'nottybuiltin'* *'notbi'* 'ttybuiltin' 'tbi' boolean (default on) global diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 0f05d8b0..e47495b8 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1,4 +1,4 @@ -*quickref.txt* For Vim version 7.1. Last change: 2007 May 11 +*quickref.txt* For Vim version 7.1. Last change: 2007 Oct 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -696,6 +696,7 @@ Short explanation of each option: *option-list* 'formatprg' 'fp' name of external program used with "gq" command 'formatexpr' 'fex' expression used with "gq" command 'fsync' 'fs' whether to invoke fsync() after file write +'fullscreen' 'fu' let vim cover the whole screen (MacVim only) 'gdefault' 'gd' the ":substitute" flag 'g' is default on 'grepformat' 'gfm' format of 'grepprg' output 'grepprg' 'gp' program to use for ":grep" @@ -890,7 +891,8 @@ Short explanation of each option: *option-list* 'titleold' old title, restored when exiting 'titlestring' string to use for the Vim window title 'toolbar' 'tb' GUI: which items to show in the toolbar -'toolbariconsize' 'tbis' size of the toolbar icons (for GTK 2 only) +'toolbariconsize' 'tbis' size of the toolbar icons (MacVim and GTK 2 only) +'transparency' 'transp' transparency of the GUI window (MacVim only) 'ttimeout' time out on mappings 'ttimeoutlen' 'ttm' time out time for key codes in milliseconds 'ttybuiltin' 'tbi' use built-in termcap before external termcap diff --git a/runtime/doc/remote.txt b/runtime/doc/remote.txt index 5b328c1f..f4523c34 100644 --- a/runtime/doc/remote.txt +++ b/runtime/doc/remote.txt @@ -1,4 +1,4 @@ -*remote.txt* For Vim version 7.1. Last change: 2006 Apr 30 +*remote.txt* For Vim version 7.1. Last change: 2007 Sep 18 VIM REFERENCE MANUAL by Bram Moolenaar @@ -9,6 +9,7 @@ Vim client-server communication *client-server* 1. Common functionality |clientserver| 2. X11 specific items |x11-clientserver| 3. MS-Windows specific items |w32-clientserver| +4. MacVim specific items |macvim-clientserver| {Vi does not have any of these commands} @@ -198,4 +199,23 @@ When using gvim, the --remote-wait only works properly this way: > start /w gvim --remote-wait file.txt < +============================================================================== +4. MacVim specific items *macvim-clientserver* + +MacVim uses distributed objects for interprocess communication. A server +listens to a named port for new connections, and clients connect to this port +to send messages. Server listings are made possible by the frontend (MacVim) +keeping a list of all currently running servers. Thus, server are not aware +of each other directly; only MacVim knows which servers are running. + +A client is any object which implements the MMVimClientProtocol (see +MacVim.h). Take a look at MMBackend if you wish to implement this protocol in +your own application. The current implementation assumes that the +NSConnections use mach ports for interprocess communication. This means that +you can only use Vim's client/server feature on a local machine (and not +across a network). + +Note: Client mode always works, but server mode only works when the GUI is +started. + vim:tw=78:sw=4:ts=8:ft=help:norl: diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index acde5428..70a111da 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 7.1. Last change: 2007 May 11 +*syntax.txt* For Vim version 7.1. Last change: 2007 Oct 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -4066,8 +4066,8 @@ guisp={color-name} *highlight-guisp* Black White Orange Purple Violet - In the Win32 GUI version, additional system colors are available. See - |win32-colors|. + In the Win32 and MacVim GUI versions, additional system colors are + available. See |win32-colors| and |macvim-colors| respectively. You can also specify a color by its Red, Green and Blue values. The format is "#rrggbb", where diff --git a/runtime/doc/tags b/runtime/doc/tags index 73930066..a91c2abf 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -244,6 +244,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'fs' options.txt /*'fs'* 'fsync' options.txt /*'fsync'* 'ft' options.txt /*'ft'* +'fu' options.txt /*'fu'* +'fullscreen' options.txt /*'fullscreen'* 'gcr' options.txt /*'gcr'* 'gd' options.txt /*'gd'* 'gdefault' options.txt /*'gdefault'* @@ -500,6 +502,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'nofk' options.txt /*'nofk'* 'nofkmap' options.txt /*'nofkmap'* 'nofoldenable' options.txt /*'nofoldenable'* +'nofs' options.txt /*'nofs'* +'nofsync' options.txt /*'nofsync'* +'nofu' options.txt /*'nofu'* +'nofullscreen' options.txt /*'nofullscreen'* 'nogd' options.txt /*'nogd'* 'nogdefault' options.txt /*'nogdefault'* 'noguipty' options.txt /*'noguipty'* @@ -979,6 +985,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'top' options.txt /*'top'* 'tpm' options.txt /*'tpm'* 'tr' options.txt /*'tr'* +'transp' options.txt /*'transp'* +'transparency' options.txt /*'transparency'* 'ts' options.txt /*'ts'* 'tsl' options.txt /*'tsl'* 'tsr' options.txt /*'tsr'* @@ -1227,6 +1235,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* --servername remote.txt /*--servername* --socketid starting.txt /*--socketid* --version starting.txt /*--version* +--windowid starting.txt /*--windowid* -A starting.txt /*-A* -C starting.txt /*-C* -D starting.txt /*-D* @@ -2316,6 +2325,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :lwindow quickfix.txt /*:lwindow* :m change.txt /*:m* :ma motion.txt /*:ma* +:maca gui_mac.txt /*:maca* +:macaction gui_mac.txt /*:macaction* +:macm gui_mac.txt /*:macm* +:macmenukey gui_mac.txt /*:macmenukey* :mak quickfix.txt /*:mak* :make quickfix.txt /*:make* :make_makeprg quickfix.txt /*:make_makeprg* @@ -3147,6 +3160,7 @@ A insert.txt /*A* ACL editing.txt /*ACL* ATTENTION usr_11.txt /*ATTENTION* Abbreviations map.txt /*Abbreviations* +Actions.plist gui_mac.txt /*Actions.plist* Aleph options.txt /*Aleph* Amiga os_amiga.txt /*Amiga* Arabic arabic.txt /*Arabic* @@ -3299,6 +3313,7 @@ Cmdline-mode cmdline.txt /*Cmdline-mode* CmdwinEnter autocmd.txt /*CmdwinEnter* CmdwinLeave autocmd.txt /*CmdwinLeave* ColorScheme autocmd.txt /*ColorScheme* +Colors.plist gui_mac.txt /*Colors.plist* Command-line cmdline.txt /*Command-line* Command-line-mode cmdline.txt /*Command-line-mode* Contents quickref.txt /*Contents* @@ -4079,8 +4094,13 @@ E794 eval.txt /*E794* E795 eval.txt /*E795* E796 editing.txt /*E796* E797 spell.txt /*E797* +E798 eval.txt /*E798* +E799 eval.txt /*E799* E80 message.txt /*E80* E800 arabic.txt /*E800* +E801 eval.txt /*E801* +E802 eval.txt /*E802* +E803 eval.txt /*E803* E81 map.txt /*E81* E82 message.txt /*E82* E83 message.txt /*E83* @@ -4295,6 +4315,7 @@ StdinReadPost autocmd.txt /*StdinReadPost* StdinReadPre autocmd.txt /*StdinReadPre* SwapExists autocmd.txt /*SwapExists* Syntax autocmd.txt /*Syntax* +SystemColors.plist gui_mac.txt /*SystemColors.plist* T motion.txt /*T* TCL if_tcl.txt /*TCL* TERM starting.txt /*TERM* @@ -4777,6 +4798,7 @@ chill.vim syntax.txt /*chill.vim* cindent() eval.txt /*cindent()* cinkeys-format indent.txt /*cinkeys-format* cinoptions-values indent.txt /*cinoptions-values* +clearmatches() eval.txt /*clearmatches()* client-server remote.txt /*client-server* clientserver remote.txt /*clientserver* clipboard gui.txt /*clipboard* @@ -5649,6 +5671,7 @@ getftype() eval.txt /*getftype()* getlatestvimscripts-install pi_getscript.txt /*getlatestvimscripts-install* getline() eval.txt /*getline()* getloclist() eval.txt /*getloclist()* +getmatches() eval.txt /*getmatches()* getpos() eval.txt /*getpos()* getqflist() eval.txt /*getqflist()* getreg() eval.txt /*getreg()* @@ -5727,6 +5750,7 @@ gui-gtk-socketid gui_x11.txt /*gui-gtk-socketid* gui-horiz-scroll gui.txt /*gui-horiz-scroll* gui-init gui.txt /*gui-init* gui-kde gui_x11.txt /*gui-kde* +gui-macvim gui_mac.txt /*gui-macvim* gui-mouse gui.txt /*gui-mouse* gui-mouse-focus gui.txt /*gui-mouse-focus* gui-mouse-mapping gui.txt /*gui-mouse-mapping* @@ -5752,6 +5776,7 @@ gui-w32-dialogs gui_w32.txt /*gui-w32-dialogs* gui-w32-printing gui_w32.txt /*gui-w32-printing* gui-w32-start gui_w32.txt /*gui-w32-start* gui-w32-various gui_w32.txt /*gui-w32-various* +gui-w32-windowid gui_w32.txt /*gui-w32-windowid* gui-w32s gui_w32.txt /*gui-w32s* gui-win32-maximized gui_w32.txt /*gui-win32-maximized* gui-x11 gui_x11.txt /*gui-x11* @@ -5766,10 +5791,12 @@ gui-x11-printing gui_x11.txt /*gui-x11-printing* gui-x11-start gui_x11.txt /*gui-x11-start* gui-x11-various gui_x11.txt /*gui-x11-various* gui.txt gui.txt /*gui.txt* +gui_mac.txt gui_mac.txt /*gui_mac.txt* gui_w16.txt gui_w16.txt /*gui_w16.txt* gui_w32.txt gui_w32.txt /*gui_w32.txt* gui_x11.txt gui_x11.txt /*gui_x11.txt* guifontwide_gtk2 options.txt /*guifontwide_gtk2* +guifontwide_macvim options.txt /*guifontwide_macvim* guioptions_a options.txt /*guioptions_a* guu change.txt /*guu* gv visual.txt /*gv* @@ -5801,7 +5828,6 @@ hebrew.txt hebrew.txt /*hebrew.txt* help various.txt /*help* help-context help.txt /*help-context* help-summary usr_02.txt /*help-summary* -help-tags tags 1 help-translated various.txt /*help-translated* help-xterm-window various.txt /*help-xterm-window* help.txt help.txt /*help.txt* @@ -6214,6 +6240,27 @@ mac-lack os_mac.txt /*mac-lack* mac-vimfile os_mac.txt /*mac-vimfile* macintosh os_mac.txt /*macintosh* macro map.txt /*macro* +macvim gui_mac.txt /*macvim* +macvim-clientserver remote.txt /*macvim-clientserver* +macvim-colors gui_mac.txt /*macvim-colors* +macvim-colorscheme gui_mac.txt /*macvim-colorscheme* +macvim-default-menu gui_mac.txt /*macvim-default-menu* +macvim-dialogs gui_mac.txt /*macvim-dialogs* +macvim-differences gui_mac.txt /*macvim-differences* +macvim-drag-n-drop gui_mac.txt /*macvim-drag-n-drop* +macvim-encoding gui_mac.txt /*macvim-encoding* +macvim-hints gui_mac.txt /*macvim-hints* +macvim-important gui_mac.txt /*macvim-important* +macvim-menus gui_mac.txt /*macvim-menus* +macvim-movement gui_mac.txt /*macvim-movement* +macvim-options gui_mac.txt /*macvim-options* +macvim-services gui_mac.txt /*macvim-services* +macvim-shift-movement gui_mac.txt /*macvim-shift-movement* +macvim-start gui_mac.txt /*macvim-start* +macvim-todo gui_mac.txt /*macvim-todo* +macvim-toolbar gui_mac.txt /*macvim-toolbar* +macvim-window-title gui_mac.txt /*macvim-window-title* +macvim-windows gui_mac.txt /*macvim-windows* mail-list intro.txt /*mail-list* mail.vim syntax.txt /*mail.vim* maillist intro.txt /*maillist* @@ -6264,7 +6311,9 @@ masm.vim syntax.txt /*masm.vim* match() eval.txt /*match()* match-highlight pattern.txt /*match-highlight* match-parens tips.txt /*match-parens* +matchadd() eval.txt /*matchadd()* matcharg() eval.txt /*matcharg()* +matchdelete() eval.txt /*matchdelete()* matchend() eval.txt /*matchend()* matchit-install usr_05.txt /*matchit-install* matchlist() eval.txt /*matchlist()* @@ -6353,6 +6402,7 @@ multilang mlang.txt /*multilang* multilang-menus mlang.txt /*multilang-menus* multilang-messages mlang.txt /*multilang-messages* multilang-scripts mlang.txt /*multilang-scripts* +mvim gui_mac.txt /*mvim* myfiletypefile syntax.txt /*myfiletypefile* myscriptsfile syntax.txt /*myscriptsfile* mysql sql.txt /*mysql* @@ -7000,6 +7050,7 @@ setbufvar() eval.txt /*setbufvar()* setcmdpos() eval.txt /*setcmdpos()* setline() eval.txt /*setline()* setloclist() eval.txt /*setloclist()* +setmatches() eval.txt /*setmatches()* setpos() eval.txt /*setpos()* setqflist() eval.txt /*setqflist()* setreg() eval.txt /*setreg()* diff --git a/runtime/menu.vim b/runtime/menu.vim index 8924206c..76334193 100644 --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -17,7 +17,8 @@ if !exists("did_install_default_menus") let did_install_default_menus = 1 -if exists("v:lang") || &langmenu != "" +" Localized menus currently not supported in MacVim +if !has("gui_macvim") && (exists("v:lang") || &langmenu != "") " Try to find a menu translation file for the current language. if &langmenu != "" if &langmenu =~ "none" diff --git a/runtime/optwin.vim b/runtime/optwin.vim index c0cbf2b6..f54ea520 100644 --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -612,6 +612,12 @@ if has("gui") call append("$", "macatsui\tuse ATSUI text drawing; disable to avoid display problems") call OptionG("macatsui", &macatsui) endif + if has("gui_macvim") + call append("$", "transparency\ttransparency of the text background as a percent") + call append("$", " \tset transparency=" . &transp) + call append("$", "fullscreen\tdisplay vim in fullscreen mode") + call BinOptionG("fullscreen", &fullscreen) + endif endif if has("printer") diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 56be4324..5e946bf1 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -16,7 +16,7 @@ syn keyword vimTodo contained COMBAK FIXME TODO XXX syn cluster vimCommentGroup contains=vimTodo,@Spell " regular vim commands {{{2 -syn keyword vimCommand contained ab[breviate] abc[lear] abo[veleft] al[l] arga[dd] argd[elete] argdo arge[dit] argg[lobal] argl[ocal] ar[gs] argu[ment] as[cii] bad[d] ba[ll] bd[elete] be bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bN[ext] bo[tright] bp[revious] brea[k] breaka[dd] breakd[el] breakl[ist] br[ewind] bro[wse] bufdo b[uffer] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] caddb[uffer] cad[dexpr] caddf[ile] cal[l] cat[ch] cb[uffer] cc ccl[ose] cd ce[nter] cex[pr] cf[ile] cfir[st] cgetb[uffer] cgete[xpr] cg[etfile] c[hange] changes chd[ir] che[ckpath] checkt[ime] cla[st] cl[ist] clo[se] cmapc[lear] cnew[er] cn[ext] cN[ext] cnf[ile] cNf[ile] cnorea[bbrev] col[der] colo[rscheme] comc[lear] comp[iler] conf[irm] con[tinue] cope[n] co[py] cpf[ile] cp[revious] cq[uit] cr[ewind] cuna[bbrev] cu[nmap] cw[indow] debugg[reedy] delc[ommand] d[elete] delf[unction] delm[arks] diffg[et] diffoff diffpatch diffpu[t] diffsplit diffthis diffu[pdate] dig[raphs] di[splay] dj[ump] dl[ist] dr[op] ds[earch] dsp[lit] earlier echoe[rr] echom[sg] echon e[dit] el[se] elsei[f] em[enu] emenu* endfo[r] endf[unction] en[dif] endt[ry] endw[hile] ene[w] ex exi[t] exu[sage] f[ile] files filetype fina[lly] fin[d] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] folddoc[losed] foldd[oopen] foldo[pen] for fu[nction] go[to] gr[ep] grepa[dd] ha[rdcopy] h[elp] helpf[ind] helpg[rep] helpt[ags] hid[e] his[tory] ia[bbrev] iabc[lear] if ij[ump] il[ist] imapc[lear] inorea[bbrev] is[earch] isp[lit] iuna[bbrev] iu[nmap] j[oin] ju[mps] k keepalt keepj[umps] kee[pmarks] laddb[uffer] lad[dexpr] laddf[ile] lan[guage] la[st] later lb[uffer] lc[d] lch[dir] lcl[ose] le[ft] lefta[bove] lex[pr] lf[ile] lfir[st] lgetb[uffer] lgete[xpr] lg[etfile] lgr[ep] lgrepa[dd] lh[elpgrep] l[ist] ll lla[st] lli[st] lmak[e] lm[ap] lmapc[lear] lnew[er] lne[xt] lN[ext] lnf[ile] lNf[ile] ln[oremap] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lpf[ile] lp[revious] lr[ewind] ls lt[ag] lu[nmap] lv[imgrep] lvimgrepa[dd] lw[indow] mak[e] ma[rk] marks mat[ch] menut[ranslate] mk[exrc] mks[ession] mksp[ell] mkvie[w] mkv[imrc] mod[e] m[ove] mzf[ile] mz[scheme] nbkey new n[ext] N[ext] nmapc[lear] noh[lsearch] norea[bbrev] nu[mber] nun[map] omapc[lear] on[ly] o[pen] opt[ions] ou[nmap] pc[lose] ped[it] pe[rl] perld[o] po[p] popu popu[p] pp[op] pre[serve] prev[ious] p[rint] P[rint] profd[el] prof[ile] promptf[ind] promptr[epl] ps[earch] pta[g] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptN[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] pyf[ile] py[thon] qa[ll] q[uit] quita[ll] r[ead] rec[over] redi[r] red[o] redr[aw] redraws[tatus] reg[isters] res[ize] ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] rub[y] rubyd[o] rubyf[ile] ru[ntime] rv[iminfo] sal[l] san[dbox] sa[rgument] sav[eas] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbN[ext] sbp[revious] sbr[ewind] sb[uffer] scripte[ncoding] scrip[tnames] se[t] setf[iletype] setg[lobal] setl[ocal] sf[ind] sfir[st] sh[ell] sign sil[ent] sim[alt] sla[st] sl[eep] sm[agic] sm[ap] smapc[lear] sme smenu sn[ext] sN[ext] sni[ff] sno[magic] snor[emap] snoreme snoremenu sor[t] so[urce] spelld[ump] spe[llgood] spelli[nfo] spellr[epall] spellu[ndo] spellw[rong] sp[lit] spr[evious] sre[wind] sta[g] startg[replace] star[tinsert] startr[eplace] stj[ump] st[op] stopi[nsert] sts[elect] sun[hide] sunm[ap] sus[pend] sv[iew] syncbind t tab tabc[lose] tabd[o] tabe[dit] tabf[ind] tabfir[st] tabl[ast] tabm[ove] tabnew tabn[ext] tabN[ext] tabo[nly] tabp[revious] tabr[ewind] tabs ta[g] tags tc[l] tcld[o] tclf[ile] te[aroff] tf[irst] th[row] tj[ump] tl[ast] tm tm[enu] tn[ext] tN[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] tu tu[nmenu] una[bbreviate] u[ndo] undoj[oin] undol[ist] unh[ide] unlo[ckvar] unm[ap] up[date] verb[ose] ve[rsion] vert[ical] vie[w] vim[grep] vimgrepa[dd] vi[sual] viu[sage] vmapc[lear] vne[w] vs[plit] vu[nmap] wa[ll] wh[ile] winc[md] windo winp[os] win[size] wn[ext] wN[ext] wp[revious] wq wqa[ll] w[rite] ws[verb] wv[iminfo] X xa[ll] x[it] xm[ap] xmapc[lear] xme xmenu XMLent XMLns xn[oremap] xnoreme xnoremenu xu[nmap] y[ank] +syn keyword vimCommand contained ab[breviate] abc[lear] abo[veleft] al[l] arga[dd] argd[elete] argdo arge[dit] argg[lobal] argl[ocal] ar[gs] argu[ment] as[cii] bad[d] ba[ll] bd[elete] be bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bN[ext] bo[tright] bp[revious] brea[k] breaka[dd] breakd[el] breakl[ist] br[ewind] bro[wse] bufdo b[uffer] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] caddb[uffer] cad[dexpr] caddf[ile] cal[l] cat[ch] cb[uffer] cc ccl[ose] cd ce[nter] cex[pr] cf[ile] cfir[st] cgetb[uffer] cgete[xpr] cg[etfile] c[hange] changes chd[ir] che[ckpath] checkt[ime] cla[st] cl[ist] clo[se] cmapc[lear] cnew[er] cn[ext] cN[ext] cnf[ile] cNf[ile] cnorea[bbrev] col[der] colo[rscheme] comc[lear] comp[iler] conf[irm] con[tinue] cope[n] co[py] cpf[ile] cp[revious] cq[uit] cr[ewind] cuna[bbrev] cu[nmap] cw[indow] debugg[reedy] delc[ommand] d[elete] delf[unction] delm[arks] diffg[et] diffoff diffpatch diffpu[t] diffsplit diffthis diffu[pdate] dig[raphs] di[splay] dj[ump] dl[ist] dr[op] ds[earch] dsp[lit] earlier echoe[rr] echom[sg] echon e[dit] el[se] elsei[f] em[enu] emenu* endfo[r] endf[unction] en[dif] endt[ry] endw[hile] ene[w] ex exi[t] exu[sage] f[ile] files filetype fina[lly] fin[d] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] folddoc[losed] foldd[oopen] foldo[pen] for fu[nction] go[to] gr[ep] grepa[dd] ha[rdcopy] h[elp] helpf[ind] helpg[rep] helpt[ags] hid[e] his[tory] ia[bbrev] iabc[lear] if ij[ump] il[ist] imapc[lear] inorea[bbrev] is[earch] isp[lit] iuna[bbrev] iu[nmap] j[oin] ju[mps] k keepalt keepj[umps] kee[pmarks] laddb[uffer] lad[dexpr] laddf[ile] lan[guage] la[st] later lb[uffer] lc[d] lch[dir] lcl[ose] le[ft] lefta[bove] lex[pr] lf[ile] lfir[st] lgetb[uffer] lgete[xpr] lg[etfile] lgr[ep] lgrepa[dd] lh[elpgrep] l[ist] ll lla[st] lli[st] lmak[e] lm[ap] lmapc[lear] lnew[er] lne[xt] lN[ext] lnf[ile] lNf[ile] ln[oremap] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lpf[ile] lp[revious] lr[ewind] ls lt[ag] lu[nmap] lv[imgrep] lvimgrepa[dd] lw[indow] mak[e] ma[rk] marks mat[ch] maca[ction] macm[enukey] menut[ranslate] mk[exrc] mks[ession] mksp[ell] mkvie[w] mkv[imrc] mod[e] m[ove] mzf[ile] mz[scheme] nbkey new n[ext] N[ext] nmapc[lear] noh[lsearch] norea[bbrev] nu[mber] nun[map] omapc[lear] on[ly] o[pen] opt[ions] ou[nmap] pc[lose] ped[it] pe[rl] perld[o] po[p] popu popu[p] pp[op] pre[serve] prev[ious] p[rint] P[rint] profd[el] prof[ile] promptf[ind] promptr[epl] ps[earch] pta[g] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptN[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] pyf[ile] py[thon] qa[ll] q[uit] quita[ll] r[ead] rec[over] redi[r] red[o] redr[aw] redraws[tatus] reg[isters] res[ize] ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] rub[y] rubyd[o] rubyf[ile] ru[ntime] rv[iminfo] sal[l] san[dbox] sa[rgument] sav[eas] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbN[ext] sbp[revious] sbr[ewind] sb[uffer] scripte[ncoding] scrip[tnames] se[t] setf[iletype] setg[lobal] setl[ocal] sf[ind] sfir[st] sh[ell] sign sil[ent] sim[alt] sla[st] sl[eep] sm[agic] sm[ap] smapc[lear] sme smenu sn[ext] sN[ext] sni[ff] sno[magic] snor[emap] snoreme snoremenu sor[t] so[urce] spelld[ump] spe[llgood] spelli[nfo] spellr[epall] spellu[ndo] spellw[rong] sp[lit] spr[evious] sre[wind] sta[g] startg[replace] star[tinsert] startr[eplace] stj[ump] st[op] stopi[nsert] sts[elect] sun[hide] sunm[ap] sus[pend] sv[iew] syncbind t tab tabc[lose] tabd[o] tabe[dit] tabf[ind] tabfir[st] tabl[ast] tabm[ove] tabnew tabn[ext] tabN[ext] tabo[nly] tabp[revious] tabr[ewind] tabs ta[g] tags tc[l] tcld[o] tclf[ile] te[aroff] tf[irst] th[row] tj[ump] tl[ast] tm tm[enu] tn[ext] tN[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] tu tu[nmenu] una[bbreviate] u[ndo] undoj[oin] undol[ist] unh[ide] unlo[ckvar] unm[ap] up[date] verb[ose] ve[rsion] vert[ical] vie[w] vim[grep] vimgrepa[dd] vi[sual] viu[sage] vmapc[lear] vne[w] vs[plit] vu[nmap] wa[ll] wh[ile] winc[md] windo winp[os] win[size] wn[ext] wN[ext] wp[revious] wq wqa[ll] w[rite] ws[verb] wv[iminfo] X xa[ll] x[it] xm[ap] xmapc[lear] xme xmenu XMLent XMLns xn[oremap] xnoreme xnoremenu xu[nmap] y[ank] syn match vimCommand contained "\/dev/null`" = Darwin; then CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon" fi - dnl If Carbon is found, assume we don't want X11 - dnl unless it was specifically asked for (--with-x) + dnl If Carbon or Cocoa is found, assume we don't want + dnl X11 unless it was specifically asked for (--with-x) dnl or Motif, Athena or GTK GUI is used. AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes) - if test "x$CARBON" = "xyes"; then + + SAVE_CPPFLAGS=$CPPFLAGS + SAVE_CFLAGS=$CFLAGS + CPPFLAGS="$CPPFLAGS -ObjC" + CFLAGS="$CFLAGS -ObjC" + AC_CHECK_HEADER(Cocoa/Cocoa.h, COCOA=yes) + CPPFLAGS=$SAVE_CPPFLAGS + CFLAGS=$SAVE_CFLAGS + + if test "x$CARBON" = "xyes" -o "x$COCOA" = "xyes"; then if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk -a "X$enable_gui" != Xgtk2; then with_x=no fi @@ -1152,7 +1161,7 @@ test "x$with_x" = xno -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && enable_gui AC_MSG_CHECKING(--enable-gui argument) AC_ARG_ENABLE(gui, - [ --enable-gui[=OPTS] X11 GUI [default=auto] [OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/photon/carbon]], , enable_gui="auto") + [ --enable-gui[=OPTS] X11 GUI [default=auto] [OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/photon/carbon/macvim]], , enable_gui="auto") dnl Canonicalize the --enable-gui= argument so that it can be easily compared. dnl Do not use character classes for portability with old tools. @@ -1168,6 +1177,7 @@ SKIP_ATHENA=YES SKIP_NEXTAW=YES SKIP_PHOTON=YES SKIP_CARBON=YES +SKIP_MACVIM=YES GUITYPE=NONE if test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then @@ -1184,14 +1194,20 @@ if test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then elif test "x$MACOSX" = "xyes" -a "x$with_x" = "xno" ; then SKIP_CARBON= + SKIP_MACVIM= case "$enable_gui_canon" in no) AC_MSG_RESULT(no GUI support) - SKIP_CARBON=YES ;; + SKIP_CARBON=YES + SKIP_MACVIM=YES ;; yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;; auto) AC_MSG_RESULT(auto - automatic GUI support) ;; - carbon) AC_MSG_RESULT(Carbon GUI support) ;; - *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) + carbon) AC_MSG_RESULT(Carbon GUI support) + SKIP_MACVIM=YES ;; + macvim) AC_MSG_RESULT(MacVim GUI support) SKIP_CARBON=YES ;; + *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) + SKIP_CARBON=YES + SKIP_MACVIM=YES ;; esac else @@ -1205,6 +1221,7 @@ else SKIP_MOTIF= SKIP_ATHENA= SKIP_NEXTAW= + SKIP_MACVIM= SKIP_CARBON=;; gtk) AC_MSG_RESULT(GTK+ 1.x GUI support) SKIP_GTK=;; @@ -1309,12 +1326,30 @@ if test "x$SKIP_CARBON" != "xYES" -a "$enable_gui_canon" != "carbon"; then fi fi +if test "x$SKIP_MACVIM" != "xYES" -a "$enable_gui_canon" != "macvim"; then + AC_MSG_CHECKING(whether or not to look for MacVim) + AC_ARG_ENABLE(macvim-check, + [ --enable-macvim-check If auto-select GUI, check for MacVim [default=yes]], + , enable_macvim_check="yes") + AC_MSG_RESULT($enable_macvim_check); + if test "x$enable_macvim_check" = "xno"; then + SKIP_MACVIM=YES + fi +fi + +if test "x$MACOSX" = "xyes"; then + if test -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then + AC_MSG_CHECKING(for Carbon GUI) + dnl already did the check, just give the message + AC_MSG_RESULT(yes); + GUITYPE=CARBONGUI + elif test -z "$SKIP_MACVIM" -a "x$COCOA" = "xyes"; then + AC_MSG_CHECKING(for MacVim GUI) + dnl already did the check, just give the message + AC_MSG_RESULT(yes); + GUITYPE=MACVIMGUI + fi -if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then - AC_MSG_CHECKING(for Carbon GUI) - dnl already did the check, just give the message - AC_MSG_RESULT(yes); - GUITYPE=CARBONGUI if test "$VIMNAME" = "vim"; then VIMNAME=Vim fi @@ -1335,6 +1370,7 @@ if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then SKIP_ATHENA=YES; SKIP_NEXTAW=YES; SKIP_PHOTON=YES; + SKIP_MACVIM=YES; SKIP_CARBON=YES fi @@ -2859,7 +2895,7 @@ if test "x$MACOSX" = "xyes" -a -n "$PERL"; then fi if test "x$MACOSX" = "xyes" && test "x$CARBON" = "xyes" \ - && test "x$GUITYPE" != "xCARBONGUI"; then + && test "x$GUITYPE" != "xCARBONGUI" && test "x$GUITYPE" != "xMACVIMGUI"; then AC_MSG_CHECKING(whether we need -framework Carbon) dnl check for MACOSX without Carbon GUI, but with FEAT_MBYTE if test "x$enable_multibyte" = "xyes" || test "x$features" = "xbig" \ diff --git a/src/eval.c b/src/eval.c index ca9e2dcc..fe81d743 100644 --- a/src/eval.c +++ b/src/eval.c @@ -10890,6 +10890,9 @@ f_has(argvars, rettv) #ifdef FEAT_GUI_MAC "gui_mac", #endif +#ifdef FEAT_GUI_MACVIM + "gui_macvim", +#endif #ifdef FEAT_GUI_MOTIF "gui_motif", #endif @@ -13338,8 +13341,10 @@ remote_common(argvars, rettv, expr) char_u buf[NUMBUFLEN]; # ifdef WIN32 HWND w; -# else +# elif defined(FEAT_X11) Window w; +# elif defined(MAC_CLIENTSERVER) + int w; // This is the port number ('w' is a bit confusing) # endif if (check_restricted() || check_secure()) @@ -13356,9 +13361,11 @@ remote_common(argvars, rettv, expr) keys = get_tv_string_buf(&argvars[1], buf); # ifdef WIN32 if (serverSendToVim(server_name, keys, &r, &w, expr, TRUE) < 0) -# else +# elif defined(FEAT_X11) if (serverSendToVim(X_DISPLAY, server_name, keys, &r, &w, expr, 0, TRUE) < 0) +# elif defined(MAC_CLIENTSERVER) + if (serverSendToVim(server_name, keys, &r, &w, expr, TRUE) < 0) # endif { if (r != NULL) @@ -13422,7 +13429,7 @@ f_remote_foreground(argvars, rettv) if (server_name != NULL) serverForeground(server_name); } -# else +# elif defined(FEAT_X11) || defined(MAC_CLIENTSERVER) /* Send a foreground() expression to the server. */ argvars[1].v_type = VAR_STRING; argvars[1].vval.v_string = vim_strsave((char_u *)"foreground()"); @@ -13467,13 +13474,15 @@ f_remote_peek(argvars, rettv) s = serverGetReply((HWND)n, FALSE, FALSE, FALSE); rettv->vval.v_number = (s != NULL); } -# else +# elif defined(FEAT_X11) rettv->vval.v_number = 0; if (check_connection() == FAIL) return; rettv->vval.v_number = serverPeekReply(X_DISPLAY, serverStrToWin(serverid), &s); +# elif defined(MAC_CLIENTSERVER) + rettv->vval.v_number = serverPeekReply(serverStrToPort(serverid), &s); # endif if (argvars[1].v_type != VAR_UNKNOWN && rettv->vval.v_number > 0) @@ -13513,9 +13522,11 @@ f_remote_read(argvars, rettv) if (n != 0) r = serverGetReply((HWND)n, FALSE, TRUE, TRUE); if (r == NULL) -# else +# elif defined(FEAT_X11) if (check_connection() == FAIL || serverReadReply(X_DISPLAY, serverStrToWin(serverid), &r, FALSE) < 0) +# elif defined(MAC_CLIENTSERVER) + if (serverReadReply(serverStrToPort(serverid), &r) < 0) # endif EMSG(_("E277: Unable to read a server reply")); } @@ -14450,9 +14461,9 @@ f_serverlist(argvars, rettv) char_u *r = NULL; #ifdef FEAT_CLIENTSERVER -# ifdef WIN32 +# if defined(WIN32) || defined(MAC_CLIENTSERVER) r = serverGetVimNames(); -# else +# elif defined(FEAT_X11) make_connection(); if (X_DISPLAY != NULL) r = serverGetVimNames(X_DISPLAY); diff --git a/src/ex_cmds.h b/src/ex_cmds.h index d06e0318..505acd5a 100644 --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -595,6 +595,10 @@ EX(CMD_marks, "marks", do_marks, EXTRA|TRLBAR|CMDWIN), EX(CMD_match, "match", ex_match, RANGE|NOTADR|EXTRA|CMDWIN), +EX(CMD_macaction, "macaction", ex_macaction, + EXTRA|NOSPC|NEEDARG), +EX(CMD_macmenukey, "macmenukey", ex_macmenukey, + EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), EX(CMD_menu, "menu", ex_menu, RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), EX(CMD_menutranslate, "menutranslate", ex_menutranslate, diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 72b939bd..9f7de860 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -215,7 +215,8 @@ static void ex_tearoff __ARGS((exarg_T *eap)); #else # define ex_tearoff ex_ni #endif -#if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK)) && defined(FEAT_MENU) +#if defined(FEAT_MENU) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \ + || defined(FEAT_GUI_MACVIM)) static void ex_popup __ARGS((exarg_T *eap)); #else # define ex_popup ex_ni @@ -463,6 +464,11 @@ static void ex_folddo __ARGS((exarg_T *eap)); # define ex_profile ex_ni #endif +#ifndef FEAT_GUI_MACVIM +# define ex_macaction ex_ni +# define ex_macmenukey ex_ni +#endif + /* * Declare cmdnames[]. */ @@ -3726,6 +3732,9 @@ set_one_cmd_context(xp, buff) case CMD_cmenu: case CMD_cnoremenu: case CMD_cunmenu: case CMD_tmenu: case CMD_tunmenu: case CMD_popup: case CMD_tearoff: case CMD_emenu: +#ifdef FEAT_GUI_MACVIM + case CMD_macmenukey: +#endif return set_context_in_menu_cmd(xp, cmd, arg, forceit); #endif @@ -6665,7 +6674,8 @@ ex_shell(eap) || (defined(FEAT_GUI_GTK) && defined(FEAT_DND)) \ || defined(FEAT_GUI_MSWIN) \ || defined(FEAT_GUI_MAC) \ - || defined(PROTO) + || defined(PROTO) \ + || defined(FEAT_GUI_MACVIM) /* * Handle a file drop. The code is here because a drop is *nearly* like an @@ -7583,7 +7593,8 @@ ex_tearoff(eap) } #endif -#if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK)) && defined(FEAT_MENU) +#if defined(FEAT_MENU) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \ + || defined(FEAT_GUI_MACVIM)) static void ex_popup(eap) exarg_T *eap; diff --git a/src/feature.h b/src/feature.h index 734f6e64..a139b0db 100644 --- a/src/feature.h +++ b/src/feature.h @@ -620,7 +620,8 @@ * Disabled for EBCDIC: * Multibyte support doesn't work on OS390 Unix currently. */ -#if (defined(FEAT_BIG) || defined(HAVE_GTK2) || defined(FEAT_ARABIC)) \ +#if (defined(FEAT_BIG) || defined(HAVE_GTK2) || defined(FEAT_ARABIC) \ + || defined(FEAT_GUI_MACVIM)) \ && !defined(FEAT_MBYTE) && !defined(WIN16) \ && SIZEOF_INT >= 4 && !defined(EBCDIC) # define FEAT_MBYTE @@ -741,7 +742,8 @@ || defined(FEAT_GUI_MSWIN) \ || ((defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) \ && defined(HAVE_XPM)) \ - || defined(FEAT_GUI_PHOTON)) + || defined(FEAT_GUI_PHOTON) \ + || defined(FEAT_GUI_MACVIM)) # define FEAT_TOOLBAR #endif @@ -755,6 +757,7 @@ */ #if defined(FEAT_WINDOWS) && defined(FEAT_NORMAL) \ && (defined(FEAT_GUI_GTK) \ + || defined(FEAT_GUI_MACVIM) \ || (defined(FEAT_GUI_MOTIF) && defined(HAVE_XM_NOTEBOOK_H)) \ || defined(FEAT_GUI_MAC) \ || (defined(FEAT_GUI_MSWIN) && (!defined(_MSC_VER) || _MSC_VER > 1020))) @@ -764,7 +767,7 @@ /* * +browse ":browse" command. */ -#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)) +#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 #endif @@ -779,7 +782,8 @@ || defined(FEAT_GUI_GTK) \ || defined(FEAT_GUI_PHOTON) \ || defined(FEAT_GUI_MSWIN) \ - || defined(FEAT_GUI_MAC) + || defined(FEAT_GUI_MAC) \ + || defined(FEAT_GUI_MACVIM) # define FEAT_CON_DIALOG # define FEAT_GUI_DIALOG # else @@ -794,7 +798,8 @@ #if defined(FEAT_GUI_DIALOG) && \ (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \ || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MSWIN) \ - || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC)) + || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) \ + || defined(FEAT_GUI_MACVIM)) # define FEAT_GUI_TEXTDIALOG #endif @@ -1069,9 +1074,10 @@ #endif /* - * +dnd Drag'n'drop support. Always used for the GTK+ GUI. + * +dnd Drag'n'drop support. Always used for the GTK+ GUI and MacVim. */ -#if defined(FEAT_CLIPBOARD) && defined(FEAT_GUI_GTK) +#if defined(FEAT_CLIPBOARD) && (defined(FEAT_GUI_GTK) \ + || defined(FEAT_GUI_MACVIM)) # define FEAT_DND #endif @@ -1089,7 +1095,12 @@ * +clientserver Remote control via the remote_send() function * and the --remote argument */ -#if (defined(WIN32) || defined(FEAT_XCLIPBOARD)) && defined(FEAT_EVAL) +#if defined(FEAT_GUI_MACVIM) +#define MAC_CLIENTSERVER +#endif + +#if (defined(WIN32) || defined(FEAT_XCLIPBOARD) || defined(MAC_CLIENTSERVER)) \ + && defined(FEAT_EVAL) # define FEAT_CLIENTSERVER #endif @@ -1113,7 +1124,7 @@ # endif # if defined(FEAT_GUI_W32) || defined(FEAT_GUI_W16) || defined(FEAT_GUI_MOTIF) \ || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) \ - || defined(FEAT_GUI_PHOTON) + || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MACVIM) # define FEAT_MOUSESHAPE # endif #endif @@ -1257,3 +1268,17 @@ || defined(FEAT_BIG) # define FEAT_AUTOCHDIR #endif + +/* + * +transparency 'transparency' option. + */ +#if defined(FEAT_GUI_MACVIM) +# define FEAT_TRANSPARENCY +#endif + +/* + * +fullscreen 'fullscreen' option + */ +#ifdef FEAT_GUI_MACVIM +# define FEAT_FULLSCREEN +#endif diff --git a/src/fileio.c b/src/fileio.c index 594daf33..9911abfc 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5685,7 +5685,8 @@ shorten_fnames(force) #if (defined(FEAT_DND) && defined(FEAT_GUI_GTK)) \ || defined(FEAT_GUI_MSWIN) \ || defined(FEAT_GUI_MAC) \ - || defined(PROTO) + || defined(PROTO) \ + || defined(FEAT_GUI_MACVIM) /* * Shorten all filenames in "fnames[count]" by current directory. */ diff --git a/src/globals.h b/src/globals.h index 7fec4e64..07eb8ab3 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1275,11 +1275,13 @@ EXTERN Window commWindow INIT(= None); EXTERN Window clientWindow INIT(= None); EXTERN Atom commProperty INIT(= None); EXTERN char_u *serverDelayedStartName INIT(= NULL); -# else +# elif defined(WIN32) # ifdef PROTO typedef int HWND; # endif EXTERN HWND clientWindow INIT(= 0); +# elif defined(MAC_CLIENTSERVER) +EXTERN int clientWindow INIT(= 0); # endif #endif diff --git a/src/gui.c b/src/gui.c index b2b8e849..7e4f890d 100644 --- a/src/gui.c +++ b/src/gui.c @@ -268,7 +268,7 @@ gui_init_check() # endif # endif gui.menu_is_active = TRUE; /* default: include menu */ -# ifndef FEAT_GUI_GTK +# if !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MACVIM)) gui.menu_height = MENU_DEFAULT_HEIGHT; gui.menu_width = 0; # endif @@ -636,7 +636,8 @@ gui_exit(rc) } #if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_MSWIN) \ - || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) || defined(PROTO) + || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) \ + || defined(PROTO) || defined(FEAT_GUI_MACVIM) # define NEED_GUI_UPDATE_SCREEN 1 /* * Called when the GUI shell is closed by the user. If there are no changed @@ -708,6 +709,17 @@ gui_init_font(font_list, fontset) /* Isolate one comma separated font name. */ (void)copy_option_part(&font_list, font_name, FONTLEN, ","); +#if defined(FEAT_GUI_MACVIM) + /* The font dialog is modeless in Mac OS X, so when + * gui_mch_init_font() is called with "*" it brings up the + * dialog and returns immediately. In this case we don't want + * it to be called again with NULL, so return here. */ + if (STRCMP(font_name, "*") == 0) { + gui_mch_init_font(font_name, FALSE); + return FALSE; + } +#endif + /* Careful!!! The Win32 version of gui_mch_init_font(), when * called with "*" will change p_guifont to the selected font * name, which frees the old value. This makes font_list @@ -1120,7 +1132,8 @@ gui_update_cursor(force, clear_selection) void gui_position_menu() { -# if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MOTIF) +# if !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MOTIF) \ + || defined(FEAT_GUI_MACVIM)) if (gui.menu_is_active && gui.in_use) gui_mch_set_menu_pos(0, 0, gui.menu_width, gui.menu_height); # endif @@ -1149,7 +1162,8 @@ gui_position_components(total_width) text_area_x += gui.scrollbar_width; text_area_y = 0; -#if defined(FEAT_MENU) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON)) +#if defined(FEAT_MENU) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) \ + || defined(FEAT_GUI_MACVIM)) gui.menu_width = total_width; if (gui.menu_is_active) text_area_y += gui.menu_height; @@ -1233,7 +1247,7 @@ gui_get_base_height() /* We can't take the sizes properly into account until anything is * realized. Therefore we recalculate all the values here just before * setting the size. (--mdcki) */ -#else +#elif !defined(FEAT_GUI_MACVIM) # ifdef FEAT_MENU if (gui.menu_is_active) base_height += gui.menu_height; @@ -2158,7 +2172,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back) if (back != 0 && ((draw_flags & DRAW_BOLD) || (highlight_mask & HL_ITALIC))) return FAIL; -#if defined(RISCOS) || defined(HAVE_GTK2) +#if defined(RISCOS) || defined(HAVE_GTK2) || defined(FEAT_GUI_MACVIM) /* If there's no italic font, then fake it. * For GTK2, we don't need a different font for italic style. */ if (hl_mask_todo & HL_ITALIC) @@ -2190,6 +2204,9 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back) #ifdef HAVE_GTK2 /* The value returned is the length in display cells */ len = gui_gtk2_draw_string(gui.row, col, s, len, draw_flags); +#elif defined(FEAT_GUI_MACVIM) + /* The value returned is the length in display cells */ + len = gui_macvim_draw_string(gui.row, col, s, len, draw_flags); #else # ifdef FEAT_MBYTE if (enc_utf8) @@ -4002,7 +4019,8 @@ gui_update_scrollbars(force) /* Calculate height and position in pixels */ h = (sb->height + sb->status_height) * gui.char_height; y = sb->top * gui.char_height + gui.border_offset; -#if defined(FEAT_MENU) && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MOTIF) && !defined(FEAT_GUI_PHOTON) +#if defined(FEAT_MENU) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MOTIF) \ + || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MACVIM)) if (gui.menu_is_active) y += gui.menu_height; #endif @@ -5062,7 +5080,8 @@ gui_do_findrepl(flags, find_text, repl_text, down) #if (defined(FEAT_DND) && defined(FEAT_GUI_GTK)) \ || defined(FEAT_GUI_MSWIN) \ || defined(FEAT_GUI_MAC) \ - || defined(PROTO) + || defined(PROTO) \ + || defined(FEAT_GUI_MACVIM) #ifdef FEAT_WINDOWS static void gui_wingoto_xy __ARGS((int x, int y)); diff --git a/src/gui.h b/src/gui.h index e4ee182b..3bf4da86 100644 --- a/src/gui.h +++ b/src/gui.h @@ -151,7 +151,7 @@ #define DRAW_BOLD 0x02 /* draw bold text */ #define DRAW_UNDERL 0x04 /* draw underline text */ #define DRAW_UNDERC 0x08 /* draw undercurl text */ -#if defined(RISCOS) || defined(HAVE_GTK2) +#if defined(RISCOS) || defined(HAVE_GTK2) || defined(FEAT_GUI_MACVIM) # define DRAW_ITALIC 0x10 /* draw italic text */ #endif #define DRAW_CURSOR 0x20 /* drawing block cursor (win32) */ @@ -294,7 +294,7 @@ typedef struct Gui int right_sbar_x; /* Calculated x coord for right scrollbar */ #ifdef FEAT_MENU -# ifndef FEAT_GUI_GTK +# if !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MACVIM)) int menu_height; /* Height of the menu bar */ int menu_width; /* Width of the menu bar */ # endif @@ -522,7 +522,7 @@ typedef enum # define FRD_MATCH_CASE 0x10 /* match case */ #endif -#ifdef HAVE_GTK2 +#ifdef HAVE_GTK2 || FEAT_GUI_MACVIM /* * Convenience macros to convert from 'encoding' to 'termencoding' and * vice versa. If no conversion is necessary the passed-in pointer is diff --git a/src/if_xcmdsrv.c b/src/if_xcmdsrv.c index 041ed5a4..19c0e3fd 100644 --- a/src/if_xcmdsrv.c +++ b/src/if_xcmdsrv.c @@ -14,7 +14,8 @@ #include "vim.h" #include "version.h" -#if defined(FEAT_CLIENTSERVER) || defined(PROTO) +#if (defined(FEAT_CLIENTSERVER) || defined(PROTO)) \ + && !defined(MAC_CLIENTSERVER) # ifdef FEAT_X11 # include diff --git a/src/main.c b/src/main.c index 6bd9ff4a..f5533abb 100644 --- a/src/main.c +++ b/src/main.c @@ -29,6 +29,10 @@ # include #endif +#if FEAT_GUI_MACVIM +#include /* for objc_*() and sel_*() */ +#endif + /* Maximum number of commands from + or -c arguments. */ #define MAX_ARG_CMDS 10 @@ -176,6 +180,15 @@ main mparm_T params; /* various parameters passed between * main() and other functions. */ +#if FEAT_GUI_MACVIM + // Cocoa needs an NSAutoreleasePool in place or it will leak memory. + // This particular pool will hold autorelease objects created during + // initialization. + id autoreleasePool = objc_msgSend(objc_msgSend( + objc_getClass("NSAutoreleasePool"),sel_getUid("alloc") + ), sel_getUid("init")); +#endif + /* * Do any system-specific initialisations. These can NOT use IObuff or * NameBuff. Thus emsg2() cannot be called! @@ -445,7 +458,7 @@ main params.want_full_screen = FALSE; #endif -#if defined(FEAT_GUI_MAC) && defined(MACOS_X_UNIX) +#if (defined(FEAT_GUI_MAC) || defined(FEAT_GUI_MACVIM)) && defined(MACOS_X_UNIX) /* When the GUI is started from Finder, need to display messages in a * message box. isatty(2) returns TRUE anyway, thus we need to check the * name to know we're not started from a terminal. */ @@ -934,11 +947,27 @@ main TIME_MSG("before starting main loop"); +#if FEAT_GUI_MACVIM + // The autorelease pool might have filled up quite a bit during + // initialization, so purge it before entering the main loop. + objc_msgSend(autoreleasePool, sel_getUid("release")); + + // The main loop sets up its own autorelease pool, but to be safe we still + // realloc this one here. + autoreleasePool = objc_msgSend(objc_msgSend( + objc_getClass("NSAutoreleasePool"),sel_getUid("alloc") + ), sel_getUid("init")); +#endif + /* * Call the main command loop. This never returns. */ main_loop(FALSE, FALSE); +#if FEAT_GUI_MACVIM + objc_msgSend(autoreleasePool, sel_getUid("release")); +#endif + return 0; } #endif /* PROTO */ @@ -997,6 +1026,14 @@ main_loop(cmdwin, noexmode) #endif ) { +#if FEAT_GUI_MACVIM + // Cocoa needs an NSAutoreleasePool in place or it will leak memory. + // This particular pool gets released once every loop. + id autoreleasePool = objc_msgSend(objc_msgSend( + objc_getClass("NSAutoreleasePool"),sel_getUid("alloc") + ), sel_getUid("init")); +#endif + if (stuff_empty()) { did_check_timestamps = FALSE; @@ -1179,6 +1216,12 @@ main_loop(cmdwin, noexmode) } else normal_cmd(&oa, TRUE); + +#if FEAT_GUI_MACVIM + // TODO! Make sure there are no continue statements that will cause + // this not to be called or MacVim will leak memory! + objc_msgSend(autoreleasePool, sel_getUid("release")); +#endif } } @@ -2739,7 +2782,7 @@ source_startup_scripts(parmp) #ifdef SYS_VIMRC_FILE (void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, DOSO_NONE); #endif -#ifdef MACOS_X +#if defined(MACOS_X) && !defined(FEAT_GUI_MACVIM) (void)do_source((char_u *)"$VIMRUNTIME/macmap.vim", FALSE, DOSO_NONE); #endif @@ -3362,6 +3405,14 @@ prepare_server(parmp) } else serverDelayedStartName = parmp->servername; +# elif defined(MAC_CLIENTSERVER) + // NOTE: Can't set server name at same time as WIN32 because gui.in_use + // isn't set then. Servers are only supported in GUI mode. + if (parmp->servername != NULL && gui.in_use) + { + serverRegisterName(parmp->servername); + vim_free(parmp->servername); + } # endif /* @@ -3401,9 +3452,11 @@ cmdsrv_main(argc, argv, serverName_arg, serverStr) #define ARGTYPE_SEND 3 int silent = FALSE; int tabs = FALSE; -# ifndef FEAT_X11 +# ifdef WIN32 HWND srv; -# else +# elif defined(MAC_CLIENTSERVER) + int srv; +# elif defined(FEAT_X11) Window srv; setup_term_clip(); @@ -3495,7 +3548,7 @@ cmdsrv_main(argc, argv, serverName_arg, serverStr) else ret = serverSendToVim(xterm_dpy, sname, *serverStr, NULL, &srv, 0, 0, silent); -# else +# elif defined(WIN32) || defined(MAC_CLIENTSERVER) /* Win32 always works? */ ret = serverSendToVim(sname, *serverStr, NULL, &srv, 0, silent); # endif @@ -3560,9 +3613,12 @@ cmdsrv_main(argc, argv, serverName_arg, serverStr) p = serverGetReply(srv, NULL, TRUE, TRUE); if (p == NULL) break; -# else +# elif defined(FEAT_X11) if (serverReadReply(xterm_dpy, srv, &p, TRUE) < 0) break; +# elif defined(MAC_CLIENTSERVER) + if (serverReadReply(srv, &p) < 0) + break; # endif j = atoi((char *)p); if (j >= 0 && j < numFiles) @@ -3589,11 +3645,14 @@ cmdsrv_main(argc, argv, serverName_arg, serverStr) /* Win32 always works? */ if (serverSendToVim(sname, (char_u *)argv[i + 1], &res, NULL, 1, FALSE) < 0) -# else +# elif defined(FEAT_X11) if (xterm_dpy == NULL) mch_errmsg(_("No display: Send expression failed.\n")); else if (serverSendToVim(xterm_dpy, sname, (char_u *)argv[i + 1], &res, NULL, 1, 1, FALSE) < 0) +# elif defined(MAC_CLIENTSERVER) + if (serverSendToVim(sname, (char_u *)argv[i + 1], + &res, NULL, 1, FALSE) < 0) # endif { if (res != NULL && *res != NUL) @@ -3608,10 +3667,10 @@ cmdsrv_main(argc, argv, serverName_arg, serverStr) } else if (STRICMP(argv[i], "--serverlist") == 0) { -# ifdef WIN32 +# if defined(WIN32) || defined(MAC_CLIENTSERVER) /* Win32 always works? */ res = serverGetVimNames(); -# else +# elif defined(FEAT_X11) if (xterm_dpy != NULL) res = serverGetVimNames(xterm_dpy); # endif diff --git a/src/menu.c b/src/menu.c index f0683512..bd4b4f29 100644 --- a/src/menu.c +++ b/src/menu.c @@ -97,7 +97,7 @@ ex_menu(eap) char_u *arg; char_u *p; int i; -#if defined(FEAT_GUI) && !defined(FEAT_GUI_GTK) +#if defined(FEAT_GUI) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MACVIM)) int old_menu_height; # if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) && !defined(FEAT_GUI_W16) int old_toolbar_height; @@ -322,7 +322,8 @@ ex_menu(eap) EMSG(_(e_trailing)); goto theend; } -#if defined(FEAT_GUI) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON)) +#if defined(FEAT_GUI) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) \ + || defined(FEAT_GUI_MACVIM)) old_menu_height = gui.menu_height; # if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) && !defined(FEAT_GUI_W16) old_toolbar_height = gui.toolbar_height; @@ -441,7 +442,7 @@ ex_menu(eap) vim_free(map_buf); } -#if defined(FEAT_GUI) && !(defined(FEAT_GUI_GTK)) +#if defined(FEAT_GUI) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MACVIM)) /* If the menubar height changed, resize the window */ if (gui.in_use && (gui.menu_height != old_menu_height @@ -2259,7 +2260,7 @@ ex_emenu(eap) EMSG2(_("E335: Menu not defined for %s mode"), mode); } -#if defined(FEAT_GUI_MSWIN) \ +#if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MACVIM)\ || (defined(FEAT_GUI_GTK) && defined(FEAT_MENU)) \ || defined(FEAT_BEVAL_TIP) || defined(PROTO) /* @@ -2470,4 +2471,144 @@ menutrans_lookup(name, len) } #endif /* FEAT_MULTI_LANG */ + +#ifdef FEAT_GUI_MACVIM + void +ex_macmenukey(eap) + exarg_T *eap; +{ + char_u *arg = eap->arg; + char_u *keys, *name, *p; + vimmenu_T *menu; + char_u *last_dash; + int modifiers; + int bit; + int key; + + /* + * Isolate the menu name. + */ + name = arg; + if (*name == '.') + { + EMSG2(_(e_invarg2), name); + return; + } + + while (*arg && !vim_iswhite(*arg)) + { + if ((*arg == '\\' || *arg == Ctrl_V) && arg[1] != NUL) + arg++; + arg++; + } + if (*arg != NUL) + *arg++ = NUL; + arg = skipwhite(arg); + keys = arg; + + // TODO: move to gui_find_menu_item(path_name) + menu = root_menu; + while (*name) + { + /* find the end of one dot-separated name and put a NUL at the dot */ + p = menu_name_skip(name); + + while (menu != NULL) + { + if (STRCMP(name, menu->name) == 0 || STRCMP(name, menu->dname) == 0) + { + if (*p == NUL) + { + if (menu->children != NULL) + menu = NULL; + goto search_end; + } + break; + } + menu = menu->next; + } + if (menu == NULL) /* didn't find it */ + break; + + /* Found a match, search the sub-menu. */ + menu = menu->children; + name = p; + } + +search_end: + if (!menu) { + EMSG(_("E337: Menu not found - check menu names")); + return; + } + + if (keys[0] == '<') + { + key = 0; + + /* Find end of modifier list */ + last_dash = keys; + for (p = keys + 1; *p == '-' || vim_isIDc(*p); p++) + { + if (*p == '-') + { + last_dash = p; + if (p[1] != NUL && p[2] == '>') + ++p; /* anything accepted, like */ + } + if (p[0] == 't' && p[1] == '_' && p[2] && p[3]) + p += 3; /* skip t_xx, xx may be '-' or '>' */ + } + + if (*p == '>') /* found matching '>' */ + { + /* Which modifiers are given? */ + modifiers = 0x0; + for (p = keys + 1; p < last_dash; p++) + { + if (*p != '-') + { + bit = name_to_mod_mask(*p); + if (bit == 0x0) + break; /* Illegal modifier name */ + modifiers |= bit; + } + } + + /* + * Legal modifier name. + */ + if (p >= last_dash) + { + /* + * Modifier with single letter, or special key name. + */ + if (modifiers != 0 && last_dash[2] == '>') + key = last_dash[1]; + else + { + key = get_special_key_code(last_dash + 1); + key = handle_x_keys(key); + } + } + } + + if (key != 0) + { + menu->mac_key = key; + menu->mac_mods = modifiers; + } + } + else if (keys[0] == NUL) + { + /* Clear the key equivalent */ + menu->mac_key = 0; + menu->mac_mods = 0; + } + else + { + EMSG(_(e_invarg)); + } +} +#endif /* FEAT_GUI_MACVIM */ + #endif /* FEAT_MENU */ diff --git a/src/normal.c b/src/normal.c index 0b19d537..30a45a3e 100644 --- a/src/normal.c +++ b/src/normal.c @@ -2528,7 +2528,8 @@ do_mouse(oap, c, dir, count, fixindent) * Windows only shows the popup menu on the button up event. */ #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) \ - || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) + || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) \ + || defined(FEAT_GUI_MACVIM) if (!is_click) return FALSE; #endif @@ -2538,7 +2539,8 @@ do_mouse(oap, c, dir, count, fixindent) #endif #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) \ || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MSWIN) \ - || defined(FEAT_GUI_MAC) || defined(FEAT_GUI_PHOTON) + || defined(FEAT_GUI_MAC) || defined(FEAT_GUI_PHOTON) \ + || defined(FEAT_GUI_MACVIM) if (gui.in_use) { jump_flags = 0; diff --git a/src/option.c b/src/option.c index d0fc1b20..021729f0 100644 --- a/src/option.c +++ b/src/option.c @@ -1152,6 +1152,13 @@ static struct vimoption {(char_u *)FALSE, (char_u *)0L} #endif }, + {"fullscreen", "fu", P_BOOL, +#ifdef FEAT_FULLSCREEN + (char_u *)&p_fullscreen, PV_NONE, +#else + (char_u *)NULL, PV_NONE, +#endif + {(char_u *)FALSE, (char_u *)0L}}, {"gdefault", "gd", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_gd, PV_NONE, {(char_u *)FALSE, (char_u *)0L}}, @@ -2511,11 +2518,19 @@ static struct vimoption (char_u *)&p_toolbar, PV_NONE, {(char_u *)"icons,tooltips", (char_u *)0L}}, #endif -#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) && defined(HAVE_GTK2) +#if defined(FEAT_TOOLBAR) && ((defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)) \ + || defined(FEAT_GUI_MACVIM)) {"toolbariconsize", "tbis", P_STRING|P_VI_DEF, (char_u *)&p_tbis, PV_NONE, {(char_u *)"small", (char_u *)0L}}, #endif + {"transparency", "transp", P_NUM|P_VIM|P_RCLR, +#ifdef FEAT_TRANSPARENCY + (char_u *)&p_transp, PV_NONE, +#else + (char_u *)NULL, PV_NONE, +#endif + {(char_u *)0L, (char_u *)0L} }, {"ttimeout", NULL, P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_ttimeout, PV_NONE, {(char_u *)FALSE, (char_u *)0L}}, @@ -2936,6 +2951,9 @@ set_init_1() char_u *p; int opt_idx; long_u n; +#ifdef FEAT_GUI_MACVIM + int did_mb_init; +#endif #ifdef FEAT_LANGMAP langmap_init(); @@ -3302,7 +3320,22 @@ set_init_1() p_enc = vim_strsave((char_u *)"cp936"); vim_free(p); } +#if defined(FEAT_GUI_MACVIM) + did_mb_init = (mb_init() == NULL); + if (!did_mb_init) + { + /* The encoding returned by enc_locale() was invalid, so fall back + * on using utf-8 as the default encoding in MacVim. */ + vim_free(p_enc); + p_enc = vim_strsave((char_u *)"utf-8"); + did_mb_init = (mb_init() == NULL); + } + + /* did_mb_init should always be TRUE, but check just in case. */ + if (did_mb_init) +#else if (mb_init() == NULL) +#endif { opt_idx = findoption((char_u *)"encoding"); if (opt_idx >= 0) @@ -5043,7 +5076,8 @@ didset_options() #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) (void)opt_strings_flags(p_toolbar, p_toolbar_values, &toolbar_flags, TRUE); #endif -#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) && defined(HAVE_GTK2) +#if defined(FEAT_TOOLBAR) && ((defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)) \ + || defined(FEAT_GUI_MACVIM)) (void)opt_strings_flags(p_tbis, p_tbis_values, &tbis_flags, FALSE); #endif #ifdef FEAT_CMDWIN @@ -5698,12 +5732,16 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf, } } -# if defined(FEAT_GUI_GTK) && defined(HAVE_GTK2) +# if (defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)) || defined(FEAT_GUI_MACVIM) if (errmsg == NULL && varp == &p_tenc && gui.in_use) { - /* GTK+ 2 uses only a single encoding, and that is UTF-8. */ + /* MacVim and GTK+ 2 GUIs force 'tenc' to UTF-8. */ if (STRCMP(p_tenc, "utf-8") != 0) +# if defined(FEAT_GUI_MACVIM) + errmsg = (char_u *)N_("E617: Cannot be changed in MacVim"); +# else errmsg = (char_u *)N_("E617: Cannot be changed in the GTK+ 2 GUI"); +# endif } # endif @@ -6046,7 +6084,8 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf, # endif if (p != NULL && gui_init_font(p_guifont, FALSE) != OK) { -# if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_PHOTON) +# if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_PHOTON) \ + || defined(FEAT_GUI_MACVIM) if (STRCMP(p_guifont, "*") == 0) { /* Dialog was cancelled: Keep the old value without giving @@ -6427,8 +6466,9 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf, } #endif -#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) && defined(HAVE_GTK2) - /* 'toolbariconsize': GTK+ 2 only */ +#if defined(FEAT_TOOLBAR) && ((defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)) \ + || defined(FEAT_GUI_MACVIM)) + /* 'toolbariconsize': GTK+ 2 and MacVim only */ else if (varp == &p_tbis) { if (opt_strings_flags(p_tbis, p_tbis_values, &tbis_flags, FALSE) != OK) @@ -7250,6 +7290,17 @@ set_bool_option(opt_idx, varp, value, opt_flags) set_fileformat(curbuf->b_p_tx ? EOL_DOS : EOL_UNIX, opt_flags); } +#ifdef FEAT_FULLSCREEN + /* when 'fullscreen' changes, forward it to the gui */ + else if ((int *)varp == &p_fullscreen && gui.in_use) + { + if (p_fullscreen && !old_value) + gui_mch_enter_fullscreen(); + else if (!p_fullscreen && old_value) + gui_mch_leave_fullscreen(); + } +#endif + /* when 'textauto' is set or reset also change 'fileformats' */ else if ((int *)varp == &p_ta) set_string_option_direct((char_u *)"ffs", -1, @@ -7880,6 +7931,20 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags) } #endif +#if defined(FEAT_TRANSPARENCY) + /* 'transparency' is a number between 0 and 100 */ + else if (pp == &p_transp) + { + if (p_transp < 0 || p_transp > 100) + { + errmsg = e_invarg; + p_transp = old_value; + } + else if (gui.in_use) + gui_mch_new_colors(); + } +#endif + /* * Check the bounds for numeric options here */ diff --git a/src/option.h b/src/option.h index 6208a1c2..249e8baa 100644 --- a/src/option.h +++ b/src/option.h @@ -468,6 +468,9 @@ EXTERN char_u *p_fp; /* 'formatprg' */ #ifdef HAVE_FSYNC EXTERN int p_fs; /* 'fsync' */ #endif +#ifdef FEAT_FULLSCREEN +EXTERN int p_fullscreen; +#endif EXTERN int p_gd; /* 'gdefault' */ #ifdef FEAT_PRINTER EXTERN char_u *p_pdev; /* 'printdevice' */ @@ -764,6 +767,9 @@ EXTERN char_u *p_titlestring; /* 'titlestring' */ #ifdef FEAT_INS_EXPAND EXTERN char_u *p_tsr; /* 'thesaurus' */ #endif +#ifdef FEAT_TRANSPARENCY +EXTERN long p_transp; /* 'transparency' */ +#endif EXTERN int p_ttimeout; /* 'ttimeout' */ EXTERN long p_ttm; /* 'ttimeoutlen' */ EXTERN int p_tbi; /* 'ttybuiltin' */ @@ -779,7 +785,8 @@ static char *(p_toolbar_values[]) = {"text", "icons", "tooltips", "horiz", NULL} # define TOOLBAR_TOOLTIPS 0x04 # define TOOLBAR_HORIZ 0x08 #endif -#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) && defined(HAVE_GTK2) +#if defined(FEAT_TOOLBAR) && ((defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)) \ + || defined(FEAT_GUI_MACVIM)) EXTERN char_u *p_tbis; /* 'toolbariconsize' */ EXTERN unsigned tbis_flags; # ifdef IN_OPTION_C diff --git a/src/os_unix.c b/src/os_unix.c index c062ad1b..9acb344e 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -1934,7 +1934,8 @@ mch_settitle(title, icon) if (get_x11_windis() == OK) type = 1; #else -# if defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) || defined(FEAT_GUI_GTK) +# if defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) \ + || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MACVIM) if (gui.in_use) type = 1; # endif @@ -1963,7 +1964,8 @@ mch_settitle(title, icon) set_x11_title(title); /* x11 */ #endif #if defined(FEAT_GUI_GTK) \ - || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) + || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) \ + || defined(FEAT_GUI_MACVIM) else gui_mch_settitle(title, icon); #endif diff --git a/src/proto.h b/src/proto.h index 85f49378..3cf7e48c 100644 --- a/src/proto.h +++ b/src/proto.h @@ -214,6 +214,9 @@ extern char *vim_SelFile __ARGS((Widget toplevel, char *prompt, char *init_path, # ifdef FEAT_GUI_MAC # include "gui_mac.pro" # endif +# ifdef FEAT_GUI_MACVIM +# include "gui_macvim.pro" +# endif # ifdef FEAT_GUI_X11 # include "gui_x11.pro" # endif diff --git a/src/proto/gui_macvim.pro b/src/proto/gui_macvim.pro new file mode 100644 index 00000000..b821f5b2 --- /dev/null +++ b/src/proto/gui_macvim.pro @@ -0,0 +1,196 @@ + + void +gui_mch_prepare(int *argc, char **argv); + int +gui_mch_init_check(void); + int +gui_mch_init(void); + void +gui_mch_exit(int rc); + int +gui_mch_open(void); + void +gui_mch_update(void); + void +gui_mch_flush(void); + void +gui_macvim_force_flush(void); + int +gui_mch_wait_for_chars(int wtime); + void +gui_mch_clear_all(void); + void +gui_mch_clear_block(int row1, int col1, int row2, int col2); + void +gui_mch_delete_lines(int row, int num_lines); + void +gui_mch_draw_string(int row, int col, char_u *s, int len, int flags); + int +gui_macvim_draw_string(int row, int col, char_u *s, int len, int flags); + void +gui_mch_insert_lines(int row, int num_lines); + void +gui_mch_set_curtab(int nr); + int +gui_mch_showing_tabline(void); + void +gui_mch_update_tabline(void); + void +gui_mch_show_tabline(int showit); + void +clip_mch_lose_selection(VimClipboard *cbd); + int +clip_mch_own_selection(VimClipboard *cbd); + void +clip_mch_request_selection(VimClipboard *cbd); + void +clip_mch_set_selection(VimClipboard *cbd); + void +gui_mch_add_menu(vimmenu_T *menu, int idx); + void +gui_mch_add_menu_item(vimmenu_T *menu, int idx); + void +gui_mch_destroy_menu(vimmenu_T *menu); + void +gui_mch_menu_grey(vimmenu_T *menu, int grey); + void +gui_mch_menu_hidden(vimmenu_T *menu, int hidden); + void +gui_mch_show_popupmenu(vimmenu_T *menu); + void +gui_mch_draw_menubar(void); + void +gui_mch_enable_menu(int flag); + void +gui_mch_show_toolbar(int showit); + void +gui_mch_free_font(GuiFont font); + GuiFont +gui_mch_get_font(char_u *name, int giveErrorIfMissing); + char_u * +gui_mch_get_fontname(GuiFont font, char_u *name); + int +gui_mch_init_font(char_u *font_name, int fontset); + void +gui_mch_set_font(GuiFont font); + int +gui_mch_adjust_charheight(void); + void +gui_mch_beep(void); + char_u * +gui_mch_browse( + int saving, + char_u *title, + char_u *dflt, + char_u *ext, + char_u *initdir, + char_u *filter); + void +gui_mch_create_scrollbar( + scrollbar_T *sb, + int orient); + void +gui_mch_destroy_scrollbar(scrollbar_T *sb); + int +gui_mch_dialog( + int type, + char_u *title, + char_u *message, + char_u *buttons, + int dfltbutton, + char_u *textfield); + void +gui_mch_draw_hollow_cursor(guicolor_T color); + void +gui_mch_draw_part_cursor(int w, int h, guicolor_T color); + void +gui_mch_enable_scrollbar( + scrollbar_T *sb, + int flag); + void +gui_mch_flash(int msec); + guicolor_T +gui_mch_get_color(char_u *name); + long_u +gui_mch_get_rgb(guicolor_T pixel); + void +gui_mch_get_screen_dimensions(int *screen_w, int *screen_h); + int +gui_mch_get_winpos(int *x, int *y); + void +gui_mch_getmouse(int *x, int *y); + int +gui_mch_haskey(char_u *name); + void +gui_mch_iconify(void); + void +gui_mch_invert_rectangle(int r, int c, int nr, int nc); + void +gui_mch_new_colors(void); + void +gui_mch_set_bg_color(guicolor_T color); + void +gui_mch_set_blinking(long wait, long on, long off); + void +gui_mch_set_fg_color(guicolor_T color); + void +gui_mch_set_foreground(void); + void +gui_mch_set_scrollbar_pos( + scrollbar_T *sb, + int x, + int y, + int w, + int h); + void +gui_mch_set_scrollbar_thumb( + scrollbar_T *sb, + long val, + long size, + long max); + void +gui_mch_set_shellsize( + int width, + int height, + int min_width, + int min_height, + int base_width, + int base_height, + int direction); + void +gui_mch_set_sp_color(guicolor_T color); + void +gui_mch_set_text_area_pos(int x, int y, int w, int h); + void +gui_mch_set_winpos(int x, int y); + void +gui_mch_setmouse(int x, int y); + void +gui_mch_settitle(char_u *title, char_u *icon); + void +gui_mch_start_blink(void); + void +gui_mch_stop_blink(void); + void +gui_mch_toggle_tearoffs(int enable); + void +mch_set_mouse_shape(int shape); + void +gui_mch_def_colors(); + void +ex_macaction(exarg_T *eap); + void +gui_make_popup(char_u *path_name, int mouse_pos); + +void serverRegisterName(char_u *name); +int serverSendToVim(char_u *name, char_u *cmd, char_u **result, int *server, int asExpr, int silent); +char_u *serverGetVimNames(void); +int serverStrToPort(char_u *str); +int serverPeekReply(int port, char_u **str); +int serverReadReply(int port, char_u **str); +int serverSendReply(char_u *serverid, char_u *str); + +void gui_mch_enter_fullscreen(void); +void gui_mch_leave_fullscreen(void); + +void gui_macvim_update_modified_flag(); diff --git a/src/proto/menu.pro b/src/proto/menu.pro index a816bc58..3d85d756 100644 --- a/src/proto/menu.pro +++ b/src/proto/menu.pro @@ -19,4 +19,7 @@ void gui_mch_toggle_tearoffs __ARGS((int enable)); void ex_emenu __ARGS((exarg_T *eap)); vimmenu_T *gui_find_menu __ARGS((char_u *path_name)); void ex_menutranslate __ARGS((exarg_T *eap)); +#ifdef FEAT_GUI_MACVIM +void ex_macmenukey __ARGS((exarg_T *eap)); +#endif /* vim: set ft=c : */ diff --git a/src/structs.h b/src/structs.h index 0a56d02e..2a6487f8 100644 --- a/src/structs.h +++ b/src/structs.h @@ -2245,6 +2245,10 @@ struct VimMenu PtWidget_t *id; PtWidget_t *submenu_id; #endif +#ifdef FEAT_GUI_MACVIM + int mac_key; + int mac_mods; +#endif }; #else /* For generating prototypes when FEAT_MENU isn't defined. */ diff --git a/src/syntax.c b/src/syntax.c index e321313b..a1ed8b14 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -6650,7 +6650,8 @@ do_highlight(line, forceit, init) gui_init_menu_font(); # endif } -# if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_X11) +# if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_X11) \ + || defined(FEAT_GUI_MACVIM) gui_mch_def_colors(); # endif # ifdef FEAT_GUI_X11 diff --git a/src/ui.c b/src/ui.c index 5a8c37d8..5e4f69f1 100644 --- a/src/ui.c +++ b/src/ui.c @@ -248,7 +248,17 @@ ui_delay(msec, ignoreinput) gui_wait_for_chars(msec); else #endif + { +#if defined(FEAT_GUI_MACVIM) + /* MacVim tries to be conservative with flushing, but when Vim takes a + * nap it really must flush (else timed error messages might not appear + * etc.). Note that gui_mch_wait_for_chars() already does force a + * flush, so only do it here. */ + if (gui.in_use) + gui_macvim_force_flush(); +#endif mch_delay(msec, ignoreinput); + } } /* @@ -2938,7 +2948,8 @@ mouse_find_win(rowp, colp) #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) || defined (FEAT_GUI_MAC) \ || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MSWIN) \ - || defined(FEAT_GUI_PHOTON) || defined(PROTO) + || defined(FEAT_GUI_PHOTON) || defined(PROTO) \ + || defined(FEAT_GUI_MACVIM) /* * Translate window coordinates to buffer position without any side effects */ diff --git a/src/version.c b/src/version.c index 6763d666..be38a78f 100644 --- a/src/version.c +++ b/src/version.c @@ -231,6 +231,11 @@ static char *(features[]) = #if !defined(USE_SYSTEM) && defined(UNIX) "+fork()", #endif +#ifdef FEAT_FULLSCREEN + "+fullscreen", +#else + "-fullscreen", +#endif #ifdef FEAT_GETTEXT # ifdef DYNAMIC_GETTEXT "+gettext/dyn", @@ -561,6 +566,11 @@ static char *(features[]) = #else "-toolbar", #endif +#ifdef FEAT_TRANSPARENCY + "+transparency", +#else + "-transparency", +#endif #ifdef FEAT_USR_CMDS "+user_commands", #else @@ -1165,15 +1175,19 @@ list_version() # if defined(MSWIN) MSG_PUTS(_("with GUI.")); # else -# if defined (TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON +# if defined FEAT_GUI_MACVIM + MSG_PUTS(_("with MacVim GUI.")); +# else +# if defined (TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON MSG_PUTS(_("with Carbon GUI.")); -# else -# if defined (TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX - MSG_PUTS(_("with Cocoa GUI.")); # else -# if defined (MACOS) +# if defined (TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX + MSG_PUTS(_("with Cocoa GUI.")); +# else +# if defined (MACOS) MSG_PUTS(_("with (classic) GUI.")); -# endif +# endif +# endif # endif # endif # endif @@ -1332,7 +1346,12 @@ intro_message(colon) "", N_("type :q to exit "), N_("type :help or for on-line help"), +#ifdef FEAT_GUI_MACVIM + // TODO: Don't steal the show from version7 help? + N_("type :help macvim for MacVim help "), +#else N_("type :help version7 for version info"), +#endif NULL, "", N_("Running in Vi compatible mode"), diff --git a/src/vim.h b/src/vim.h index 05efc9a2..9b25537c 100644 --- a/src/vim.h +++ b/src/vim.h @@ -93,6 +93,7 @@ || defined(FEAT_GUI_GTK) \ || defined(FEAT_GUI_ATHENA) \ || defined(FEAT_GUI_MAC) \ + || defined(FEAT_GUI_MACVIM) \ || defined(FEAT_GUI_W32) \ || defined(FEAT_GUI_W16) \ || defined(FEAT_GUI_PHOTON) -- 2.11.4.GIT