mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-02 11:19:22 +02:00
Compare commits
90 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ddd5a2bd4b | |||
| 5bc897df9d | |||
| 2f3a9d7740 | |||
| 3aaef67b85 | |||
| 9f957bcd6c | |||
| 9a01753529 | |||
| ac4412ace2 | |||
| b712dd06eb | |||
| 8cad670f16 | |||
| fe79caddfa | |||
| 33c4dd0eef | |||
| d5365574cc | |||
| 615d7dd609 | |||
| e411119903 | |||
| 1ab1bec908 | |||
| 770796042e | |||
| f5a8f4f083 | |||
| c36f69c013 | |||
| b05db8d377 | |||
| b262a38339 | |||
| 3b2784e277 | |||
| 04a6eb68d0 | |||
| 25d39a282a | |||
| fdd9622c00 | |||
| be45005f25 | |||
| 281f280eb1 | |||
| 9c1037f556 | |||
| 2b77fe974e | |||
| fc05fb5e3e | |||
| b7b4e364c4 | |||
| ed55437203 | |||
| b07059a739 | |||
| 00a63422ca | |||
| a3bc1d1a86 | |||
| 629eb02403 | |||
| a81d84df1f | |||
| 19314f214b | |||
| baeec8addc | |||
| 49c9e43d59 | |||
| 0b5eab9c89 | |||
| 49a5d8fbab | |||
| 5f972f11ac | |||
| 554448b77f | |||
| c8d08d3d53 | |||
| 9539d1240e | |||
| f6785cd6c8 | |||
| 2688634afb | |||
| 2a1aff523b | |||
| d2d8135617 | |||
| e33ea64952 | |||
| 6a36ea9a4f | |||
| 98d113300f | |||
| 814f3a5ed0 | |||
| 99805e6988 | |||
| fd2804b9df | |||
| 6f553b7ad5 | |||
| 67df700615 | |||
| ad7da68f84 | |||
| a396b2f7bf | |||
| bb28facdad | |||
| 25133f7d03 | |||
| 6907a6b43e | |||
| 6a87e8cc02 | |||
| d04263aee2 | |||
| 64d84c49fa | |||
| 823ab3d45a | |||
| 2a5bbeead5 | |||
| 935ea1a658 | |||
| bf68c50168 | |||
| 84c844a956 | |||
| 889b7064e3 | |||
| 7a5e3f51cb | |||
| f03063e1cf | |||
| 32c1d587d8 | |||
| 497535c098 | |||
| 8624d40d53 | |||
| dc8a6b7bec | |||
| c5d549a4e0 | |||
| 3eb0ca1305 | |||
| 6ab612e357 | |||
| 16caec3a2b | |||
| 3506261522 | |||
| 6cc607a2f4 | |||
| 4894e8fb74 | |||
| a2e0526744 | |||
| d69e140c24 | |||
| 7cae9e965c | |||
| 2d7c78f24c | |||
| a8da347a13 | |||
| 2e45751630 |
@@ -14,8 +14,14 @@ src/MacVim/icons/build
|
||||
src/MacVim/icons/makeicns/*.o
|
||||
src/MacVim/icons/makeicns/makeicns
|
||||
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.mode1
|
||||
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.mode1v3
|
||||
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.pbxuser
|
||||
src/MacVim/PSMTabBarControl/build
|
||||
src/MacVim/edit-in-odb/Edit in ODBEditor.xcodeproj/*.mode1
|
||||
src/MacVim/edit-in-odb/Edit in ODBEditor.xcodeproj/*.mode1v3
|
||||
src/MacVim/edit-in-odb/Edit in ODBEditor.xcodeproj/*.pbxuser
|
||||
src/MacVim/edit-in-odb/build
|
||||
src/MacVim/PSMTabBarControl/build
|
||||
src/MacVim/build
|
||||
src/TAGS
|
||||
src/Vim
|
||||
|
||||
+14
-13
@@ -1,4 +1,4 @@
|
||||
*gui_mac.txt* For Vim version 7.2. Last change: 2009 Aug 8
|
||||
*gui_mac.txt* For Vim version 7.2. Last change: 2009 Sep 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bjorn Winckler
|
||||
@@ -512,8 +512,8 @@ 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
|
||||
keyboard access" in the "Keyboard" 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.
|
||||
@@ -582,7 +582,7 @@ Cmd-` Cycle to the next window. On an American keyboard the
|
||||
keyboards this key is often adjacent to the left
|
||||
Shift-key and it may be not even be marked with "`".
|
||||
This Cmd-key combination can only be unmapped via the
|
||||
"Keyboard & Mouse" System Preferences.
|
||||
"Keyboard" System Preferences.
|
||||
|
||||
*Cmd-Left* *<D-Left>*
|
||||
Cmd-Left Move cursor to the beginning of the line
|
||||
@@ -714,11 +714,11 @@ This is a known 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
|
||||
The standard fixed width font on Mac OS X is Menlo (it used to be Monaco prior
|
||||
to OS X 10.6). If you prefer this font then add the following line to your
|
||||
"~/.gvimrc": >
|
||||
set guifont=Menlo:h11
|
||||
The suffix ":h11" specifies the point size of the font should be "11" (see
|
||||
'guifont' for more information on how to set the font).
|
||||
|
||||
Scenario: ~
|
||||
@@ -767,13 +767,14 @@ bring up an editor, you would set that option to something like: >
|
||||
Scenario: ~
|
||||
You would like to remap Caps Lock to Esc.
|
||||
Solution: ~
|
||||
The free app "PCKeyboardHack" can be used to remap Caps Lock. It is available
|
||||
as a free download from:
|
||||
The app "PCKeyboardHack" can be used to remap Caps Lock. It is available as a
|
||||
free download from:
|
||||
http://www.pqrs.org/tekezo/macosx/keyremap4macbook/extra.html
|
||||
On some Apple keyboards the Caps Lock key doesn't immediately register and
|
||||
this makes Caps Lock "drop" key presses. To work around this problem go into
|
||||
the "Keyboard & Mouse" System Preference and remap Caps Lock to Ctrl first
|
||||
(click the "Modifier Keys..." button).
|
||||
the "Keyboard" System Preference and remap Caps Lock to Ctrl first (click the
|
||||
"Modifier Keys..." button). This trick may also be necessary if the Caps Lock
|
||||
light turns on/off despite having remapped to Esc.
|
||||
|
||||
Scenario: ~
|
||||
You have problems creating custom mappings involving the Cmd key.
|
||||
|
||||
@@ -481,7 +481,8 @@ bit of code) was adapted from the cscope interface in nvi. Please report
|
||||
any problems, suggestions, patches, et al., you have for the usage of
|
||||
cscope within Vim to him.
|
||||
*cscope-win32*
|
||||
For a cscope version for Win32 see: http://iamphet.nm.ru/cscope/index.html
|
||||
For a cscope version for Win32 see:
|
||||
http://code.google.com/p/cscope-win32/
|
||||
|
||||
Win32 support was added by Sergey Khorev <sergey.khorev@gmail.com>. Contact
|
||||
him if you have Win32-specific issues.
|
||||
|
||||
@@ -224,6 +224,10 @@ expression is evaluated to obtain the {rhs} that is used. Example: >
|
||||
The result of the InsertDot() function will be inserted. It could check the
|
||||
text before the cursor and start omni completion when some condition is met.
|
||||
|
||||
For abbreviations |v:char| is set to the character that was typed to trigger
|
||||
the abbreviation. You can use this to decide how to expand the {lhs}. You
|
||||
can't change v:char and you should not insert it.
|
||||
|
||||
Be very careful about side effects! The expression is evaluated while
|
||||
obtaining characters, you may very well make the command dysfunctional.
|
||||
For this reason the following is blocked:
|
||||
|
||||
@@ -208,7 +208,7 @@ When using gvim, the --remote-wait only works properly this way: >
|
||||
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
|
||||
keeping a list of all currently running servers. Thus, servers are not aware
|
||||
of each other directly; only MacVim knows which servers are running.
|
||||
|
||||
A client is any object which implements the MMVimClientProtocol (see
|
||||
|
||||
+134
-15
@@ -17,8 +17,7 @@ if !exists("did_install_default_menus")
|
||||
let did_install_default_menus = 1
|
||||
|
||||
|
||||
" Localized menus currently not supported in MacVim
|
||||
if !has("gui_macvim") && (exists("v:lang") || &langmenu != "")
|
||||
if (exists("v:lang") || &langmenu != "")
|
||||
" Try to find a menu translation file for the current language.
|
||||
if &langmenu != ""
|
||||
if &langmenu =~ "none"
|
||||
@@ -68,7 +67,27 @@ if !has("gui_macvim") && (exists("v:lang") || &langmenu != "")
|
||||
endif
|
||||
|
||||
|
||||
" MacVim Window menu (should be next to Help so give it a high priority)
|
||||
if has("gui_macvim")
|
||||
an <silent> 9998.300 Window.Minimize <Nop>
|
||||
an <silent> 9998.301 Window.Minimize\ All <Nop>
|
||||
an <silent> 9998.310 Window.Zoom <Nop>
|
||||
an <silent> 9998.311 Window.Zoom\ All <Nop>
|
||||
an <silent> 9998.320 Window.Toggle\ Full\ Screen\ Mode :set invfullscreen<CR>
|
||||
an 9998.330 Window.-SEP1- <Nop>
|
||||
" TODO! Grey out if no tabs are visible.
|
||||
an <silent> 9998.340 Window.Select\ Next\ Tab :tabnext<CR>
|
||||
an <silent> 9998.350 Window.Select\ Previous\ Tab :tabprevious<CR>
|
||||
an 9998.360 Window.-SEP2- <Nop>
|
||||
an <silent> 9998.370 Window.Bring\ All\ To\ Front <Nop>
|
||||
endif
|
||||
|
||||
" Help menu
|
||||
if has("gui_macvim")
|
||||
an 9999.1 &Help.MacVim\ Help :h gui_mac<CR>
|
||||
an <silent> 9999.2 Help.MacVim\ Website <Nop>
|
||||
an 9999.3 &Help.-sep0- <Nop>
|
||||
endif
|
||||
an 9999.10 &Help.&Overview<Tab><F1> :help<CR>
|
||||
an 9999.20 &Help.&User\ Manual :help usr_toc<CR>
|
||||
an 9999.30 &Help.&How-to\ links :help how-to<CR>
|
||||
@@ -97,16 +116,32 @@ fun! s:Helpfind()
|
||||
endfun
|
||||
|
||||
" File menu
|
||||
an 10.310 &File.&Open\.\.\.<Tab>:e :browse confirm e<CR>
|
||||
if has("gui_macvim")
|
||||
an <silent> 10.290 &File.New\ Window <Nop>
|
||||
an 10.295 &File.New\ Tab :tabnew<CR>
|
||||
an <silent> 10.310 &File.Open\.\.\. <Nop>
|
||||
an <silent> 10.325 &File.Open\ Recent <Nop>
|
||||
an 10.328 &File.-SEP0- <Nop>
|
||||
an <silent> 10.330 &File.Close\ Window<Tab>:qa :conf qa<CR>
|
||||
an <silent> 10.332 &File.Close :conf q<CR>
|
||||
an <silent> 10.341 &File.Save\ All :browse conf wa<CR>
|
||||
an 10.350 &File.Save\ As\.\.\.<Tab>:sav :browse confirm saveas<CR>
|
||||
else
|
||||
endif
|
||||
if !has("gui_macvim")
|
||||
an 10.310 &File.&Open\.\.\.<Tab>:e :browse confirm e<CR>
|
||||
endif
|
||||
an 10.320 &File.Sp&lit-Open\.\.\.<Tab>:sp :browse sp<CR>
|
||||
an 10.320 &File.Open\ Tab\.\.\.<Tab>:tabnew :browse tabnew<CR>
|
||||
an 10.325 &File.&New<Tab>:enew :confirm enew<CR>
|
||||
an <silent> 10.330 &File.&Close<Tab>:close
|
||||
if !has("gui_macvim")
|
||||
an 10.325 &File.&New<Tab>:enew :confirm enew<CR>
|
||||
an <silent> 10.330 &File.&Close<Tab>:close
|
||||
\ :if winheight(2) < 0 <Bar>
|
||||
\ confirm enew <Bar>
|
||||
\ else <Bar>
|
||||
\ confirm close <Bar>
|
||||
\ endif<CR>
|
||||
endif
|
||||
an 10.335 &File.-SEP1- <Nop>
|
||||
an <silent> 10.340 &File.&Save<Tab>:w :if expand("%") == ""<Bar>browse confirm w<Bar>else<Bar>confirm w<Bar>endif<CR>
|
||||
an 10.350 &File.Save\ &As\.\.\.<Tab>:sav :browse confirm saveas<CR>
|
||||
@@ -128,9 +163,11 @@ elseif has("unix")
|
||||
vunmenu &File.&Print
|
||||
vnoremenu &File.&Print :w !lpr<CR>
|
||||
endif
|
||||
an 10.600 &File.-SEP4- <Nop>
|
||||
an 10.610 &File.Sa&ve-Exit<Tab>:wqa :confirm wqa<CR>
|
||||
an 10.620 &File.E&xit<Tab>:qa :confirm qa<CR>
|
||||
if !has("gui_macvim")
|
||||
an 10.600 &File.-SEP4- <Nop>
|
||||
an 10.610 &File.Sa&ve-Exit<Tab>:wqa :confirm wqa<CR>
|
||||
an 10.620 &File.E&xit<Tab>:qa :confirm qa<CR>
|
||||
endif
|
||||
|
||||
func! <SID>SelectAll()
|
||||
exe "norm gg" . (&slm == "" ? "VG" : "gH\<C-O>G")
|
||||
@@ -167,13 +204,20 @@ inoremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG <C-O>:call <SID>S
|
||||
cnoremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG <C-U>call <SID>SelectAll()<CR>
|
||||
|
||||
an 20.405 &Edit.-SEP2- <Nop>
|
||||
if has("win32") || has("win16") || has("gui_gtk") || has("gui_kde") || has("gui_motif")
|
||||
if has("win32") || has("win16") || has("gui_gtk") || has("gui_kde") || has("gui_motif")
|
||||
an 20.410 &Edit.&Find\.\.\. :promptfind<CR>
|
||||
vunmenu &Edit.&Find\.\.\.
|
||||
vnoremenu <silent> &Edit.&Find\.\.\. y:promptfind <C-R>=<SID>FixFText()<CR><CR>
|
||||
an 20.420 &Edit.Find\ and\ Rep&lace\.\.\. :promptrepl<CR>
|
||||
vunmenu &Edit.Find\ and\ Rep&lace\.\.\.
|
||||
vnoremenu <silent> &Edit.Find\ and\ Rep&lace\.\.\. y:promptrepl <C-R>=<SID>FixFText()<CR><CR>
|
||||
elseif has("gui_macvim")
|
||||
an <silent> 20.410.10 &Edit.Find.Find\.\.\. :promptfind<CR>
|
||||
vunmenu &Edit.Find.Find\.\.\.
|
||||
vnoremenu <silent> &Edit.Find.Find\.\.\. y:promptfind <C-R>=<SID>FixFText()<CR><CR>
|
||||
an 20.410.20 &Edit.Find.Find\ Next <Nop>
|
||||
an 20.410.30 &Edit.Find.Find\ Previous <Nop>
|
||||
vmenu 20.410.35 &Edit.Find.Use\ Selection\ for\ Find y:let @/=@"<CR>:<BS>
|
||||
else
|
||||
an 20.410 &Edit.&Find<Tab>/ /
|
||||
an 20.420 &Edit.Find\ and\ Rep&lace<Tab>:%s :%s/
|
||||
@@ -386,6 +430,13 @@ if has("keymap")
|
||||
endif
|
||||
if has("win32") || has("win16") || has("gui_motif") || has("gui_gtk") || has("gui_kde") || has("gui_photon") || has("gui_mac")
|
||||
an 20.470 &Edit.Select\ Fo&nt\.\.\. :set guifont=*<CR>
|
||||
elseif has("gui_macvim")
|
||||
an 20.470 &Edit.-SEP4- <Nop>
|
||||
an 20.475.10 &Edit.Font.Show\ Fonts <Nop>
|
||||
an 20.475.20 &Edit.Font.-SEP5- <Nop>
|
||||
an 20.475.30 &Edit.Font.Bigger <Nop>
|
||||
an 20.475.40 &Edit.Font.Smaller <Nop>
|
||||
an 20.480 &Edit.Special\ Characters\.\.\. <Nop>
|
||||
endif
|
||||
|
||||
" Programming menu
|
||||
@@ -803,6 +854,7 @@ endif
|
||||
endif " !exists("no_buffers_menu")
|
||||
|
||||
" Window menu
|
||||
if !has("gui_macvim")
|
||||
an 70.300 &Window.&New<Tab>^Wn <C-W>n
|
||||
an 70.310 &Window.S&plit<Tab>^Ws <C-W>s
|
||||
an 70.320 &Window.Sp&lit\ To\ #<Tab>^W^^ <C-W><C-^>
|
||||
@@ -835,6 +887,7 @@ an 70.380 &Window.&Max\ Height<Tab>^W_ <C-W>_
|
||||
an 70.390 &Window.M&in\ Height<Tab>^W1_ <C-W>1_
|
||||
an 70.400 &Window.Max\ &Width<Tab>^W\| <C-W>\|
|
||||
an 70.410 &Window.Min\ Widt&h<Tab>^W1\| <C-W>1\|
|
||||
endif " !has("gui_macvim")
|
||||
|
||||
" The popup menu
|
||||
an 1.10 PopUp.&Undo u
|
||||
@@ -980,7 +1033,7 @@ if has("toolbar")
|
||||
exe 'vnoremenu <script> ToolBar.Paste ' . paste#paste_cmd['v']
|
||||
exe 'inoremenu <script> ToolBar.Paste ' . paste#paste_cmd['i']
|
||||
|
||||
if !has("gui_athena")
|
||||
if !has("gui_athena") && !has("gui_macvim")
|
||||
an 1.95 ToolBar.-sep3- <Nop>
|
||||
an 1.100 ToolBar.Replace :promptrepl<CR>
|
||||
vunmenu ToolBar.Replace
|
||||
@@ -989,19 +1042,27 @@ if has("toolbar")
|
||||
an 1.120 ToolBar.FindPrev N
|
||||
endif
|
||||
|
||||
an 1.215 ToolBar.-sep5- <Nop>
|
||||
if !has("gui_macvim")
|
||||
an 1.215 ToolBar.-sep5- <Nop>
|
||||
endif
|
||||
an <silent> 1.220 ToolBar.LoadSesn :call <SID>LoadVimSesn()<CR>
|
||||
an <silent> 1.230 ToolBar.SaveSesn :call <SID>SaveVimSesn()<CR>
|
||||
an 1.240 ToolBar.RunScript :browse so<CR>
|
||||
|
||||
an 1.245 ToolBar.-sep6- <Nop>
|
||||
if !has("gui_macvim")
|
||||
an 1.245 ToolBar.-sep6- <Nop>
|
||||
endif
|
||||
an 1.250 ToolBar.Make :make<CR>
|
||||
an 1.270 ToolBar.RunCtags :exe "!" . g:ctags_command<CR>
|
||||
an 1.280 ToolBar.TagJump g<C-]>
|
||||
if !has("gui_macvim")
|
||||
an 1.270 ToolBar.RunCtags :exe "!" . g:ctags_command<CR>
|
||||
an 1.280 ToolBar.TagJump g<C-]>
|
||||
endif
|
||||
|
||||
an 1.295 ToolBar.-sep7- <Nop>
|
||||
an 1.300 ToolBar.Help :help<CR>
|
||||
an <silent> 1.310 ToolBar.FindHelp :call <SID>Helpfind()<CR>
|
||||
if !has("gui_macvim")
|
||||
an <silent> 1.310 ToolBar.FindHelp :call <SID>Helpfind()<CR>
|
||||
endif
|
||||
|
||||
" Only set the tooltips here if not done in a language menu file
|
||||
if exists("*Do_toolbar_tmenu")
|
||||
@@ -1104,4 +1165,62 @@ endif " !exists("did_install_syntax_menu")
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
|
||||
if has("gui_macvim")
|
||||
"
|
||||
" Set up menu key equivalents (these should always have the 'D' modifier
|
||||
" set), action bindings, and alternate items.
|
||||
"
|
||||
" Note: menu items which should execute an action are bound to <Nop>; the
|
||||
" action message is specified here via the :macmenu command.
|
||||
"
|
||||
macm File.New\ Window key=<D-n> action=newWindow:
|
||||
macm File.New\ Tab key=<D-t>
|
||||
macm File.Open\.\.\. key=<D-o> action=fileOpen:
|
||||
macm File.Open\ Tab\.\.\.<Tab>:tabnew key=<D-T>
|
||||
macm File.Open\ Recent action=recentFilesDummy:
|
||||
macm File.Close\ Window<Tab>:qa key=<D-W>
|
||||
macm File.Close key=<D-w> action=performClose:
|
||||
macm File.Save<Tab>:w key=<D-s>
|
||||
macm File.Save\ All key=<D-M-s> alt=YES
|
||||
macm File.Save\ As\.\.\.<Tab>:sav key=<D-S>
|
||||
macm File.Print key=<D-p>
|
||||
|
||||
macm Edit.Undo<Tab>u key=<D-z> action=undo:
|
||||
macm Edit.Redo<Tab>^R key=<D-Z> action=redo:
|
||||
macm Edit.Cut<Tab>"+x key=<D-x> action=cut:
|
||||
macm Edit.Copy<Tab>"+y key=<D-c> action=copy:
|
||||
macm Edit.Paste<Tab>"+gP key=<D-v> action=paste:
|
||||
macm Edit.Select\ All<Tab>ggVG key=<D-a> action=selectAll:
|
||||
macm Edit.Find.Find\.\.\. key=<D-f>
|
||||
macm Edit.Find.Find\ Next key=<D-g> action=findNext:
|
||||
macm Edit.Find.Find\ Previous key=<D-G> action=findPrevious:
|
||||
macm Edit.Find.Use\ Selection\ for\ Find key=<D-e>
|
||||
macm Edit.Font.Show\ Fonts action=orderFrontFontPanel:
|
||||
macm Edit.Font.Bigger key=<D-=> action=fontSizeUp:
|
||||
macm Edit.Font.Smaller key=<D--> action=fontSizeDown:
|
||||
macm Edit.Special\ Characters\.\.\. key=<D-M-t> action=orderFrontCharacterPalette:
|
||||
|
||||
macm Tools.Spelling.To\ Next\ error<Tab>]s key=<D-;>
|
||||
macm Tools.Spelling.Suggest\ Corrections<Tab>z= key=<D-:>
|
||||
macm Tools.Make<Tab>:make key=<D-b>
|
||||
macm Tools.List\ Errors<Tab>:cl key=<D-l>
|
||||
macm Tools.Next\ Error<Tab>:cn key=<D-C-Right>
|
||||
macm Tools.Previous\ Error<Tab>:cp key=<D-C-Left>
|
||||
macm Tools.Older\ List<Tab>:cold key=<D-C-Up>
|
||||
macm Tools.Newer\ List<Tab>:cnew key=<D-C-Down>
|
||||
|
||||
macm Window.Minimize key=<D-m> action=performMiniaturize:
|
||||
macm Window.Minimize\ All key=<D-M-m> action=miniaturizeAll: alt=YES
|
||||
macm Window.Zoom key=<D-C-z> action=performZoom:
|
||||
macm Window.Zoom\ All key=<D-M-C-z> action=zoomAll: alt=YES
|
||||
macm Window.Toggle\ Full\ Screen\ Mode key=<D-F>
|
||||
macm Window.Select\ Next\ Tab key=<D-}>
|
||||
macm Window.Select\ Previous\ Tab key=<D-{>
|
||||
macm Window.Bring\ All\ To\ Front action=arrangeInFront:
|
||||
|
||||
macm Help.MacVim\ Help key=<D-?>
|
||||
macm Help.MacVim\ Website action=openWebsite:
|
||||
endif
|
||||
|
||||
" vim: set sw=2 :
|
||||
|
||||
@@ -635,7 +635,9 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
|
||||
}
|
||||
// Now concatenate
|
||||
strncpy(temp, _("Edit with existing Vim - "), BUFSIZE - 1);
|
||||
strncat(temp, title, BUFSIZE - 1);
|
||||
temp[BUFSIZE - 1] = '\0';
|
||||
strncat(temp, title, BUFSIZE - 1 - strlen(temp));
|
||||
temp[BUFSIZE - 1] = '\0';
|
||||
InsertMenu(hMenu,
|
||||
indexMenu++,
|
||||
MF_STRING|MF_BYPOSITION,
|
||||
|
||||
@@ -54,8 +54,7 @@
|
||||
NSEnumerator* myIterator = [commands objectEnumerator];
|
||||
NSDictionary* currCommand;
|
||||
|
||||
while (currCommand = [myIterator nextObject])
|
||||
{
|
||||
while ((currCommand = [myIterator nextObject])) {
|
||||
/* do something useful with currCommand */
|
||||
FILE *ioPipe = NULL;
|
||||
char junk[256];
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
// Released into public domain on 4/10/08.
|
||||
//
|
||||
// Version: 1.8
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
|
||||
#import "CTGradient.h"
|
||||
|
||||
@@ -1266,3 +1267,5 @@ void resolveHSV(float *color1, float *color2) //H value may be undefined (i.e. g
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif // MM_ENABLE_PLUGINS
|
||||
|
||||
@@ -42,7 +42,12 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
||||
@interface DBPrefsWindowController : NSWindowController {
|
||||
@interface DBPrefsWindowController : NSWindowController
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
|
||||
// 10.6 has turned delegate messages into formal protocols
|
||||
<NSAnimationDelegate, NSToolbarDelegate>
|
||||
#endif
|
||||
{
|
||||
NSMutableArray *toolbarIdentifiers;
|
||||
NSMutableDictionary *toolbarViews;
|
||||
NSMutableDictionary *toolbarItems;
|
||||
|
||||
Generated
Generated
+49
-35
@@ -1140,6 +1140,7 @@
|
||||
<string>markdown</string>
|
||||
<string>markd</string>
|
||||
<string>mdown</string>
|
||||
<string>md</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>MacVim-markdown</string>
|
||||
@@ -1201,7 +1202,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>48</string>
|
||||
<string>50</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
@@ -1222,6 +1223,8 @@
|
||||
<array>
|
||||
<string>NSStringPboardType</string>
|
||||
</array>
|
||||
<key>NSRequiredContext</key>
|
||||
<dict></dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>NSMenuItem</key>
|
||||
@@ -1239,6 +1242,11 @@
|
||||
</array>
|
||||
<key>NSUserData</key>
|
||||
<string>Window</string>
|
||||
<key>NSRequiredContext</key>
|
||||
<dict>
|
||||
<key>NSTextContent</key>
|
||||
<string>FilePath</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>NSMenuItem</key>
|
||||
@@ -1256,6 +1264,11 @@
|
||||
</array>
|
||||
<key>NSUserData</key>
|
||||
<string>Window</string>
|
||||
<key>NSRequiredContext</key>
|
||||
<dict>
|
||||
<key>NSTextContent</key>
|
||||
<string>FilePath</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
<key>SUFeedURL</key>
|
||||
@@ -1264,8 +1277,8 @@
|
||||
<true/>
|
||||
|
||||
<!-- In order for Quick Look to work we must add entries to
|
||||
UTExportedTypeDeclarations. Instead of trying to come up with
|
||||
"proper" values for UTTypeIdentifier just use "org.vim.*-file".
|
||||
UTExportedTypeDeclarations. When possible a "proper" UTI is used,
|
||||
but in case one could not be found just use "org.vim.*-file".
|
||||
This array is quite huge and it would be nice to come up with
|
||||
another way of supporting Quick Look without this.
|
||||
-->
|
||||
@@ -1279,7 +1292,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Vim Script File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.vim-file</string>
|
||||
<string>org.vim.vim-script</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1296,7 +1309,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Plain Text File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.text-file</string>
|
||||
<string>public.plain-text</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1337,7 +1350,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>C Header Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.h-file</string>
|
||||
<string>public.c-header</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1371,7 +1384,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>C++ Header Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.hh-file</string>
|
||||
<string>public.c-plus-plus-header</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1409,7 +1422,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>C Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.c-file</string>
|
||||
<string>public.c-source</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1426,7 +1439,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Objective-C Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.m-file</string>
|
||||
<string>public.objective-c-source</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1443,7 +1456,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Objective-C++ Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.mm-file</string>
|
||||
<string>public.objective-c-plus-plus-source</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1460,7 +1473,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>C++ Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.cc-file</string>
|
||||
<string>public.c-plus-plus-source</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1481,7 +1494,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Assembly Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.asm-file</string>
|
||||
<string>public.assembly-source</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1499,7 +1512,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Rez Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.r-file</string>
|
||||
<string>com.apple.rez-source</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1516,7 +1529,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Java Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.java-file</string>
|
||||
<string>com.sun.java-source</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1534,7 +1547,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Lex Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.l-file</string>
|
||||
<string>com.apple.xcode.lex-source</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1555,7 +1568,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Yacc Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.y-file</string>
|
||||
<string>com.apple.xcode.yacc-source</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1576,7 +1589,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Mig Definition File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.defs-file</string>
|
||||
<string>public.mig-source</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1593,7 +1606,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Symbol Export File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.exp-file</string>
|
||||
<string>com.apple.symbol-export</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1610,7 +1623,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Fortran Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.f-file</string>
|
||||
<string>com.apple.xcode.fortran-source</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1632,7 +1645,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Pascal Source file</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.pas-file</string>
|
||||
<string>com.apple.xcode.pascal-source</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1649,7 +1662,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Ada Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.ada-file</string>
|
||||
<string>com.apple.xcode.ada-source</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1668,7 +1681,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>HTML Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.html-file</string>
|
||||
<string>public.html</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1695,7 +1708,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>XML Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.xml-file</string>
|
||||
<string>public.xml</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1717,7 +1730,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>JavaScript Source File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.js-file</string>
|
||||
<string>com.netscape.javascript-source</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1737,7 +1750,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Perl source</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.pl-file</string>
|
||||
<string>public.perl-script</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1757,7 +1770,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Python source</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.py-file</string>
|
||||
<string>public.python-script</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1777,7 +1790,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>PHP source</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.php-file</string>
|
||||
<string>public.php-script</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1800,7 +1813,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Ruby source</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.rb-file</string>
|
||||
<string>public.ruby-script</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1821,7 +1834,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Shell script</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.sh-file</string>
|
||||
<string>public.shell-script</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1846,7 +1859,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Java Class File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.class-file</string>
|
||||
<string>com.sun.java-class</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1881,7 +1894,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Strings File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.strings-file</string>
|
||||
<string>com.apple.xcode.strings-text</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -1898,7 +1911,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>AppleScript source</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.applescript-file</string>
|
||||
<string>com.apple.applescript.text</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -2374,7 +2387,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>PostScript source</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.ps-file</string>
|
||||
<string>com.adobe.postscript</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -2462,7 +2475,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Electronic business card</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.vcf-file</string>
|
||||
<string>public.vcard</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -2533,7 +2546,7 @@
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Markdown document</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.vim.markdown-file</string>
|
||||
<string>net.daringfireball.markdown</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
@@ -2541,6 +2554,7 @@
|
||||
<string>markdown</string>
|
||||
<string>markd</string>
|
||||
<string>mdown</string>
|
||||
<string>md</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
|
||||
@@ -150,11 +150,11 @@
|
||||
<string>deleteBackward:</string>
|
||||
<key>^k</key>
|
||||
<string>deleteToEndOfParagraph:</string>
|
||||
<key>^l</key>
|
||||
<key>^l</key>
|
||||
<string>centerSelectionInVisibleArea:</string>
|
||||
<key>^n</key>
|
||||
<string>moveDown:</string>
|
||||
<key>^o</key>
|
||||
<!-- <key>^o</key>
|
||||
<array>
|
||||
<string>insertNewlineIgnoringFieldEditor:</string>
|
||||
<string>moveBackward:</string>
|
||||
@@ -370,7 +370,7 @@
|
||||
<key>^</key>
|
||||
<string>moveToBeginningOfLine:</string>
|
||||
<key>^</key>
|
||||
<string>moveToEndOfLine:</string>
|
||||
<string>moveToEndOfLine:</string>
|
||||
<key>^$</key>
|
||||
<string>moveToBeginningOfLineAndModifySelection:</string>
|
||||
<key>^$</key>
|
||||
@@ -379,7 +379,7 @@
|
||||
<array>
|
||||
<string>moveBackward:</string>
|
||||
<string>moveToBeginningOfParagraph:</string>
|
||||
</array>
|
||||
</array>
|
||||
<key>~</key>
|
||||
<array>
|
||||
<string>moveForward:</string>
|
||||
|
||||
+112
-74
@@ -61,25 +61,30 @@ static NSTimeInterval MMReplyTimeout = 5;
|
||||
|
||||
static NSString *MMWebsiteString = @"http://code.google.com/p/macvim/";
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
// Latency (in s) between FS event occuring and being reported to MacVim.
|
||||
// Should be small so that MacVim is notified of changes to the ~/.vim
|
||||
// directory more or less immediately.
|
||||
static CFTimeInterval MMEventStreamLatency = 0.1;
|
||||
#endif
|
||||
|
||||
static float MMCascadeHorizontalOffset = 21;
|
||||
static float MMCascadeVerticalOffset = 23;
|
||||
|
||||
#pragma options align=mac68k
|
||||
|
||||
#pragma pack(push,1)
|
||||
// The alignment and sizes of these fields are based on trial-and-error. It
|
||||
// may be necessary to adjust them to fit if Xcode ever changes this struct.
|
||||
typedef struct
|
||||
{
|
||||
short unused1; // 0 (not used)
|
||||
short lineNum; // line to select (< 0 to specify range)
|
||||
long startRange; // start of selection range (if line < 0)
|
||||
long endRange; // end of selection range (if line < 0)
|
||||
long unused2; // 0 (not used)
|
||||
long theDate; // modification date/time
|
||||
} MMSelectionRange;
|
||||
#pragma options align=reset
|
||||
int16_t unused1; // 0 (not used)
|
||||
int16_t lineNum; // line to select (< 0 to specify range)
|
||||
int32_t startRange; // start of selection range (if line < 0)
|
||||
int32_t endRange; // end of selection range (if line < 0)
|
||||
int32_t unused2; // 0 (not used)
|
||||
int32_t theDate; // modification date/time
|
||||
} MMXcodeSelectionRange;
|
||||
#pragma pack(pop)
|
||||
|
||||
|
||||
// This is a private AppKit API gleaned from class-dump.
|
||||
@@ -143,7 +148,7 @@ typedef struct
|
||||
|
||||
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
static void
|
||||
fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
void *clientCallBackInfo,
|
||||
@@ -691,17 +696,18 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
- (void)removeVimController:(id)controller
|
||||
{
|
||||
ASLogDebug(@"Remove Vim controller pid=%d id=%d (processingFlag=%d)",
|
||||
[controller pid], [controller identifier], processingFlag);
|
||||
[controller pid], [controller vimControllerId], processingFlag);
|
||||
|
||||
int idx = [vimControllers indexOfObject:controller];
|
||||
NSUInteger idx = [vimControllers indexOfObject:controller];
|
||||
if (NSNotFound == idx) {
|
||||
ASLogDebug(@"Controller not found, probably due to duplicate removal");
|
||||
return;
|
||||
}
|
||||
|
||||
[controller cleanup];
|
||||
|
||||
[controller retain];
|
||||
[vimControllers removeObjectAtIndex:idx];
|
||||
[controller cleanup];
|
||||
[controller release];
|
||||
|
||||
if (![vimControllers count]) {
|
||||
// The last editor window just closed so restore the main menu back to
|
||||
@@ -745,33 +751,34 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
}
|
||||
|
||||
if (!NSEqualPoints(topLeft, NSZeroPoint)) {
|
||||
NSPoint oldTopLeft = topLeft;
|
||||
if (topWin)
|
||||
topLeft = [win cascadeTopLeftFromPoint:topLeft];
|
||||
if (topWin) {
|
||||
// Do manual cascading instead of using
|
||||
// -[MMWindow cascadeTopLeftFromPoint:] since it is rather
|
||||
// unpredictable.
|
||||
topLeft.x += MMCascadeHorizontalOffset;
|
||||
topLeft.y -= MMCascadeVerticalOffset;
|
||||
}
|
||||
|
||||
[win setFrameTopLeftPoint:topLeft];
|
||||
NSScreen *screen = [win screen];
|
||||
if (screen) {
|
||||
// Constrain the window so that it is entirely visible on the
|
||||
// screen. If it sticks out on the right, move it all the way
|
||||
// left. If it sticks out on the bottom, move it all the way up.
|
||||
// (Assumption: the cascading offsets are positive.)
|
||||
NSRect screenFrame = [screen frame];
|
||||
NSSize winSize = [win frame].size;
|
||||
NSRect winFrame =
|
||||
{ { topLeft.x, topLeft.y - winSize.height }, winSize };
|
||||
|
||||
if ([win screen]) {
|
||||
NSPoint screenOrigin = [[win screen] frame].origin;
|
||||
if ([win frame].origin.y < screenOrigin.y) {
|
||||
// Try to avoid shifting the new window downwards if it means
|
||||
// that the bottom of the window will be off the screen. E.g.
|
||||
// if the user has set windows to open maximized in the
|
||||
// vertical direction then the new window will cascade
|
||||
// horizontally only.
|
||||
topLeft.y = oldTopLeft.y;
|
||||
[win setFrameTopLeftPoint:topLeft];
|
||||
}
|
||||
|
||||
if ([win frame].origin.y < screenOrigin.y) {
|
||||
// Move the window to the top of the screen if the bottom of
|
||||
// the window is still obscured.
|
||||
topLeft.y = NSMaxY([[win screen] frame]);
|
||||
[win setFrameTopLeftPoint:topLeft];
|
||||
}
|
||||
if (NSMaxX(winFrame) > NSMaxX(screenFrame))
|
||||
topLeft.x = NSMinX(screenFrame);
|
||||
if (NSMinY(winFrame) < NSMinY(screenFrame))
|
||||
topLeft.y = NSMaxY(screenFrame);
|
||||
} else {
|
||||
ASLogNotice(@"Window not on screen, don't constrain position");
|
||||
}
|
||||
|
||||
[win setFrameTopLeftPoint:topLeft];
|
||||
}
|
||||
|
||||
if (1 == [vimControllers count]) {
|
||||
@@ -1213,15 +1220,20 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
// (What if input arrives before the vim controller is added to the list of
|
||||
// controllers? This should not be a problem since the input isn't
|
||||
// processed immediately (see processInput:forIdentifier:).)
|
||||
// Also, since the app may be multithreaded (e.g. as a result of showing
|
||||
// the open panel) we have to ensure this call happens on the main thread,
|
||||
// else there is a race condition that may lead to a crash.
|
||||
MMVimController *vc = [[MMVimController alloc] initWithBackend:proxy
|
||||
pid:pid];
|
||||
[self performSelector:@selector(addVimController:)
|
||||
withObject:vc
|
||||
afterDelay:0];
|
||||
[self performSelectorOnMainThread:@selector(addVimController:)
|
||||
withObject:vc
|
||||
waitUntilDone:NO
|
||||
modes:[NSArray arrayWithObject:
|
||||
NSDefaultRunLoopMode]];
|
||||
|
||||
[vc release];
|
||||
|
||||
return [vc identifier];
|
||||
return [vc vimControllerId];
|
||||
}
|
||||
|
||||
- (oneway void)processInput:(in bycopy NSArray *)queue
|
||||
@@ -1251,11 +1263,15 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
// NOTE: We must use "event tracking mode" as well as "default mode",
|
||||
// otherwise the input queue will not be processed e.g. during live
|
||||
// resizing.
|
||||
[self performSelector:@selector(processInputQueues:)
|
||||
withObject:nil
|
||||
afterDelay:0
|
||||
inModes:[NSArray arrayWithObjects:NSDefaultRunLoopMode,
|
||||
NSEventTrackingRunLoopMode, nil]];
|
||||
// Also, since the app may be multithreaded (e.g. as a result of showing
|
||||
// the open panel) we have to ensure this call happens on the main thread,
|
||||
// else there is a race condition that may lead to a crash.
|
||||
[self performSelectorOnMainThread:@selector(processInputQueues:)
|
||||
withObject:nil
|
||||
waitUntilDone:NO
|
||||
modes:[NSArray arrayWithObjects:
|
||||
NSDefaultRunLoopMode,
|
||||
NSEventTrackingRunLoopMode, nil]];
|
||||
}
|
||||
|
||||
- (NSArray *)serverList
|
||||
@@ -1348,6 +1364,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
}
|
||||
|
||||
NSString *path = [pboard stringForType:NSStringPboardType];
|
||||
path = [path stringByExpandingTildeInPath];
|
||||
|
||||
BOOL dirIndicator;
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:path
|
||||
@@ -1546,7 +1563,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
if (openFiles != nil)
|
||||
*openFiles = dict;
|
||||
|
||||
return files;
|
||||
return [files autorelease];
|
||||
}
|
||||
|
||||
#if MM_HANDLE_XCODE_MOD_EVENT
|
||||
@@ -1603,7 +1620,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
NSArray *queries = [[url query] componentsSeparatedByString:@"&"];
|
||||
NSEnumerator *enumerator = [queries objectEnumerator];
|
||||
NSString *param;
|
||||
while( param = [enumerator nextObject] ) {
|
||||
while ((param = [enumerator nextObject])) {
|
||||
NSArray *arr = [param componentsSeparatedByString:@"="];
|
||||
if ([arr count] == 2) {
|
||||
[dict setValue:[[arr lastObject]
|
||||
@@ -1724,19 +1741,30 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
[desc paramDescriptorForKeyword:keyAEPosition];
|
||||
if (xcodedesc) {
|
||||
NSRange range;
|
||||
MMSelectionRange *sr = (MMSelectionRange*)[[xcodedesc data] bytes];
|
||||
NSData *data = [xcodedesc data];
|
||||
NSUInteger length = [data length];
|
||||
|
||||
if (sr->lineNum < 0) {
|
||||
// Should select a range of lines.
|
||||
range.location = sr->startRange + 1;
|
||||
range.length = sr->endRange - sr->startRange + 1;
|
||||
if (length == sizeof(MMXcodeSelectionRange)) {
|
||||
MMXcodeSelectionRange *sr = (MMXcodeSelectionRange*)[data bytes];
|
||||
ASLogDebug(@"Xcode selection range (%d,%d,%d,%d,%d,%d)",
|
||||
sr->unused1, sr->lineNum, sr->startRange, sr->endRange,
|
||||
sr->unused2, sr->theDate);
|
||||
|
||||
if (sr->lineNum < 0) {
|
||||
// Should select a range of lines.
|
||||
range.location = sr->startRange + 1;
|
||||
range.length = sr->endRange - sr->startRange + 1;
|
||||
} else {
|
||||
// Should only move cursor to a line.
|
||||
range.location = sr->lineNum + 1;
|
||||
range.length = 0;
|
||||
}
|
||||
|
||||
[dict setObject:NSStringFromRange(range) forKey:@"selectionRange"];
|
||||
} else {
|
||||
// Should only move cursor to a line.
|
||||
range.location = sr->lineNum + 1;
|
||||
range.length = 0;
|
||||
ASLogErr(@"Xcode selection range size mismatch! got=%d expected=%d",
|
||||
length, sizeof(MMXcodeSelectionRange));
|
||||
}
|
||||
|
||||
[dict setObject:NSStringFromRange(range) forKey:@"selectionRange"];
|
||||
}
|
||||
|
||||
// 3. Extract Spotlight search text (if any)
|
||||
@@ -1913,6 +1941,13 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// HACK: fileAttributesAtPath was deprecated in 10.5
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5)
|
||||
#define MM_fileAttributes(fm,p) [fm attributesOfItemAtPath:p error:NULL]
|
||||
#else
|
||||
#define MM_fileAttributes(fm,p) [fm fileAttributesAtPath:p traverseLink:YES]
|
||||
#endif
|
||||
- (NSDate *)rcFilesModificationDate
|
||||
{
|
||||
// Check modification dates for ~/.vimrc and ~/.gvimrc and return the
|
||||
@@ -1924,20 +1959,20 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
|
||||
NSString *path = [@"~/.vimrc" stringByExpandingTildeInPath];
|
||||
NSDictionary *attr = [fm fileAttributesAtPath:path traverseLink:YES];
|
||||
NSDictionary *attr = MM_fileAttributes(fm, path);
|
||||
if (!attr) {
|
||||
path = [@"~/_vimrc" stringByExpandingTildeInPath];
|
||||
attr = [fm fileAttributesAtPath:path traverseLink:YES];
|
||||
attr = MM_fileAttributes(fm, path);
|
||||
}
|
||||
NSDate *modDate = [attr objectForKey:NSFileModificationDate];
|
||||
if (modDate)
|
||||
date = modDate;
|
||||
|
||||
path = [@"~/.gvimrc" stringByExpandingTildeInPath];
|
||||
attr = [fm fileAttributesAtPath:path traverseLink:YES];
|
||||
attr = MM_fileAttributes(fm, path);
|
||||
if (!attr) {
|
||||
path = [@"~/_gvimrc" stringByExpandingTildeInPath];
|
||||
attr = [fm fileAttributesAtPath:path traverseLink:YES];
|
||||
attr = MM_fileAttributes(fm, path);
|
||||
}
|
||||
modDate = [attr objectForKey:NSFileModificationDate];
|
||||
if (modDate)
|
||||
@@ -1945,6 +1980,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
|
||||
return date;
|
||||
}
|
||||
#undef MM_fileAttributes
|
||||
|
||||
- (BOOL)openVimControllerWithArguments:(NSDictionary *)arguments
|
||||
{
|
||||
@@ -1990,7 +2026,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
|
||||
- (void)startWatchingVimDir
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
if (fsEventStream)
|
||||
return;
|
||||
if (NULL == FSEventStreamStart)
|
||||
@@ -2014,7 +2050,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
|
||||
- (void)stopWatchingVimDir
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
if (NULL == FSEventStreamStop)
|
||||
return; // FSEvent functions are weakly linked
|
||||
|
||||
@@ -2059,7 +2095,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
FSRef fsRef;
|
||||
CFURLGetFSRef((CFURLRef)fontsURL, &fsRef);
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
// This is the font activation API for OS X 10.5. Only compile
|
||||
// this code if we're building on OS X 10.5 or later.
|
||||
if (NULL != ATSFontActivateFromFileReference) { // Weakly linked
|
||||
@@ -2069,7 +2105,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
&fontContainerRef);
|
||||
}
|
||||
#endif
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4)
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5)
|
||||
// The following font activation API was deprecated in OS X 10.5.
|
||||
// Don't compile this code unless we're targeting OS X 10.4.
|
||||
FSSpec fsSpec;
|
||||
@@ -2243,7 +2279,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
int i = 0, count = [vimControllers count];
|
||||
for (i = 0; i < count; ++i) {
|
||||
MMVimController *vc = [vimControllers objectAtIndex:i];
|
||||
if (ukey == [vc identifier]) {
|
||||
if (ukey == [vc vimControllerId]) {
|
||||
[vc processInputQueue:[queues objectForKey:key]]; // !exceptions
|
||||
break;
|
||||
}
|
||||
@@ -2254,7 +2290,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
count = [cachedVimControllers count];
|
||||
for (i = 0; i < count; ++i) {
|
||||
MMVimController *vc = [cachedVimControllers objectAtIndex:i];
|
||||
if (ukey == [vc identifier]) {
|
||||
if (ukey == [vc vimControllerId]) {
|
||||
[vc processInputQueue:[queues objectForKey:key]]; // !exceptions
|
||||
break;
|
||||
}
|
||||
@@ -2270,18 +2306,20 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
// If new input arrived while we were processing it would have been
|
||||
// blocked so we have to schedule it to be processed again.
|
||||
if (processingFlag < 0)
|
||||
[self performSelector:@selector(processInputQueues:)
|
||||
withObject:nil
|
||||
afterDelay:0
|
||||
inModes:[NSArray arrayWithObjects:NSDefaultRunLoopMode,
|
||||
NSEventTrackingRunLoopMode, nil]];
|
||||
[self performSelectorOnMainThread:@selector(processInputQueues:)
|
||||
withObject:nil
|
||||
waitUntilDone:NO
|
||||
modes:[NSArray arrayWithObjects:
|
||||
NSDefaultRunLoopMode,
|
||||
NSEventTrackingRunLoopMode, nil]];
|
||||
|
||||
processingFlag = 0;
|
||||
}
|
||||
|
||||
- (void)addVimController:(MMVimController *)vc
|
||||
{
|
||||
ASLogDebug(@"Add Vim controller pid=%d id=%d", [vc pid], [vc identifier]);
|
||||
ASLogDebug(@"Add Vim controller pid=%d id=%d",
|
||||
[vc pid], [vc vimControllerId]);
|
||||
|
||||
int pid = [vc pid];
|
||||
NSNumber *pidKey = [NSNumber numberWithInt:pid];
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#import "MMApplication.h"
|
||||
|
||||
// Ctrl-Tab is broken on pre 10.5, so we add a hack to make it work.
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
|
||||
# import "MMTextView.h"
|
||||
# define MM_CTRL_TAB_HACK 1
|
||||
#endif
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
#if ENABLE_ATSUI
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MMTextView.h"
|
||||
|
||||
@@ -97,3 +99,5 @@ enum { MMMaxCellsPerChar = 2 };
|
||||
- (NSSize)constrainRows:(int *)rows columns:(int *)cols toSize:(NSSize)size;
|
||||
|
||||
@end
|
||||
|
||||
#endif // ENABLE_ATSUI
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
* resized.
|
||||
*/
|
||||
|
||||
#if ENABLE_ATSUI
|
||||
|
||||
#import "MMAppController.h"
|
||||
#import "MMAtsuiTextView.h"
|
||||
#import "MMTextViewHelper.h"
|
||||
@@ -889,7 +891,7 @@ defaultLineHeightForFont(NSFont *font)
|
||||
|
||||
// The return type of this message changed with OS X 10.5 so we need this
|
||||
// kludge in order to avoid compiler warnings on OS X 10.4.
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
- (NSInteger)conversationIdentifier
|
||||
{
|
||||
return (NSInteger)self;
|
||||
@@ -1268,3 +1270,5 @@ defaultLineHeightForFont(NSFont *font)
|
||||
}
|
||||
|
||||
@end // MMAtsuiTextView (Drawing)
|
||||
|
||||
#endif // ENABLE_ATSUI
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
NSMutableArray *inputQueue;
|
||||
NSMutableData *drawData;
|
||||
NSConnection *connection;
|
||||
NSConnection *vimServerConnection;
|
||||
id appProxy;
|
||||
unsigned identifier;
|
||||
NSDictionary *colorDict;
|
||||
@@ -94,12 +95,12 @@
|
||||
- (char *)browseForFileWithAttributes:(NSDictionary *)attr;
|
||||
- (int)showDialogWithAttributes:(NSDictionary *)attr textField:(char *)txtfield;
|
||||
- (void)showToolbar:(int)enable flags:(int)flags;
|
||||
- (void)createScrollbarWithIdentifier:(long)ident type:(int)type;
|
||||
- (void)destroyScrollbarWithIdentifier:(long)ident;
|
||||
- (void)showScrollbarWithIdentifier:(long)ident state:(int)visible;
|
||||
- (void)setScrollbarPosition:(int)pos length:(int)len identifier:(long)ident;
|
||||
- (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type;
|
||||
- (void)destroyScrollbarWithIdentifier:(int32_t)ident;
|
||||
- (void)showScrollbarWithIdentifier:(int32_t)ident state:(int)visible;
|
||||
- (void)setScrollbarPosition:(int)pos length:(int)len identifier:(int32_t)ident;
|
||||
- (void)setScrollbarThumbValue:(long)val size:(long)size max:(long)max
|
||||
identifier:(long)ident;
|
||||
identifier:(int32_t)ident;
|
||||
- (void)setFont:(GuiFont)font wide:(BOOL)wide;
|
||||
- (void)executeActionWithName:(NSString *)name;
|
||||
- (void)setMouseShape:(int)shape;
|
||||
|
||||
+59
-33
@@ -266,6 +266,7 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
[actionDict release]; actionDict = nil;
|
||||
[sysColorDict release]; sysColorDict = nil;
|
||||
[colorDict release]; colorDict = nil;
|
||||
[vimServerConnection release]; vimServerConnection = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
@@ -679,8 +680,10 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
|
||||
#ifdef MAC_CLIENTSERVER
|
||||
// The default connection is used for the client/server code.
|
||||
[[NSConnection defaultConnection] setRootObject:nil];
|
||||
[[NSConnection defaultConnection] invalidate];
|
||||
if (vimServerConnection) {
|
||||
[vimServerConnection setRootObject:nil];
|
||||
[vimServerConnection invalidate];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -857,39 +860,39 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
[self queueMessage:ShowToolbarMsgID data:data];
|
||||
}
|
||||
|
||||
- (void)createScrollbarWithIdentifier:(long)ident type:(int)type
|
||||
- (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type
|
||||
{
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
|
||||
[data appendBytes:&ident length:sizeof(long)];
|
||||
[data appendBytes:&ident length:sizeof(int32_t)];
|
||||
[data appendBytes:&type length:sizeof(int)];
|
||||
|
||||
[self queueMessage:CreateScrollbarMsgID data:data];
|
||||
}
|
||||
|
||||
- (void)destroyScrollbarWithIdentifier:(long)ident
|
||||
- (void)destroyScrollbarWithIdentifier:(int32_t)ident
|
||||
{
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
[data appendBytes:&ident length:sizeof(long)];
|
||||
[data appendBytes:&ident length:sizeof(int32_t)];
|
||||
|
||||
[self queueMessage:DestroyScrollbarMsgID data:data];
|
||||
}
|
||||
|
||||
- (void)showScrollbarWithIdentifier:(long)ident state:(int)visible
|
||||
- (void)showScrollbarWithIdentifier:(int32_t)ident state:(int)visible
|
||||
{
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
|
||||
[data appendBytes:&ident length:sizeof(long)];
|
||||
[data appendBytes:&ident length:sizeof(int32_t)];
|
||||
[data appendBytes:&visible length:sizeof(int)];
|
||||
|
||||
[self queueMessage:ShowScrollbarMsgID data:data];
|
||||
}
|
||||
|
||||
- (void)setScrollbarPosition:(int)pos length:(int)len identifier:(long)ident
|
||||
- (void)setScrollbarPosition:(int)pos length:(int)len identifier:(int32_t)ident
|
||||
{
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
|
||||
[data appendBytes:&ident length:sizeof(long)];
|
||||
[data appendBytes:&ident length:sizeof(int32_t)];
|
||||
[data appendBytes:&pos length:sizeof(int)];
|
||||
[data appendBytes:&len length:sizeof(int)];
|
||||
|
||||
@@ -897,7 +900,7 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
}
|
||||
|
||||
- (void)setScrollbarThumbValue:(long)val size:(long)size max:(long)max
|
||||
identifier:(long)ident
|
||||
identifier:(int32_t)ident
|
||||
{
|
||||
float fval = max-size+1 > 0 ? (float)val/(max-size+1) : 0;
|
||||
float prop = (float)size/(max+1);
|
||||
@@ -908,7 +911,7 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
|
||||
[data appendBytes:&ident length:sizeof(long)];
|
||||
[data appendBytes:&ident length:sizeof(int32_t)];
|
||||
[data appendBytes:&fval length:sizeof(float)];
|
||||
[data appendBytes:&prop length:sizeof(float)];
|
||||
|
||||
@@ -1052,7 +1055,7 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
if (obj) {
|
||||
NSColor *col = [NSColor performSelector:NSSelectorFromString(obj)];
|
||||
if (col) {
|
||||
float r, g, b, a;
|
||||
CGFloat r, g, b, a;
|
||||
col = [col colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
|
||||
[col getRed:&r green:&g blue:&b alpha:&a];
|
||||
return (((int)(r*255+.5f) & 0xff) << 16)
|
||||
@@ -1122,20 +1125,25 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
{
|
||||
// Look for Ctrl-C immediately instead of waiting until the input queue is
|
||||
// processed since that only happens in waitForInput: (and Vim regularly
|
||||
// checks for Ctrl-C in between waiting for input).
|
||||
// checks for Ctrl-C in between waiting for input). Note that the flag
|
||||
// ctrl_c_interrupts is 0 e.g. when the user has mappings to something like
|
||||
// <C-c>g. Also it seems the flag intr_char is 0 when MacVim was started
|
||||
// from Finder whereas it is 0x03 (= Ctrl_C) when started from Terminal.
|
||||
//
|
||||
// Similarly, TerminateNowMsgID must be checked immediately otherwise code
|
||||
// which waits on the run loop will fail to detect this message (e.g. in
|
||||
// waitForConnectionAcknowledgement).
|
||||
|
||||
if (KeyDownMsgID == msgid && data != nil) {
|
||||
if (KeyDownMsgID == msgid && data != nil && ctrl_c_interrupts) {
|
||||
const void *bytes = [data bytes];
|
||||
/*unsigned mods = *((unsigned*)bytes);*/ bytes += sizeof(unsigned);
|
||||
/*unsigned code = *((unsigned*)bytes);*/ bytes += sizeof(unsigned);
|
||||
unsigned len = *((unsigned*)bytes); bytes += sizeof(unsigned);
|
||||
if (1 == len) {
|
||||
char_u *str = (char_u*)bytes;
|
||||
if ((str[0] == Ctrl_C && ctrl_c_interrupts) ||
|
||||
(str[0] == intr_char && intr_char != Ctrl_C)) {
|
||||
if (str[0] == Ctrl_C || (str[0] == intr_char && intr_char != 0)) {
|
||||
ASLogDebug(@"Got INT, str[0]=%#x ctrl_c_interrupts=%d "
|
||||
"intr_char=%#x", str[0], ctrl_c_interrupts, intr_char);
|
||||
got_int = TRUE;
|
||||
[inputQueue removeAllObjects];
|
||||
return;
|
||||
@@ -1320,22 +1328,28 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
- (void)registerServerWithName:(NSString *)name
|
||||
{
|
||||
NSString *svrName = name;
|
||||
NSConnection *svrConn = [NSConnection defaultConnection];
|
||||
unsigned i;
|
||||
|
||||
if (vimServerConnection) // Paranoia check, should always be nil
|
||||
[vimServerConnection release];
|
||||
|
||||
vimServerConnection = [[NSConnection alloc]
|
||||
initWithReceivePort:[NSPort port]
|
||||
sendPort:nil];
|
||||
|
||||
for (i = 0; i < MMServerMax; ++i) {
|
||||
NSString *connName = [self connectionNameFromServerName:svrName];
|
||||
|
||||
if ([svrConn registerName:connName]) {
|
||||
if ([vimServerConnection registerName:connName]) {
|
||||
ASLogInfo(@"Registered server with name: %@", svrName);
|
||||
|
||||
// TODO: Set request/reply time-outs to something else?
|
||||
//
|
||||
// Don't wait for requests (time-out means that the message is
|
||||
// dropped).
|
||||
[svrConn setRequestTimeout:0];
|
||||
//[svrConn setReplyTimeout:MMReplyTimeout];
|
||||
[svrConn setRootObject:self];
|
||||
[vimServerConnection setRequestTimeout:0];
|
||||
//[vimServerConnection setReplyTimeout:MMReplyTimeout];
|
||||
[vimServerConnection setRootObject:self];
|
||||
|
||||
// NOTE: 'serverName' is a global variable
|
||||
serverName = [svrName vimStringSave];
|
||||
@@ -1345,8 +1359,8 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
#ifdef FEAT_TITLE
|
||||
need_maketitle = TRUE;
|
||||
#endif
|
||||
[self queueMessage:SetServerNameMsgID data:
|
||||
[svrName dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
[self queueMessage:SetServerNameMsgID
|
||||
data:[svrName dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1425,7 +1439,8 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
ASLogNotice(@"serverList failed: reason=%@", ex);
|
||||
}
|
||||
} else {
|
||||
EMSG(_("E???: No connection to MacVim, server listing not possible."));
|
||||
// We get here if a --remote flag is used before MacVim has started.
|
||||
ASLogInfo(@"No connection to MacVim, server listing not possible.");
|
||||
}
|
||||
|
||||
return list;
|
||||
@@ -1495,7 +1510,7 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
ASLogNotice(@"addReply:server: failed: reason=%@", ex);
|
||||
}
|
||||
} else {
|
||||
EMSG2(_("E???: server2client failed; no client with id 0x%x"), port);
|
||||
ASLogNotice(@"server2client failed; no client with id %d", port);
|
||||
}
|
||||
|
||||
return NO;
|
||||
@@ -1953,8 +1968,19 @@ static void netbeansReadCallback(CFSocketRef s,
|
||||
if (mods & MOD_MASK_CMD) {
|
||||
// NOTE: For normal input (non-special, 'macmeta' off) the modifier
|
||||
// flags are already included in the key event. However, the Cmd key
|
||||
// flag is special and must always be added manually. The frontend is
|
||||
// responsible for clearing unnecessary flags when Cmd is held.
|
||||
// flag is special and must always be added manually.
|
||||
// The Shift flag is already included in the key when the Command
|
||||
// key is held. The same goes for Alt, unless Ctrl is held or
|
||||
// 'macmeta' is set. It is important that these flags are cleared
|
||||
// _after_ special keys have been handled, since they should never be
|
||||
// cleared for special keys.
|
||||
mods &= ~MOD_MASK_SHIFT;
|
||||
if (!(mods & MOD_MASK_CTRL)) {
|
||||
BOOL mmta = curbuf ? curbuf->b_p_mmta : YES;
|
||||
if (!mmta)
|
||||
mods &= ~MOD_MASK_ALT;
|
||||
}
|
||||
|
||||
ASLogDebug(@"add mods=%#x", mods);
|
||||
char_u modChars[3] = { CSI, KS_MODIFIER, mods };
|
||||
add_to_input_buf(modChars, 3);
|
||||
@@ -2197,7 +2223,7 @@ static void netbeansReadCallback(CFSocketRef s,
|
||||
if (!data) return;
|
||||
|
||||
const void *bytes = [data bytes];
|
||||
long ident = *((long*)bytes); bytes += sizeof(long);
|
||||
int32_t ident = *((int32_t*)bytes); bytes += sizeof(int32_t);
|
||||
int hitPart = *((int*)bytes); bytes += sizeof(int);
|
||||
float fval = *((float*)bytes); bytes += sizeof(float);
|
||||
scrollbar_T *sb = gui_find_scrollbar(ident);
|
||||
@@ -2242,12 +2268,12 @@ static void netbeansReadCallback(CFSocketRef s,
|
||||
// need to set the knob position in the other cases.
|
||||
if (sb->wp) {
|
||||
// Update both the left&right vertical scrollbars.
|
||||
long identLeft = sb->wp->w_scrollbars[SBAR_LEFT].ident;
|
||||
long identRight = sb->wp->w_scrollbars[SBAR_RIGHT].ident;
|
||||
int32_t idL = (int32_t)sb->wp->w_scrollbars[SBAR_LEFT].ident;
|
||||
int32_t idR = (int32_t)sb->wp->w_scrollbars[SBAR_RIGHT].ident;
|
||||
[self setScrollbarThumbValue:value size:size max:max
|
||||
identifier:identLeft];
|
||||
identifier:idL];
|
||||
[self setScrollbarThumbValue:value size:size max:max
|
||||
identifier:identRight];
|
||||
identifier:idR];
|
||||
} else {
|
||||
// Update the horizontal scrollbar.
|
||||
[self setScrollbarThumbValue:value size:size max:max
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#import "MMWindowController.h"
|
||||
#import "Miscellaneous.h"
|
||||
#import <Carbon/Carbon.h>
|
||||
#import <PSMTabBarControl.h>
|
||||
#import <PSMTabBarControl/PSMTabBarControl.h>
|
||||
|
||||
// These have to be the same as in option.h
|
||||
#define FUOPT_MAXVERT 0x001
|
||||
|
||||
@@ -227,7 +227,7 @@ NSString *kOdbEditorIdentifierWriteRoom = @"com.hogbaysoftware.WriteRoom";
|
||||
// user changes settings in terminal, the changes are reflected in the
|
||||
// dialog)
|
||||
|
||||
NSString *versionString;
|
||||
NSString *versionString = @"";
|
||||
|
||||
// Check if ODB path exists before calling isFilePackageAtPath: otherwise
|
||||
// an error is output to stderr on Tiger.
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MacVim.h"
|
||||
|
||||
|
||||
#define MM_USE_ROW_CACHE 1
|
||||
@@ -48,10 +48,8 @@ typedef struct {
|
||||
}
|
||||
|
||||
- (NSString *)string;
|
||||
- (NSDictionary *)attributesAtIndex:(unsigned)index
|
||||
- (NSDictionary *)attributesAtIndex:(NSUInteger)index
|
||||
effectiveRange:(NSRangePointer)aRange;
|
||||
- (id)attribute:(NSString *)attrib atIndex:(unsigned)index
|
||||
effectiveRange:(NSRangePointer)range;
|
||||
- (void)replaceCharactersInRange:(NSRange)aRange
|
||||
withString:(NSString *)aString;
|
||||
- (void)setAttributes:(NSDictionary *)attributes range:(NSRange)aRange;
|
||||
@@ -89,7 +87,7 @@ typedef struct {
|
||||
- (NSSize)cellSize;
|
||||
- (NSRect)rectForRowsInRange:(NSRange)range;
|
||||
- (NSRect)rectForColumnsInRange:(NSRange)range;
|
||||
- (unsigned)characterIndexForRow:(int)row column:(int)col;
|
||||
- (NSUInteger)characterIndexForRow:(int)row column:(int)col;
|
||||
- (BOOL)resizeToFitSize:(NSSize)size;
|
||||
- (NSSize)fitToSize:(NSSize)size;
|
||||
- (NSSize)fitToSize:(NSSize)size rows:(int *)rows columns:(int *)columns;
|
||||
|
||||
+10
-18
@@ -112,25 +112,12 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
return [attribString string];
|
||||
}
|
||||
|
||||
- (NSDictionary *)attributesAtIndex:(unsigned)index
|
||||
- (NSDictionary *)attributesAtIndex:(NSUInteger)index
|
||||
effectiveRange:(NSRangePointer)range
|
||||
{
|
||||
if (index >= [attribString length]) {
|
||||
if (range)
|
||||
*range = NSMakeRange(NSNotFound, 0);
|
||||
|
||||
return [NSDictionary dictionary];
|
||||
}
|
||||
|
||||
return [attribString attributesAtIndex:index effectiveRange:range];
|
||||
}
|
||||
|
||||
- (id)attribute:(NSString *)attrib atIndex:(unsigned)index
|
||||
effectiveRange:(NSRangePointer)range
|
||||
{
|
||||
return [attribString attribute:attrib atIndex:index effectiveRange:range];
|
||||
}
|
||||
|
||||
- (void)replaceCharactersInRange:(NSRange)range
|
||||
withString:(NSString *)string
|
||||
{
|
||||
@@ -326,7 +313,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
[attribString replaceCharactersInRange:range withString:string];
|
||||
[attribString setAttributes:attributes range:r];
|
||||
|
||||
unsigned changeInLength = [string length] - range.length;
|
||||
NSInteger changeInLength = [string length] - range.length;
|
||||
if (acells != cells || acol != col) {
|
||||
if (acells == cells + 1) {
|
||||
// NOTE: A normal width character replaced a double width
|
||||
@@ -363,6 +350,11 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
|
||||
[self fixInvalidCharactersInRange:r];
|
||||
|
||||
#if 0
|
||||
ASLogDebug(@"length=%d row=%d col=%d cells=%d replaceRange=%@ change=%d",
|
||||
[string length], row, col, cells,
|
||||
NSStringFromRange(r), changeInLength);
|
||||
#endif
|
||||
[self edited:(NSTextStorageEditedCharacters|NSTextStorageEditedAttributes)
|
||||
range:range changeInLength:changeInLength];
|
||||
|
||||
@@ -777,7 +769,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
|
||||
- (NSRect)rectForRowsInRange:(NSRange)range
|
||||
{
|
||||
NSRect rect = { 0, 0, 0, 0 };
|
||||
NSRect rect = { {0, 0}, {0, 0} };
|
||||
unsigned start = range.location > maxRows ? maxRows : range.location;
|
||||
unsigned length = range.length;
|
||||
|
||||
@@ -792,7 +784,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
|
||||
- (NSRect)rectForColumnsInRange:(NSRange)range
|
||||
{
|
||||
NSRect rect = { 0, 0, 0, 0 };
|
||||
NSRect rect = { {0, 0}, {0, 0} };
|
||||
unsigned start = range.location > maxColumns ? maxColumns : range.location;
|
||||
unsigned length = range.length;
|
||||
|
||||
@@ -805,7 +797,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
return rect;
|
||||
}
|
||||
|
||||
- (unsigned)characterIndexForRow:(int)row column:(int)col
|
||||
- (NSUInteger)characterIndexForRow:(int)row column:(int)col
|
||||
{
|
||||
int cells = 1;
|
||||
NSRange range = [self charRangeForRow:row column:&col cells:&cells];
|
||||
|
||||
@@ -937,7 +937,7 @@
|
||||
numColumns:ncols];
|
||||
[self setNeedsDisplayInRect:invertRects[n]];
|
||||
} else {
|
||||
n = numInvertRects = 0;
|
||||
numInvertRects = 0;
|
||||
}
|
||||
} else {
|
||||
// The result should look normal; all we need to do is to mark
|
||||
|
||||
@@ -49,7 +49,7 @@ static float MMDragAreaSize = 73.0f;
|
||||
|
||||
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
static BOOL
|
||||
KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
{
|
||||
@@ -77,7 +77,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
[markedText release]; markedText = nil;
|
||||
[markedTextAttributes release]; markedTextAttributes = nil;
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
if (asciiImSource) {
|
||||
CFRelease(asciiImSource);
|
||||
asciiImSource = NULL;
|
||||
@@ -114,6 +114,12 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
{
|
||||
ASLogDebug(@"%@", event);
|
||||
|
||||
// NOTE: Check IM state _before_ key has been interpreted or we'll pick up
|
||||
// the old IM state when it has been switched via a keyboard shortcut that
|
||||
// MacVim cannot handle.
|
||||
if (imControl)
|
||||
[self checkImState];
|
||||
|
||||
// NOTE: Keyboard handling is complicated by the fact that we must call
|
||||
// interpretKeyEvents: otherwise key equivalents set up by input methods do
|
||||
// not work (e.g. Ctrl-Shift-; would not work under Kotoeri).
|
||||
@@ -149,6 +155,15 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
&& [unmod characterAtIndex:0] < 0x7f) {
|
||||
ASLogDebug(@"MACMETA key, don't interpret it");
|
||||
string = unmod;
|
||||
} else if (imState && (flags & NSControlKeyMask)
|
||||
&& !(flags & (NSAlternateKeyMask|NSCommandKeyMask))
|
||||
&& [unmod length] == 1
|
||||
&& ([unmod characterAtIndex:0] == '6' ||
|
||||
[unmod characterAtIndex:0] == '^')) {
|
||||
// HACK! interpretKeyEvents: does not call doCommandBySelector:
|
||||
// with Ctrl-6 or Ctrl-^ when IM is active.
|
||||
[self doKeyDown:@"\x1e"];
|
||||
string = nil;
|
||||
} else {
|
||||
// HACK! interpretKeyEvents: may call insertText: or
|
||||
// doCommandBySelector:, or it may swallow the key (most likely the
|
||||
@@ -162,8 +177,8 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
// HACK! When Command is held we have to more or less guess whether
|
||||
// we should use characters or charactersIgnoringModifiers. The
|
||||
// following heuristic seems to work but it may have to change.
|
||||
// Note that the Shift and Alt flags may be cleared before passing
|
||||
// the event on to Vim (see doKeyDown:).
|
||||
// Note that the Shift and Alt flags may also need to be cleared
|
||||
// (see doKeyDown:keyCode:modifiers: in MMBackend).
|
||||
if ((flags & NSShiftKeyMask && !(flags & NSAlternateKeyMask))
|
||||
|| flags & NSControlKeyMask)
|
||||
string = unmod;
|
||||
@@ -173,11 +188,6 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
if (string)
|
||||
[self doKeyDown:string];
|
||||
|
||||
// NOTE: Check IM state _after_ key has been interpreted or we'll pick up
|
||||
// the old IM state when it has been switched via a keyboard shortcut.
|
||||
if (imControl)
|
||||
[self checkImState];
|
||||
|
||||
[currentEvent release];
|
||||
currentEvent = nil;
|
||||
}
|
||||
@@ -251,7 +261,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
@selector(deleteWordBackward:) == sel ||
|
||||
@selector(deleteBackwardByDecomposingPreviousCharacter:) == sel ||
|
||||
@selector(deleteToBeginningOfLine:) == sel)
|
||||
[self doKeyDown:@"\x7f"];
|
||||
[self doKeyDown:@"\x08"];
|
||||
else if (@selector(keySpace:) == sel)
|
||||
[self doKeyDown:@" "];
|
||||
else if (@selector(cancel:) == sel)
|
||||
@@ -262,6 +272,8 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
- (BOOL)performKeyEquivalent:(NSEvent *)event
|
||||
{
|
||||
ASLogDebug(@"");
|
||||
if ([event type] != NSKeyDown)
|
||||
return NO;
|
||||
|
||||
// NOTE: Key equivalent handling was fixed in Leopard. That is, an
|
||||
// unhandled key equivalent is passed to keyDown: -- contrast this with
|
||||
@@ -771,10 +783,10 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
// backend. On >=10.5 and later we do not forward changes to the input
|
||||
// method, instead we let Vim be in complete control.
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
// The TIS symbols are weakly linked.
|
||||
if (NULL != TISCopyCurrentKeyboardInputSource) {
|
||||
// We get here when compiled on =>10.5 and running on >=10.5.
|
||||
// We get here when compiled on >=10.5 and running on >=10.5.
|
||||
|
||||
if (asciiImSource) {
|
||||
CFRelease(asciiImSource);
|
||||
@@ -785,16 +797,15 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
lastImSource = NULL;
|
||||
}
|
||||
if (enable) {
|
||||
// Save current input source for use when IM is active and get an
|
||||
// ASCII source for use when IM is deactivated (by Vim).
|
||||
// Save current locale input source for use when IM is active and
|
||||
// get an ASCII source for use when IM is deactivated (by Vim).
|
||||
asciiImSource = TISCopyCurrentASCIICapableKeyboardInputSource();
|
||||
lastImSource = TISCopyCurrentKeyboardInputSource();
|
||||
NSString *locale = [[NSLocale currentLocale] localeIdentifier];
|
||||
lastImSource = TISCopyInputSourceForLanguage((CFStringRef)locale);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// The imControl flag is only used on 10.4 -- on >=10.5 we wait for Vim to
|
||||
// call activateIm: and never explicitly check if the input source changes.
|
||||
imControl = enable;
|
||||
ASLogInfo(@"IM control %sabled", enable ? "en" : "dis");
|
||||
}
|
||||
@@ -802,38 +813,16 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
- (void)activateIm:(BOOL)enable
|
||||
{
|
||||
ASLogInfo(@"Activate IM=%d", enable);
|
||||
imState = enable;
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
// The TIS symbols are weakly linked.
|
||||
if (NULL != TISCopyCurrentKeyboardInputSource) {
|
||||
// We get here when compiled on >=10.5 and running on >=10.5.
|
||||
|
||||
TISInputSourceRef ref = NULL;
|
||||
if (enable) {
|
||||
// Enable IM: switch back to input source used when IM was last on.
|
||||
ref = lastImSource;
|
||||
} else {
|
||||
// Disable IM: switch back to ASCII input source that was used when
|
||||
// IM was last off.
|
||||
ref = asciiImSource;
|
||||
|
||||
TISInputSourceRef cur = TISCopyCurrentKeyboardInputSource();
|
||||
if (!KeyboardInputSourcesEqual(asciiImSource, cur)) {
|
||||
// Remember current input source so we can switch back to it
|
||||
// when IM is once more enabled. Note that Vim will call this
|
||||
// method with "enable=NO" even when the ASCII input source is
|
||||
// in use which is why we only remember the current input
|
||||
// source unless it is the ASCII source.
|
||||
ASLogDebug(@"Remember last input source: %@",
|
||||
TISGetInputSourceProperty(cur, kTISPropertyInputSourceID));
|
||||
if (lastImSource) CFRelease(lastImSource);
|
||||
lastImSource = cur;
|
||||
} else {
|
||||
CFRelease(cur);
|
||||
cur = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Enable IM: switch back to input source used when IM was last on
|
||||
// Disable IM: switch back to ASCII input source (set in setImControl:)
|
||||
TISInputSourceRef ref = enable ? lastImSource : asciiImSource;
|
||||
if (ref) {
|
||||
ASLogDebug(@"Change input source: %@",
|
||||
TISGetInputSourceProperty(ref, kTISPropertyInputSourceID));
|
||||
@@ -846,7 +835,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
// We get here when compiled on >=10.5 but running on 10.4 -- fall through
|
||||
// and use old IM code...
|
||||
#endif
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4)
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5)
|
||||
// NOTE: The IM code is delegated to the frontend since calling it in
|
||||
// the backend caused weird bugs (second dock icon appearing etc.).
|
||||
KeyScript(enable ? smKeySysScript : smKeyRoman);
|
||||
@@ -895,18 +884,6 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
unsigned keyCode = [currentEvent keyCode];
|
||||
unsigned flags = [currentEvent modifierFlags];
|
||||
|
||||
if (flags & NSCommandKeyMask) {
|
||||
// The Shift flag is already included in the key when the Command key
|
||||
// is held. The same goes for Alt, unless Ctrl is held or 'macmeta' is
|
||||
// set.
|
||||
flags &= ~NSShiftKeyMask;
|
||||
if (!(flags & NSControlKeyMask)) {
|
||||
id mmta = [[[self vimController] vimState] objectForKey:@"p_mmta"];
|
||||
if (![mmta boolValue])
|
||||
flags &= ~NSAlternateKeyMask;
|
||||
}
|
||||
}
|
||||
|
||||
// The low 16 bits are not used for modifier flags by NSEvent. Use
|
||||
// these bits for custom flags.
|
||||
flags &= NSDeviceIndependentModifierFlagsMask;
|
||||
@@ -962,12 +939,32 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
|
||||
- (void)checkImState
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4)
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
if (NULL != TISCopyCurrentKeyboardInputSource)
|
||||
return; // Compiled for >=10.4, running on >=10.5
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
if (NULL != TISCopyCurrentKeyboardInputSource) {
|
||||
// We get here when compiled on >=10.5 and running on >=10.5.
|
||||
TISInputSourceRef cur = TISCopyCurrentKeyboardInputSource();
|
||||
BOOL state = !KeyboardInputSourcesEqual(asciiImSource, cur);
|
||||
BOOL isChanged = !KeyboardInputSourcesEqual(lastImSource, cur);
|
||||
if (state && isChanged) {
|
||||
// Remember current input source so we can switch back to it
|
||||
// when IM is once more enabled.
|
||||
ASLogDebug(@"Remember last input source: %@",
|
||||
TISGetInputSourceProperty(cur, kTISPropertyInputSourceID));
|
||||
if (lastImSource) CFRelease(lastImSource);
|
||||
lastImSource = cur;
|
||||
} else {
|
||||
CFRelease(cur);
|
||||
}
|
||||
if (imState != state) {
|
||||
imState = state;
|
||||
int msgid = state ? ActivatedImMsgID : DeactivatedImMsgID;
|
||||
[[self vimController] sendMessage:msgid data:nil];
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
// Compiled for >=10.4, running on 10.4
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5)
|
||||
// Compiled for <=10.4, running on 10.4
|
||||
|
||||
// IM is active whenever the current script is the system script and the
|
||||
// system script isn't roman. (Hence IM can only be active when using
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
- (void)willSetLineFragmentRect:(NSRectPointer)lineRect
|
||||
forGlyphRange:(NSRange)glyphRange
|
||||
usedRect:(NSRectPointer)usedRect
|
||||
baselineOffset:(float *)baselineOffset
|
||||
baselineOffset:(CGFloat *)baselineOffset
|
||||
{
|
||||
MMTextStorage *ts = (MMTextStorage*)[[self layoutManager] textStorage];
|
||||
float h = [ts cellSize].height;
|
||||
@@ -103,9 +103,9 @@
|
||||
// height and that EOL glyphs are hidden.
|
||||
//
|
||||
- (void)layoutGlyphsInLayoutManager:(NSLayoutManager *)lm
|
||||
startingAtGlyphIndex:(unsigned)startGlyphIdx
|
||||
maxNumberOfLineFragments:(unsigned)maxNumLines
|
||||
nextGlyphIndex:(unsigned *)nextGlyph
|
||||
startingAtGlyphIndex:(NSUInteger)startGlyphIdx
|
||||
maxNumberOfLineFragments:(NSUInteger)maxNumLines
|
||||
nextGlyphIndex:(NSUInteger *)nextGlyph
|
||||
{
|
||||
// TODO: Check that it really is an MMTextStorage?
|
||||
MMTextStorage *ts = (MMTextStorage*)[lm textStorage];
|
||||
@@ -160,8 +160,8 @@
|
||||
|
||||
NSRange lineRange = { lineIdx, 0 };
|
||||
NSRange glyphRange = { startGlyphIdx, 0 };
|
||||
NSRect lineRect = { 0, line*cellSize.height,
|
||||
[ts actualColumns]*cellSize.width, cellSize.height };
|
||||
NSRect lineRect = { {0, line*cellSize.height},
|
||||
{[ts actualColumns]*cellSize.width, cellSize.height} };
|
||||
int endLine = line + maxNumLines;
|
||||
if (endLine > actualRows)
|
||||
endLine = actualRows;
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MacVim.h"
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
@@ -20,7 +19,12 @@
|
||||
|
||||
|
||||
|
||||
@interface MMVimController : NSObject {
|
||||
@interface MMVimController : NSObject
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
||||
// 10.6 has turned delegate messages into formal protocols
|
||||
<NSToolbarDelegate, NSOpenSavePanelDelegate>
|
||||
#endif
|
||||
{
|
||||
unsigned identifier;
|
||||
BOOL isInitialized;
|
||||
MMWindowController *windowController;
|
||||
@@ -40,7 +44,7 @@
|
||||
}
|
||||
|
||||
- (id)initWithBackend:(id)backend pid:(int)processIdentifier;
|
||||
- (unsigned)identifier;
|
||||
- (unsigned)vimControllerId;
|
||||
- (id)backendProxy;
|
||||
- (int)pid;
|
||||
- (void)setServerName:(NSString *)name;
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
*/
|
||||
|
||||
#import "MMAppController.h"
|
||||
#import "MMAtsuiTextView.h"
|
||||
#import "MMFindReplaceController.h"
|
||||
#import "MMTextView.h"
|
||||
#import "MMVimController.h"
|
||||
@@ -185,7 +184,7 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (unsigned)identifier
|
||||
- (unsigned)vimControllerId
|
||||
{
|
||||
return identifier;
|
||||
}
|
||||
@@ -657,24 +656,24 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
[windowController showToolbar:enable size:size mode:mode];
|
||||
} else if (CreateScrollbarMsgID == msgid) {
|
||||
const void *bytes = [data bytes];
|
||||
long ident = *((long*)bytes); bytes += sizeof(long);
|
||||
int32_t ident = *((int32_t*)bytes); bytes += sizeof(int32_t);
|
||||
int type = *((int*)bytes); bytes += sizeof(int);
|
||||
|
||||
[windowController createScrollbarWithIdentifier:ident type:type];
|
||||
} else if (DestroyScrollbarMsgID == msgid) {
|
||||
const void *bytes = [data bytes];
|
||||
long ident = *((long*)bytes); bytes += sizeof(long);
|
||||
int32_t ident = *((int32_t*)bytes); bytes += sizeof(int32_t);
|
||||
|
||||
[windowController destroyScrollbarWithIdentifier:ident];
|
||||
} else if (ShowScrollbarMsgID == msgid) {
|
||||
const void *bytes = [data bytes];
|
||||
long ident = *((long*)bytes); bytes += sizeof(long);
|
||||
int32_t ident = *((int32_t*)bytes); bytes += sizeof(int32_t);
|
||||
int visible = *((int*)bytes); bytes += sizeof(int);
|
||||
|
||||
[windowController showScrollbarWithIdentifier:ident state:visible];
|
||||
} else if (SetScrollbarPositionMsgID == msgid) {
|
||||
const void *bytes = [data bytes];
|
||||
long ident = *((long*)bytes); bytes += sizeof(long);
|
||||
int32_t ident = *((int32_t*)bytes); bytes += sizeof(int32_t);
|
||||
int pos = *((int*)bytes); bytes += sizeof(int);
|
||||
int len = *((int*)bytes); bytes += sizeof(int);
|
||||
|
||||
@@ -682,7 +681,7 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
identifier:ident];
|
||||
} else if (SetScrollbarThumbMsgID == msgid) {
|
||||
const void *bytes = [data bytes];
|
||||
long ident = *((long*)bytes); bytes += sizeof(long);
|
||||
int32_t ident = *((int32_t*)bytes); bytes += sizeof(int32_t);
|
||||
float val = *((float*)bytes); bytes += sizeof(float);
|
||||
float prop = *((float*)bytes); bytes += sizeof(float);
|
||||
|
||||
@@ -987,7 +986,7 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
if (!toolbar) {
|
||||
// NOTE! Each toolbar must have a unique identifier, else each
|
||||
// window will have the same toolbar.
|
||||
NSString *ident = [NSString stringWithFormat:@"%d", (int)self];
|
||||
NSString *ident = [NSString stringWithFormat:@"%d", identifier];
|
||||
toolbar = [[NSToolbar alloc] initWithIdentifier:ident];
|
||||
|
||||
[toolbar setShowsBaselineSeparator:NO];
|
||||
@@ -1107,7 +1106,7 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
// Only remove toolbar items, never actually remove the toolbar
|
||||
// itself or strange things may happen.
|
||||
if ([desc count] == 2) {
|
||||
int idx = [toolbar indexOfItemWithItemIdentifier:title];
|
||||
NSUInteger idx = [toolbar indexOfItemWithItemIdentifier:title];
|
||||
if (idx != NSNotFound)
|
||||
[toolbar removeItemAtIndex:idx];
|
||||
}
|
||||
@@ -1285,10 +1284,15 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
// free objects that Cocoa is currently using (e.g. view objects). The
|
||||
// following call ensures that the vim controller is not released until the
|
||||
// run loop is back in the 'default' mode.
|
||||
// Also, since the app may be multithreaded (e.g. as a result of showing
|
||||
// the open panel) we have to ensure this call happens on the main thread,
|
||||
// else there is a race condition that may lead to a crash.
|
||||
[[MMAppController sharedInstance]
|
||||
performSelector:@selector(removeVimController:)
|
||||
withObject:self
|
||||
afterDelay:0];
|
||||
performSelectorOnMainThread:@selector(removeVimController:)
|
||||
withObject:self
|
||||
waitUntilDone:NO
|
||||
modes:[NSArray arrayWithObject:
|
||||
NSDefaultRunLoopMode]];
|
||||
}
|
||||
|
||||
// NSSavePanel delegate
|
||||
|
||||
@@ -43,12 +43,12 @@
|
||||
- (void)selectTabWithIndex:(int)idx;
|
||||
- (NSTabViewItem *)addNewTabViewItem;
|
||||
|
||||
- (void)createScrollbarWithIdentifier:(long)ident type:(int)type;
|
||||
- (BOOL)destroyScrollbarWithIdentifier:(long)ident;
|
||||
- (BOOL)showScrollbarWithIdentifier:(long)ident state:(BOOL)visible;
|
||||
- (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type;
|
||||
- (BOOL)destroyScrollbarWithIdentifier:(int32_t)ident;
|
||||
- (BOOL)showScrollbarWithIdentifier:(int32_t)ident state:(BOOL)visible;
|
||||
- (void)setScrollbarThumbValue:(float)val proportion:(float)prop
|
||||
identifier:(long)ident;
|
||||
- (void)setScrollbarPosition:(int)pos length:(int)len identifier:(long)ident;
|
||||
identifier:(int32_t)ident;
|
||||
- (void)setScrollbarPosition:(int)pos length:(int)len identifier:(int32_t)ident;
|
||||
|
||||
- (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore;
|
||||
|
||||
|
||||
+36
-26
@@ -24,7 +24,7 @@
|
||||
#import "MMVimView.h"
|
||||
#import "MMWindowController.h"
|
||||
#import "Miscellaneous.h"
|
||||
#import <PSMTabBarControl.h>
|
||||
#import <PSMTabBarControl/PSMTabBarControl.h>
|
||||
|
||||
|
||||
|
||||
@@ -38,12 +38,12 @@ enum {
|
||||
|
||||
// TODO: Move!
|
||||
@interface MMScroller : NSScroller {
|
||||
long identifier;
|
||||
int32_t identifier;
|
||||
int type;
|
||||
NSRange range;
|
||||
}
|
||||
- (id)initWithIdentifier:(long)ident type:(int)type;
|
||||
- (long)identifier;
|
||||
- (id)initWithIdentifier:(int32_t)ident type:(int)type;
|
||||
- (int32_t)scrollerId;
|
||||
- (int)type;
|
||||
- (NSRange)range;
|
||||
- (void)setRange:(NSRange)newRange;
|
||||
@@ -55,8 +55,8 @@ enum {
|
||||
- (BOOL)leftScrollbarVisible;
|
||||
- (BOOL)rightScrollbarVisible;
|
||||
- (void)placeScrollbars;
|
||||
- (int)representedIndexOfTabViewItem:(NSTabViewItem *)tvi;
|
||||
- (MMScroller *)scrollbarForIdentifier:(long)ident index:(unsigned *)idx;
|
||||
- (NSUInteger)representedIndexOfTabViewItem:(NSTabViewItem *)tvi;
|
||||
- (MMScroller *)scrollbarForIdentifier:(int32_t)ident index:(unsigned *)idx;
|
||||
- (NSSize)vimViewSizeForTextViewSize:(NSSize)textViewSize;
|
||||
- (NSRect)textViewRectForVimViewSize:(NSSize)contentSize;
|
||||
- (NSTabView *)tabView;
|
||||
@@ -89,13 +89,16 @@ enum {
|
||||
[self setAutoresizesSubviews:YES];
|
||||
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
#if ENABLE_ATSUI
|
||||
if ([ud boolForKey:MMAtsuiRendererKey]) {
|
||||
// Use ATSUI for text rendering.
|
||||
//
|
||||
// HACK! 'textView' has type MMTextView, but MMAtsuiTextView is not
|
||||
// derived from MMTextView.
|
||||
textView = [[MMAtsuiTextView alloc] initWithFrame:frame];
|
||||
} else {
|
||||
} else
|
||||
#endif // ENABLE_ATSUI
|
||||
{
|
||||
// Use Cocoa text system for text rendering.
|
||||
textView = [[MMTextView alloc] initWithFrame:frame];
|
||||
}
|
||||
@@ -371,7 +374,7 @@ enum {
|
||||
return tvi;
|
||||
}
|
||||
|
||||
- (void)createScrollbarWithIdentifier:(long)ident type:(int)type
|
||||
- (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type
|
||||
{
|
||||
MMScroller *scroller = [[MMScroller alloc] initWithIdentifier:ident
|
||||
type:type];
|
||||
@@ -383,7 +386,7 @@ enum {
|
||||
[scroller release];
|
||||
}
|
||||
|
||||
- (BOOL)destroyScrollbarWithIdentifier:(long)ident
|
||||
- (BOOL)destroyScrollbarWithIdentifier:(int32_t)ident
|
||||
{
|
||||
unsigned idx = 0;
|
||||
MMScroller *scroller = [self scrollbarForIdentifier:ident index:&idx];
|
||||
@@ -397,7 +400,7 @@ enum {
|
||||
return ![scroller isHidden];
|
||||
}
|
||||
|
||||
- (BOOL)showScrollbarWithIdentifier:(long)ident state:(BOOL)visible
|
||||
- (BOOL)showScrollbarWithIdentifier:(int32_t)ident state:(BOOL)visible
|
||||
{
|
||||
MMScroller *scroller = [self scrollbarForIdentifier:ident index:NULL];
|
||||
if (!scroller) return NO;
|
||||
@@ -411,10 +414,15 @@ enum {
|
||||
}
|
||||
|
||||
- (void)setScrollbarThumbValue:(float)val proportion:(float)prop
|
||||
identifier:(long)ident
|
||||
identifier:(int32_t)ident
|
||||
{
|
||||
MMScroller *scroller = [self scrollbarForIdentifier:ident index:NULL];
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5)
|
||||
[scroller setDoubleValue:val];
|
||||
[scroller setKnobProportion:prop];
|
||||
#else
|
||||
[scroller setFloatValue:val knobProportion:prop];
|
||||
#endif
|
||||
[scroller setEnabled:prop != 1.f];
|
||||
}
|
||||
|
||||
@@ -422,18 +430,18 @@ enum {
|
||||
- (void)scroll:(id)sender
|
||||
{
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
long ident = [(MMScroller*)sender identifier];
|
||||
int32_t ident = [(MMScroller*)sender scrollerId];
|
||||
int hitPart = [sender hitPart];
|
||||
float value = [sender floatValue];
|
||||
|
||||
[data appendBytes:&ident length:sizeof(long)];
|
||||
[data appendBytes:&ident length:sizeof(int32_t)];
|
||||
[data appendBytes:&hitPart length:sizeof(int)];
|
||||
[data appendBytes:&value length:sizeof(float)];
|
||||
|
||||
[vimController sendMessage:ScrollbarEventMsgID data:data];
|
||||
}
|
||||
|
||||
- (void)setScrollbarPosition:(int)pos length:(int)len identifier:(long)ident
|
||||
- (void)setScrollbarPosition:(int)pos length:(int)len identifier:(int32_t)ident
|
||||
{
|
||||
MMScroller *scroller = [self scrollbarForIdentifier:ident index:NULL];
|
||||
NSRange range = NSMakeRange(pos, len);
|
||||
@@ -470,9 +478,10 @@ enum {
|
||||
// flag is set when Vim initiated the selection.
|
||||
if (!vimTaskSelectedTab) {
|
||||
// Propagate the selection message to Vim.
|
||||
int idx = [self representedIndexOfTabViewItem:tabViewItem];
|
||||
NSUInteger idx = [self representedIndexOfTabViewItem:tabViewItem];
|
||||
if (NSNotFound != idx) {
|
||||
NSData *data = [NSData dataWithBytes:&idx length:sizeof(int)];
|
||||
int i = (int)idx; // HACK! Never more than MAXINT tabs?!
|
||||
NSData *data = [NSData dataWithBytes:&i length:sizeof(int)];
|
||||
[vimController sendMessage:SelectTabMsgID data:data];
|
||||
}
|
||||
}
|
||||
@@ -488,8 +497,9 @@ enum {
|
||||
// HACK! This method is only called when the user clicks the close button
|
||||
// on the tab. Instead of letting the tab bar close the tab, we return NO
|
||||
// and pass a message on to Vim to let it handle the closing.
|
||||
int idx = [self representedIndexOfTabViewItem:tabViewItem];
|
||||
NSData *data = [NSData dataWithBytes:&idx length:sizeof(int)];
|
||||
NSUInteger idx = [self representedIndexOfTabViewItem:tabViewItem];
|
||||
int i = (int)idx; // HACK! Never more than MAXINT tabs?!
|
||||
NSData *data = [NSData dataWithBytes:&i length:sizeof(int)];
|
||||
[vimController sendMessage:CloseTabMsgID data:data];
|
||||
|
||||
return NO;
|
||||
@@ -506,7 +516,7 @@ enum {
|
||||
|
||||
- (NSDragOperation)tabBarControl:(PSMTabBarControl *)theTabBarControl
|
||||
draggingEntered:(id <NSDraggingInfo>)sender
|
||||
forTabAtIndex:(unsigned)tabIndex
|
||||
forTabAtIndex:(NSUInteger)tabIndex
|
||||
{
|
||||
NSPasteboard *pb = [sender draggingPasteboard];
|
||||
return [[pb types] containsObject:NSFilenamesPboardType]
|
||||
@@ -516,7 +526,7 @@ enum {
|
||||
|
||||
- (BOOL)tabBarControl:(PSMTabBarControl *)theTabBarControl
|
||||
performDragOperation:(id <NSDraggingInfo>)sender
|
||||
forTabAtIndex:(unsigned)tabIndex
|
||||
forTabAtIndex:(NSUInteger)tabIndex
|
||||
{
|
||||
NSPasteboard *pb = [sender draggingPasteboard];
|
||||
if ([[pb types] containsObject:NSFilenamesPboardType]) {
|
||||
@@ -740,18 +750,18 @@ enum {
|
||||
}
|
||||
}
|
||||
|
||||
- (int)representedIndexOfTabViewItem:(NSTabViewItem *)tvi
|
||||
- (NSUInteger)representedIndexOfTabViewItem:(NSTabViewItem *)tvi
|
||||
{
|
||||
NSArray *tabViewItems = [[self tabBarControl] representedTabViewItems];
|
||||
return [tabViewItems indexOfObject:tvi];
|
||||
}
|
||||
|
||||
- (MMScroller *)scrollbarForIdentifier:(long)ident index:(unsigned *)idx
|
||||
- (MMScroller *)scrollbarForIdentifier:(int32_t)ident index:(unsigned *)idx
|
||||
{
|
||||
unsigned i, count = [scrollbars count];
|
||||
for (i = 0; i < count; ++i) {
|
||||
MMScroller *scroller = [scrollbars objectAtIndex:i];
|
||||
if ([scroller identifier] == ident) {
|
||||
if ([scroller scrollerId] == ident) {
|
||||
if (idx) *idx = i;
|
||||
return scroller;
|
||||
}
|
||||
@@ -779,7 +789,7 @@ enum {
|
||||
|
||||
- (NSRect)textViewRectForVimViewSize:(NSSize)contentSize
|
||||
{
|
||||
NSRect rect = { 0, 0, contentSize.width, contentSize.height };
|
||||
NSRect rect = { {0, 0}, {contentSize.width, contentSize.height} };
|
||||
|
||||
if (![[self tabBarControl] isHidden])
|
||||
rect.size.height -= [[self tabBarControl] frame].size.height;
|
||||
@@ -863,7 +873,7 @@ enum {
|
||||
|
||||
@implementation MMScroller
|
||||
|
||||
- (id)initWithIdentifier:(long)ident type:(int)theType
|
||||
- (id)initWithIdentifier:(int32_t)ident type:(int)theType
|
||||
{
|
||||
// HACK! NSScroller creates a horizontal scroller if it is init'ed with a
|
||||
// frame whose with exceeds its height; so create a bogus rect and pass it
|
||||
@@ -884,7 +894,7 @@ enum {
|
||||
return self;
|
||||
}
|
||||
|
||||
- (long)identifier
|
||||
- (int32_t)scrollerId
|
||||
{
|
||||
return identifier;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MacVim.h"
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
|
||||
- (id)initWithContentRect:(NSRect)rect
|
||||
styleMask:(unsigned int)style
|
||||
styleMask:(NSUInteger)style
|
||||
backing:(NSBackingStoreType)bufferingType
|
||||
defer:(BOOL)flag;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
@implementation MMWindow
|
||||
|
||||
- (id)initWithContentRect:(NSRect)rect
|
||||
styleMask:(unsigned int)style
|
||||
styleMask:(NSUInteger)style
|
||||
backing:(NSBackingStoreType)bufferingType
|
||||
defer:(BOOL)flag
|
||||
{
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
[self setReleasedWhenClosed:NO];
|
||||
|
||||
NSRect tabSepRect = { 0, rect.size.height - 1, rect.size.width, 1 };
|
||||
NSRect tabSepRect = { {0, rect.size.height - 1}, {rect.size.width, 1} };
|
||||
tablineSeparator = [[NSBox alloc] initWithFrame:tabSepRect];
|
||||
|
||||
[tablineSeparator setBoxType:NSBoxSeparator];
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MacVim.h"
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,12 @@
|
||||
@class MMVimController;
|
||||
@class MMVimView;
|
||||
|
||||
@interface MMWindowController : NSWindowController {
|
||||
@interface MMWindowController : NSWindowController
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
||||
// 10.6 has turned delegate messages into formal protocols
|
||||
<NSWindowDelegate>
|
||||
#endif
|
||||
{
|
||||
MMVimController *vimController;
|
||||
MMVimView *vimView;
|
||||
BOOL setupDone;
|
||||
@@ -46,12 +51,12 @@
|
||||
- (void)setTitle:(NSString *)title;
|
||||
- (void)setDocumentFilename:(NSString *)filename;
|
||||
- (void)setToolbar:(NSToolbar *)toolbar;
|
||||
- (void)createScrollbarWithIdentifier:(long)ident type:(int)type;
|
||||
- (BOOL)destroyScrollbarWithIdentifier:(long)ident;
|
||||
- (BOOL)showScrollbarWithIdentifier:(long)ident state:(BOOL)visible;
|
||||
- (void)setScrollbarPosition:(int)pos length:(int)len identifier:(long)ident;
|
||||
- (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type;
|
||||
- (BOOL)destroyScrollbarWithIdentifier:(int32_t)ident;
|
||||
- (BOOL)showScrollbarWithIdentifier:(int32_t)ident state:(BOOL)visible;
|
||||
- (void)setScrollbarPosition:(int)pos length:(int)len identifier:(int32_t)ident;
|
||||
- (void)setScrollbarThumbValue:(float)val proportion:(float)prop
|
||||
identifier:(long)ident;
|
||||
identifier:(int32_t)ident;
|
||||
- (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore;
|
||||
- (void)setFont:(NSFont *)font;
|
||||
- (void)setWideFont:(NSFont *)font;
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
#import "MMWindow.h"
|
||||
#import "MMWindowController.h"
|
||||
#import "Miscellaneous.h"
|
||||
#import <PSMTabBarControl.h>
|
||||
#import <PSMTabBarControl/PSMTabBarControl.h>
|
||||
|
||||
|
||||
|
||||
@@ -99,18 +99,6 @@
|
||||
@interface NSWindow (NSLeopardOnly)
|
||||
// Note: These functions are Leopard-only, use -[NSObject respondsToSelector:]
|
||||
// before calling them to make sure everything works on Tiger too.
|
||||
|
||||
#ifndef CGFLOAT_DEFINED
|
||||
// On Leopard, CGFloat is float on 32bit and double on 64bit. On Tiger,
|
||||
// we can't use this anyways, so it's just here to keep the compiler happy.
|
||||
// However, when we're compiling for Tiger and running on Leopard, we
|
||||
// might need the correct typedef, so this piece is copied from ATSTypes.h
|
||||
# ifdef __LP64__
|
||||
typedef double CGFloat;
|
||||
# else
|
||||
typedef float CGFloat;
|
||||
# endif
|
||||
#endif
|
||||
- (void)setAutorecalculatesContentBorderThickness:(BOOL)b forEdge:(NSRectEdge)e;
|
||||
- (void)setContentBorderThickness:(CGFloat)b forEdge:(NSRectEdge)e;
|
||||
@end
|
||||
@@ -323,6 +311,18 @@
|
||||
shouldResizeVimView = YES;
|
||||
keepOnScreen = !reply;
|
||||
}
|
||||
|
||||
if (windowAutosaveKey) {
|
||||
// Autosave rows and columns (only done for window which also autosaves
|
||||
// window position).
|
||||
id tv = [vimView textView];
|
||||
int rows = [tv maxRows];
|
||||
int cols = [tv maxColumns];
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
[ud setInteger:rows forKey:MMAutosaveRowsKey];
|
||||
[ud setInteger:cols forKey:MMAutosaveColumnsKey];
|
||||
[ud synchronize];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setTitle:(NSString *)title
|
||||
@@ -359,12 +359,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)createScrollbarWithIdentifier:(long)ident type:(int)type
|
||||
- (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type
|
||||
{
|
||||
[vimView createScrollbarWithIdentifier:ident type:type];
|
||||
}
|
||||
|
||||
- (BOOL)destroyScrollbarWithIdentifier:(long)ident
|
||||
- (BOOL)destroyScrollbarWithIdentifier:(int32_t)ident
|
||||
{
|
||||
BOOL scrollbarHidden = [vimView destroyScrollbarWithIdentifier:ident];
|
||||
shouldResizeVimView = shouldResizeVimView || scrollbarHidden;
|
||||
@@ -372,7 +372,7 @@
|
||||
return scrollbarHidden;
|
||||
}
|
||||
|
||||
- (BOOL)showScrollbarWithIdentifier:(long)ident state:(BOOL)visible
|
||||
- (BOOL)showScrollbarWithIdentifier:(int32_t)ident state:(BOOL)visible
|
||||
{
|
||||
BOOL scrollbarToggled = [vimView showScrollbarWithIdentifier:ident
|
||||
state:visible];
|
||||
@@ -381,13 +381,13 @@
|
||||
return scrollbarToggled;
|
||||
}
|
||||
|
||||
- (void)setScrollbarPosition:(int)pos length:(int)len identifier:(long)ident
|
||||
- (void)setScrollbarPosition:(int)pos length:(int)len identifier:(int32_t)ident
|
||||
{
|
||||
[vimView setScrollbarPosition:pos length:len identifier:ident];
|
||||
}
|
||||
|
||||
- (void)setScrollbarThumbValue:(float)val proportion:(float)prop
|
||||
identifier:(long)ident
|
||||
identifier:(int32_t)ident
|
||||
{
|
||||
[vimView setScrollbarThumbValue:val proportion:prop identifier:ident];
|
||||
}
|
||||
|
||||
+31
-3
@@ -13,11 +13,23 @@
|
||||
|
||||
|
||||
//
|
||||
// Enable support for MacVim plugins (not to be confused with Vim plugins!).
|
||||
// Uncomment to enable support for MacVim plugins (not to be confused with Vim
|
||||
// plugins!).
|
||||
//
|
||||
#define MM_ENABLE_PLUGINS
|
||||
//#define MM_ENABLE_PLUGINS
|
||||
|
||||
|
||||
// Taken from /usr/include/AvailabilityMacros.h
|
||||
#ifndef MAC_OS_X_VERSION_10_4
|
||||
# define MAC_OS_X_VERSION_10_4 1040
|
||||
#endif
|
||||
#ifndef MAC_OS_X_VERSION_10_5
|
||||
# define MAC_OS_X_VERSION_10_5 1050
|
||||
#endif
|
||||
#ifndef MAC_OS_X_VERSION_10_6
|
||||
# define MAC_OS_X_VERSION_10_6 1060
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// This is the protocol MMBackend implements.
|
||||
@@ -235,6 +247,9 @@ extern NSString *MMLogToStdErrKey;
|
||||
// (techincally this is a user default but should not be used as such).
|
||||
extern NSString *MMNoWindowKey;
|
||||
|
||||
extern NSString *MMAutosaveRowsKey;
|
||||
extern NSString *MMAutosaveColumnsKey;
|
||||
|
||||
|
||||
// Vim pasteboard type (holds motion type + string)
|
||||
extern NSString *VimPBoardType;
|
||||
@@ -282,7 +297,7 @@ extern NSString *VimPBoardType;
|
||||
|
||||
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
|
||||
#ifndef NSINTEGER_DEFINED
|
||||
// NSInteger was introduced in 10.5
|
||||
# if __LP64__ || NS_BUILD_32_LIKE_64
|
||||
typedef long NSInteger;
|
||||
@@ -291,12 +306,25 @@ typedef unsigned long NSUInteger;
|
||||
typedef int NSInteger;
|
||||
typedef unsigned int NSUInteger;
|
||||
# endif
|
||||
# define NSINTEGER_DEFINED 1
|
||||
#endif
|
||||
|
||||
#ifndef NSAppKitVersionNumber10_4 // Needed for pre-10.5 SDK
|
||||
# define NSAppKitVersionNumber10_4 824
|
||||
#endif
|
||||
|
||||
#ifndef CGFLOAT_DEFINED
|
||||
// On Leopard, CGFloat is float on 32bit and double on 64bit. On Tiger,
|
||||
// we can't use this anyways, so it's just here to keep the compiler happy.
|
||||
// However, when we're compiling for Tiger and running on Leopard, we
|
||||
// might need the correct typedef, so this piece is copied from ATSTypes.h
|
||||
# ifdef __LP64__
|
||||
typedef double CGFloat;
|
||||
# else
|
||||
typedef float CGFloat;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
// Logging related functions and macros.
|
||||
//
|
||||
|
||||
@@ -106,6 +106,9 @@ NSString *MMLogToStdErrKey = @"MMLogToStdErr";
|
||||
// (techincally this is a user default but should not be used as such).
|
||||
NSString *MMNoWindowKey = @"MMNoWindow";
|
||||
|
||||
NSString *MMAutosaveRowsKey = @"MMAutosaveRows";
|
||||
NSString *MMAutosaveColumnsKey = @"MMAutosaveColumns";
|
||||
|
||||
// Vim pasteboard type (holds motion type + string)
|
||||
NSString *VimPBoardType = @"VimPBoardType";
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
1D1474B00C5678370038FA2B /* MMTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D1474AE0C5678370038FA2B /* MMTextView.m */; };
|
||||
1D1474B60C56796D0038FA2B /* MMVimController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D1474B40C56796D0038FA2B /* MMVimController.m */; };
|
||||
1D1474BC0C567A910038FA2B /* MMWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D1474BA0C567A910038FA2B /* MMWindowController.m */; };
|
||||
1D22121E104B04530086DFF1 /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 1D8B5A88104AFF2A002E59D5 /* Sparkle.framework */; };
|
||||
1D22374B0E45DF4800E6FFFF /* Advanced.png in Resources */ = {isa = PBXBuildFile; fileRef = 1D22374A0E45DF4800E6FFFF /* Advanced.png */; };
|
||||
1D384A0E100D671700D3C22F /* KeyBinding.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1D384A0D100D671700D3C22F /* KeyBinding.plist */; };
|
||||
1D3D19110CA690FF0004A0A5 /* DejaVuSansMono-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1D3D190D0CA690FF0004A0A5 /* DejaVuSansMono-Bold.ttf */; };
|
||||
@@ -31,14 +32,13 @@
|
||||
1D3D19140CA690FF0004A0A5 /* DejaVuSansMono.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1D3D19100CA690FF0004A0A5 /* DejaVuSansMono.ttf */; };
|
||||
1D493D580C5247BF00AB718C /* Vim in Copy Executables */ = {isa = PBXBuildFile; fileRef = 1D493D570C5247BF00AB718C /* Vim */; };
|
||||
1D493DBA0C52534300AB718C /* PSMTabBarControl.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */; };
|
||||
1D6008830E96886D003763F0 /* FindAndReplace.nib in Resources */ = {isa = PBXBuildFile; fileRef = 1D6008820E96886D003763F0 /* FindAndReplace.nib */; };
|
||||
1D60088B0E96A0B2003763F0 /* MMFindReplaceController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */; };
|
||||
1D7F74580E4CE1AE003225C6 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D7F74570E4CE1AE003225C6 /* Sparkle.framework */; };
|
||||
1D7F745B0E4CE1CD003225C6 /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 1D7F74570E4CE1AE003225C6 /* Sparkle.framework */; };
|
||||
1D80591F0E1185EA001699D1 /* Miscellaneous.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D80591D0E1185EA001699D1 /* Miscellaneous.m */; };
|
||||
1D80FBD40CBBD3B700102A1C /* MMFullscreenWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D80FBD00CBBD3B700102A1C /* MMFullscreenWindow.m */; };
|
||||
1D80FBD60CBBD3B700102A1C /* MMVimView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D80FBD20CBBD3B700102A1C /* MMVimView.m */; };
|
||||
1D80FBE40CBBD6F200102A1C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D80FBE30CBBD6F200102A1C /* Carbon.framework */; };
|
||||
1D8B5A53104AF9FF002E59D5 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D8B5A52104AF9FF002E59D5 /* Carbon.framework */; };
|
||||
1D8B5A89104AFF2A002E59D5 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D8B5A88104AFF2A002E59D5 /* Sparkle.framework */; };
|
||||
1D8BEA74104992290069B072 /* FindAndReplace.nib in Resources */ = {isa = PBXBuildFile; fileRef = 1D8BEA73104992290069B072 /* FindAndReplace.nib */; };
|
||||
1D9918490D299F9900A96335 /* MMAtsuiTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D9918470D299F9900A96335 /* MMAtsuiTextView.m */; };
|
||||
1D9C60520EF79C0C0034AD44 /* MacVim.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1D9C602E0EF79C0C0034AD44 /* MacVim.icns */; };
|
||||
1DCD00BF0E50B2B700460166 /* Attention.png in Resources */ = {isa = PBXBuildFile; fileRef = 1DCD00AA0E50B2B700460166 /* Attention.png */; };
|
||||
@@ -148,7 +148,7 @@
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
1D7F745B0E4CE1CD003225C6 /* Sparkle.framework in Copy Frameworks */,
|
||||
1D22121E104B04530086DFF1 /* Sparkle.framework in Copy Frameworks */,
|
||||
1D493DBA0C52534300AB718C /* PSMTabBarControl.framework in Copy Frameworks */,
|
||||
);
|
||||
name = "Copy Frameworks";
|
||||
@@ -206,17 +206,17 @@
|
||||
1D3D19100CA690FF0004A0A5 /* DejaVuSansMono.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = DejaVuSansMono.ttf; path = "dejavu-ttf/DejaVuSansMono.ttf"; sourceTree = "<group>"; };
|
||||
1D493D570C5247BF00AB718C /* Vim */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = Vim; path = ../Vim; sourceTree = SOURCE_ROOT; };
|
||||
1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PSMTabBarControl.xcodeproj; path = PSMTabBarControl/PSMTabBarControl.xcodeproj; sourceTree = "<group>"; };
|
||||
1D6008820E96886D003763F0 /* FindAndReplace.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = FindAndReplace.nib; sourceTree = "<group>"; };
|
||||
1D6008820E96886D003763F0 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/FindAndReplace.nib; sourceTree = "<group>"; };
|
||||
1D6008890E96A0B2003763F0 /* MMFindReplaceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMFindReplaceController.h; sourceTree = "<group>"; };
|
||||
1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMFindReplaceController.m; sourceTree = "<group>"; };
|
||||
1D7F74570E4CE1AE003225C6 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = "<group>"; };
|
||||
1D80591D0E1185EA001699D1 /* Miscellaneous.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Miscellaneous.m; sourceTree = "<group>"; };
|
||||
1D8059220E118663001699D1 /* Miscellaneous.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Miscellaneous.h; sourceTree = "<group>"; };
|
||||
1D80FBCF0CBBD3B700102A1C /* MMFullscreenWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MMFullscreenWindow.h; sourceTree = "<group>"; };
|
||||
1D80FBD00CBBD3B700102A1C /* MMFullscreenWindow.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MMFullscreenWindow.m; sourceTree = "<group>"; };
|
||||
1D80FBD10CBBD3B700102A1C /* MMVimView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MMVimView.h; sourceTree = "<group>"; };
|
||||
1D80FBD20CBBD3B700102A1C /* MMVimView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MMVimView.m; sourceTree = "<group>"; };
|
||||
1D80FBE30CBBD6F200102A1C /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
|
||||
1D8B5A52104AF9FF002E59D5 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
|
||||
1D8B5A88104AFF2A002E59D5 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = "<group>"; };
|
||||
1D9918460D299F9900A96335 /* MMAtsuiTextView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MMAtsuiTextView.h; sourceTree = "<group>"; };
|
||||
1D9918470D299F9900A96335 /* MMAtsuiTextView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MMAtsuiTextView.m; sourceTree = "<group>"; };
|
||||
1D9C602E0EF79C0C0034AD44 /* MacVim.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = MacVim.icns; path = icons/MacVim.icns; sourceTree = "<group>"; };
|
||||
@@ -286,9 +286,9 @@
|
||||
files = (
|
||||
1DFE25A50C527BC4003000F7 /* PSMTabBarControl.framework in Frameworks */,
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
|
||||
1D80FBE40CBBD6F200102A1C /* Carbon.framework in Frameworks */,
|
||||
0395A9C30D75D04D00881434 /* Security.framework in Frameworks */,
|
||||
1D7F74580E4CE1AE003225C6 /* Sparkle.framework in Frameworks */,
|
||||
1D8B5A53104AF9FF002E59D5 /* Carbon.framework in Frameworks */,
|
||||
1D8B5A89104AFF2A002E59D5 /* Sparkle.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -374,7 +374,6 @@
|
||||
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1D80FBE30CBBD6F200102A1C /* Carbon.framework */,
|
||||
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
|
||||
);
|
||||
name = "Linked Frameworks";
|
||||
@@ -480,7 +479,7 @@
|
||||
children = (
|
||||
1D384A0D100D671700D3C22F /* KeyBinding.plist */,
|
||||
1D9C602E0EF79C0C0034AD44 /* MacVim.icns */,
|
||||
1D6008820E96886D003763F0 /* FindAndReplace.nib */,
|
||||
1D8BEA73104992290069B072 /* FindAndReplace.nib */,
|
||||
0395A8A90D72D88B00881434 /* General.png */,
|
||||
0395A9590D74D47B00881434 /* Integration.png */,
|
||||
1D22374A0E45DF4800E6FFFF /* Advanced.png */,
|
||||
@@ -503,7 +502,8 @@
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1D7F74570E4CE1AE003225C6 /* Sparkle.framework */,
|
||||
1D8B5A88104AFF2A002E59D5 /* Sparkle.framework */,
|
||||
1D8B5A52104AF9FF002E59D5 /* Carbon.framework */,
|
||||
0395AA980D76E86200881434 /* Edit in ODBEditor */,
|
||||
0395A9C20D75D04D00881434 /* Security.framework */,
|
||||
1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */,
|
||||
@@ -549,6 +549,13 @@
|
||||
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MacVim" */;
|
||||
compatibilityVersion = "Xcode 2.4";
|
||||
hasScannedForEncodings = 1;
|
||||
knownRegions = (
|
||||
English,
|
||||
Japanese,
|
||||
French,
|
||||
German,
|
||||
Swedish,
|
||||
);
|
||||
mainGroup = 29B97314FDCFA39411CA2CEA /* MacVim */;
|
||||
projectDirPath = "";
|
||||
projectReferences = (
|
||||
@@ -627,7 +634,7 @@
|
||||
1DCD00D10E50B2B700460166 /* SaveSesn.png in Resources */,
|
||||
1DCD00D20E50B2B700460166 /* TagJump.png in Resources */,
|
||||
1DCD00D30E50B2B700460166 /* Undo.png in Resources */,
|
||||
1D6008830E96886D003763F0 /* FindAndReplace.nib in Resources */,
|
||||
1D8BEA74104992290069B072 /* FindAndReplace.nib in Resources */,
|
||||
1D9C60520EF79C0C0034AD44 /* MacVim.icns in Resources */,
|
||||
1D384A0E100D671700D3C22F /* KeyBinding.plist in Resources */,
|
||||
);
|
||||
@@ -710,6 +717,14 @@
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1D8BEA73104992290069B072 /* FindAndReplace.nib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
1D6008820E96886D003763F0 /* English */,
|
||||
);
|
||||
name = FindAndReplace.nib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1DE3F8E50D50F80500052B9E /* Preferences.nib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
@@ -729,63 +744,14 @@
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
1D13D1610D560D9D0084F3AB /* Universal */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
ppc,
|
||||
i386,
|
||||
);
|
||||
COPY_PHASE_STRIP = YES;
|
||||
CURRENT_PROJECT_VERSION = 48;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
|
||||
);
|
||||
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\"";
|
||||
GCC_DYNAMIC_NO_PIC = YES;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = s;
|
||||
HEADER_SEARCH_PATHS = PSMTabBarControl/source/;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.4;
|
||||
PRODUCT_NAME = MacVim;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
WRAPPER_EXTENSION = app;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = Universal;
|
||||
};
|
||||
1D13D1620D560D9D0084F3AB /* Universal */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
};
|
||||
name = Universal;
|
||||
};
|
||||
C01FCF4B08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH)";
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 48;
|
||||
CURRENT_PROJECT_VERSION = 50;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
|
||||
);
|
||||
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\"";
|
||||
@@ -794,12 +760,15 @@
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
HEADER_SEARCH_PATHS = PSMTabBarControl/source/;
|
||||
GCC_WARN_PEDANTIC = NO;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
MACOSX_DEPLOYMENT_TARGET = "";
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRODUCT_NAME = MacVim;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
WARNING_CFLAGS = "-Wall";
|
||||
WRAPPER_EXTENSION = app;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
@@ -808,16 +777,11 @@
|
||||
C01FCF4C08A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH)";
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
CURRENT_PROJECT_VERSION = 48;
|
||||
CURRENT_PROJECT_VERSION = 50;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
|
||||
);
|
||||
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\"";
|
||||
@@ -826,10 +790,11 @@
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = s;
|
||||
HEADER_SEARCH_PATHS = PSMTabBarControl/source/;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
MACOSX_DEPLOYMENT_TARGET = "";
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRODUCT_NAME = MacVim;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
WRAPPER_EXTENSION = app;
|
||||
@@ -840,8 +805,10 @@
|
||||
C01FCF4F08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PREBINDING = NO;
|
||||
};
|
||||
name = Debug;
|
||||
@@ -849,8 +816,10 @@
|
||||
C01FCF5008A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PREBINDING = NO;
|
||||
};
|
||||
name = Release;
|
||||
@@ -863,7 +832,6 @@
|
||||
buildConfigurations = (
|
||||
C01FCF4B08A954540054247B /* Debug */,
|
||||
C01FCF4C08A954540054247B /* Release */,
|
||||
1D13D1610D560D9D0084F3AB /* Universal */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
@@ -873,7 +841,6 @@
|
||||
buildConfigurations = (
|
||||
C01FCF4F08A954540054247B /* Debug */,
|
||||
C01FCF5008A954540054247B /* Release */,
|
||||
1D13D1620D560D9D0084F3AB /* Universal */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
|
||||
@@ -16,6 +16,11 @@
|
||||
// TODO: Remove this when the inline IM code has been tested
|
||||
#define INCLUDE_OLD_IM_CODE
|
||||
|
||||
// Disable ATSUI when compiling on 10.6. This is because ATSUI is deprecated
|
||||
// on 10.6 and hence spews out masses of warning messages when building. Also,
|
||||
// the ATSUI code currently does not work on 10.6.
|
||||
#define MM_ENABLE_ATSUI (MAC_OS_X_VERSION_MIN_REQUIRED<MAC_OS_X_VERSION_10_6)
|
||||
|
||||
|
||||
// NSUserDefaults keys
|
||||
extern NSString *MMTabMinWidthKey;
|
||||
@@ -111,8 +116,8 @@ enum {
|
||||
|
||||
|
||||
@interface NSToolbar (MMExtras)
|
||||
- (int)indexOfItemWithItemIdentifier:(NSString *)identifier;
|
||||
- (NSToolbarItem *)itemAtIndex:(int)idx;
|
||||
- (NSUInteger)indexOfItemWithItemIdentifier:(NSString *)identifier;
|
||||
- (NSToolbarItem *)itemAtIndex:(NSUInteger)idx;
|
||||
- (NSToolbarItem *)itemWithItemIdentifier:(NSString *)identifier;
|
||||
@end
|
||||
|
||||
@@ -123,7 +128,8 @@ enum {
|
||||
|
||||
|
||||
@interface NSNumber (MMExtras)
|
||||
- (int)tag;
|
||||
// HACK to allow font size to be changed via menu (bound to Cmd+/Cmd-)
|
||||
- (NSInteger)tag;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -203,10 +203,10 @@ NSString *MMUseInlineImKey = @"MMUseInlineIm";
|
||||
|
||||
@implementation NSToolbar (MMExtras)
|
||||
|
||||
- (int)indexOfItemWithItemIdentifier:(NSString *)identifier
|
||||
- (NSUInteger)indexOfItemWithItemIdentifier:(NSString *)identifier
|
||||
{
|
||||
NSArray *items = [self items];
|
||||
int i, count = [items count];
|
||||
NSUInteger i, count = [items count];
|
||||
for (i = 0; i < count; ++i) {
|
||||
id item = [items objectAtIndex:i];
|
||||
if ([[item itemIdentifier] isEqual:identifier])
|
||||
@@ -216,7 +216,7 @@ NSString *MMUseInlineImKey = @"MMUseInlineIm";
|
||||
return NSNotFound;
|
||||
}
|
||||
|
||||
- (NSToolbarItem *)itemAtIndex:(int)idx
|
||||
- (NSToolbarItem *)itemAtIndex:(NSUInteger)idx
|
||||
{
|
||||
NSArray *items = [self items];
|
||||
if (idx < 0 || idx >= [items count])
|
||||
@@ -227,7 +227,7 @@ NSString *MMUseInlineImKey = @"MMUseInlineIm";
|
||||
|
||||
- (NSToolbarItem *)itemWithItemIdentifier:(NSString *)identifier
|
||||
{
|
||||
int idx = [self indexOfItemWithItemIdentifier:identifier];
|
||||
NSUInteger idx = [self indexOfItemWithItemIdentifier:identifier];
|
||||
return idx != NSNotFound ? [self itemAtIndex:idx] : nil;
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ NSString *MMUseInlineImKey = @"MMUseInlineIm";
|
||||
NSArray *existingItems = [self tabViewItems];
|
||||
NSEnumerator *e = [existingItems objectEnumerator];
|
||||
NSTabViewItem *item;
|
||||
while (item = [e nextObject]){
|
||||
while ((item = [e nextObject])) {
|
||||
[self removeTabViewItem:item];
|
||||
}
|
||||
}
|
||||
@@ -255,7 +255,8 @@ NSString *MMUseInlineImKey = @"MMUseInlineIm";
|
||||
|
||||
@implementation NSNumber (MMExtras)
|
||||
|
||||
- (int)tag
|
||||
// HACK to allow font size to be changed via menu (bound to Cmd+/Cmd-)
|
||||
- (NSInteger)tag
|
||||
{
|
||||
return [self intValue];
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -93,7 +93,7 @@
|
||||
13F8B88A07B434F6008AE28D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||
32DBCF980370C29C00C91783 /* PSMTabBarControl_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSMTabBarControl_Prefix.pch; path = source/PSMTabBarControl_Prefix.pch; sourceTree = "<group>"; };
|
||||
53DF68FD067E5B5A0090B5B0 /* PSMTabBarControl.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PSMTabBarControl.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
53DF68FE067E5B5A0090B5B0 /* PSMTabBarControlFramework-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "PSMTabBarControlFramework-Info.plist"; sourceTree = "<group>"; };
|
||||
53DF68FE067E5B5A0090B5B0 /* PSMTabBarControlFramework-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PSMTabBarControlFramework-Info.plist"; sourceTree = "<group>"; };
|
||||
54D33B2806778E3300C9C163 /* PSMTabBarControl.ibclassdescription */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PSMTabBarControl.ibclassdescription; sourceTree = "<group>"; };
|
||||
8D1AC9730486D14A00FE50C9 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
8D1AC97B0486D23100FE50C9 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
@@ -123,7 +123,7 @@
|
||||
A251BE930959A23A0058BC7F /* TabClose_Front_Rollover.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = TabClose_Front_Rollover.tif; path = images/TabClose_Front_Rollover.tif; sourceTree = "<group>"; };
|
||||
A251BE940959A23A0058BC7F /* TabClose_Front.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = TabClose_Front.tif; path = images/TabClose_Front.tif; sourceTree = "<group>"; };
|
||||
A251BE9B0959A2530058BC7F /* ReadMe.rtfd */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; path = ReadMe.rtfd; sourceTree = "<group>"; };
|
||||
A251BEA20959BB5B0058BC7F /* TabBarControlDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "TabBarControlDemo-Info.plist"; sourceTree = "<group>"; };
|
||||
A251BEA20959BB5B0058BC7F /* TabBarControlDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TabBarControlDemo-Info.plist"; sourceTree = "<group>"; };
|
||||
A251BEC30959BC0E0058BC7F /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
|
||||
A268E7F809A9822900E082AA /* AquaTabNew.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabNew.png; path = images/AquaTabNew.png; sourceTree = "<group>"; };
|
||||
A268E7F909A9822900E082AA /* AquaTabNewPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabNewPressed.png; path = images/AquaTabNewPressed.png; sourceTree = "<group>"; };
|
||||
@@ -533,63 +533,10 @@
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
1D13D16D0D560DDA0084F3AB /* Universal */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
ppc,
|
||||
i386,
|
||||
);
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
FRAMEWORK_VERSION = A;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
|
||||
INFOPLIST_FILE = "PSMTabBarControlFramework-Info.plist";
|
||||
INSTALL_PATH = "@executable_path/../Frameworks";
|
||||
OTHER_LDFLAGS = (
|
||||
"-seg1addr",
|
||||
0xc0000000,
|
||||
);
|
||||
PRODUCT_NAME = PSMTabBarControl;
|
||||
SYMROOT = ../build;
|
||||
};
|
||||
name = Universal;
|
||||
};
|
||||
1D13D16E0D560DDA0084F3AB /* Universal */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
ppc,
|
||||
i386,
|
||||
);
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
PRODUCT_NAME = All;
|
||||
WARNING_CFLAGS = (
|
||||
"-Wmost",
|
||||
"-Wno-four-char-constants",
|
||||
"-Wno-unknown-pragmas",
|
||||
);
|
||||
};
|
||||
name = Universal;
|
||||
};
|
||||
1D13D16F0D560DDA0084F3AB /* Universal */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
};
|
||||
name = Universal;
|
||||
};
|
||||
C056398008A954F8003078D8 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH)";
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
@@ -602,10 +549,8 @@
|
||||
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
|
||||
INFOPLIST_FILE = "PSMTabBarControlFramework-Info.plist";
|
||||
INSTALL_PATH = "@executable_path/../Frameworks";
|
||||
OTHER_LDFLAGS = (
|
||||
"-seg1addr",
|
||||
0xc0000000,
|
||||
);
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_LDFLAGS = "";
|
||||
PRODUCT_NAME = PSMTabBarControl;
|
||||
SYMROOT = ../build;
|
||||
ZERO_LINK = NO;
|
||||
@@ -615,7 +560,7 @@
|
||||
C056398108A954F8003078D8 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH)";
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
FRAMEWORK_VERSION = A;
|
||||
@@ -625,10 +570,8 @@
|
||||
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
|
||||
INFOPLIST_FILE = "PSMTabBarControlFramework-Info.plist";
|
||||
INSTALL_PATH = "@executable_path/../Frameworks";
|
||||
OTHER_LDFLAGS = (
|
||||
"-seg1addr",
|
||||
0xc0000000,
|
||||
);
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_LDFLAGS = "";
|
||||
PRODUCT_NAME = PSMTabBarControl;
|
||||
SYMROOT = ../build;
|
||||
};
|
||||
@@ -673,20 +616,24 @@
|
||||
C056398C08A954F8003078D8 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
SYMROOT = ../build;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C056398D08A954F8003078D8 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
SYMROOT = ../build;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -698,7 +645,6 @@
|
||||
buildConfigurations = (
|
||||
C056398008A954F8003078D8 /* Debug */,
|
||||
C056398108A954F8003078D8 /* Release */,
|
||||
1D13D16D0D560DDA0084F3AB /* Universal */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
@@ -708,7 +654,6 @@
|
||||
buildConfigurations = (
|
||||
C056398808A954F8003078D8 /* Debug */,
|
||||
C056398908A954F8003078D8 /* Release */,
|
||||
1D13D16E0D560DDA0084F3AB /* Universal */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
@@ -718,7 +663,6 @@
|
||||
buildConfigurations = (
|
||||
C056398C08A954F8003078D8 /* Debug */,
|
||||
C056398D08A954F8003078D8 /* Release */,
|
||||
1D13D16F0D560DDA0084F3AB /* Universal */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,178 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
0259C573FE90428111CA0C5A /* Project object */ = {
|
||||
activeBuildConfigurationName = Debug;
|
||||
activeTarget = 53DF68FC067E5B5A0090B5B0 /* PSMTabBarControlFramework */;
|
||||
codeSenseManager = 1D82C6110AC093AF00AAD418 /* Code sense */;
|
||||
perUserDictionary = {
|
||||
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
|
||||
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
|
||||
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
|
||||
PBXFileTableDataSourceColumnWidthsKey = (
|
||||
20,
|
||||
243,
|
||||
20,
|
||||
48,
|
||||
43,
|
||||
43,
|
||||
20,
|
||||
);
|
||||
PBXFileTableDataSourceColumnsKey = (
|
||||
PBXFileDataSource_FiletypeID,
|
||||
PBXFileDataSource_Filename_ColumnID,
|
||||
PBXFileDataSource_Built_ColumnID,
|
||||
PBXFileDataSource_ObjectSize_ColumnID,
|
||||
PBXFileDataSource_Errors_ColumnID,
|
||||
PBXFileDataSource_Warnings_ColumnID,
|
||||
PBXFileDataSource_Target_ColumnID,
|
||||
);
|
||||
};
|
||||
PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = {
|
||||
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
|
||||
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
|
||||
PBXFileTableDataSourceColumnWidthsKey = (
|
||||
20,
|
||||
200,
|
||||
63,
|
||||
20,
|
||||
48,
|
||||
43,
|
||||
43,
|
||||
);
|
||||
PBXFileTableDataSourceColumnsKey = (
|
||||
PBXFileDataSource_FiletypeID,
|
||||
PBXFileDataSource_Filename_ColumnID,
|
||||
PBXTargetDataSource_PrimaryAttribute,
|
||||
PBXFileDataSource_Built_ColumnID,
|
||||
PBXFileDataSource_ObjectSize_ColumnID,
|
||||
PBXFileDataSource_Errors_ColumnID,
|
||||
PBXFileDataSource_Warnings_ColumnID,
|
||||
);
|
||||
};
|
||||
PBXPerProjectTemplateStateSaveDate = 223743414;
|
||||
PBXWorkspaceStateSaveDate = 223743414;
|
||||
};
|
||||
sourceControlManager = 1D82C6100AC093AF00AAD418 /* Source Control */;
|
||||
userBuildSettings = {
|
||||
};
|
||||
};
|
||||
0259C576FE90428111CA0C5A /* PSMTabBarControl.m */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {4143, 22432}}";
|
||||
sepNavSelRange = "{48941, 0}";
|
||||
sepNavVisRect = "{{0, 1451}, {459, 186}}";
|
||||
sepNavWindowFrame = "{{15, -1}, {750, 742}}";
|
||||
};
|
||||
};
|
||||
0259C57AFE90428111CA0C5A /* PSMTabBarControl.h */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {1077, 2000}}";
|
||||
sepNavSelRange = "{3919, 0}";
|
||||
sepNavVisRect = "{{0, 1387}, {711, 613}}";
|
||||
sepNavWindowFrame = "{{15, -1}, {750, 742}}";
|
||||
};
|
||||
};
|
||||
1D82C6100AC093AF00AAD418 /* Source Control */ = {
|
||||
isa = PBXSourceControlManager;
|
||||
fallbackIsa = XCSourceControlManager;
|
||||
isSCMEnabled = 0;
|
||||
scmConfiguration = {
|
||||
};
|
||||
scmType = "";
|
||||
};
|
||||
1D82C6110AC093AF00AAD418 /* Code sense */ = {
|
||||
isa = PBXCodeSenseManager;
|
||||
indexTemplatePath = "";
|
||||
};
|
||||
53DF68FC067E5B5A0090B5B0 /* PSMTabBarControlFramework */ = {
|
||||
activeExec = 0;
|
||||
};
|
||||
53DF6901067E5B8E0090B5B0 /* All */ = {
|
||||
activeExec = 0;
|
||||
};
|
||||
A2082A8E09EAEB33009AC8BE /* PSMTabDragAssistant.m */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {1420, 7040}}";
|
||||
sepNavSelRange = "{14900, 0}";
|
||||
sepNavVisRect = "{{0, 3817}, {978, 600}}";
|
||||
sepNavWindowFrame = "{{6, 17}, {1017, 729}}";
|
||||
};
|
||||
};
|
||||
A246FB040A2BD6F9005BDF7B /* PSMTabBarControlDoc.html */ = {
|
||||
uiCtxt = {
|
||||
sepNavWindowFrame = "{{15, 3}, {750, 742}}";
|
||||
};
|
||||
};
|
||||
A251BE830959A1B90058BC7F /* PSMTabBarCell.h */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {804, 1648}}";
|
||||
sepNavSelRange = "{0, 0}";
|
||||
sepNavVisRect = "{{0, 744}, {619, 599}}";
|
||||
sepNavWindowFrame = "{{15, 13}, {658, 728}}";
|
||||
};
|
||||
};
|
||||
A251BE840959A1B90058BC7F /* PSMTabBarCell.m */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {972, 6368}}";
|
||||
sepNavSelRange = "{0, 0}";
|
||||
sepNavVisRect = "{{0, 5769}, {619, 599}}";
|
||||
sepNavWindowFrame = "{{15, 13}, {658, 728}}";
|
||||
};
|
||||
};
|
||||
A251BE8A0959A1EA0058BC7F /* AppController.m */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {711, 613}}";
|
||||
sepNavSelRange = "{0, 0}";
|
||||
sepNavVisRect = "{{0, 0}, {711, 613}}";
|
||||
sepNavWindowFrame = "{{15, -1}, {750, 742}}";
|
||||
};
|
||||
};
|
||||
A251BE8B0959A1EA0058BC7F /* FakeModel.h */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {711, 613}}";
|
||||
sepNavSelRange = "{0, 0}";
|
||||
sepNavVisRect = "{{0, 0}, {711, 613}}";
|
||||
sepNavWindowFrame = "{{15, -1}, {750, 742}}";
|
||||
};
|
||||
};
|
||||
A251BE8C0959A1EA0058BC7F /* FakeModel.m */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {711, 1248}}";
|
||||
sepNavSelRange = "{0, 0}";
|
||||
sepNavVisRect = "{{0, 117}, {711, 613}}";
|
||||
sepNavWindowFrame = "{{15, -1}, {750, 742}}";
|
||||
};
|
||||
};
|
||||
A251BE9B0959A2530058BC7F /* ReadMe.rtfd */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {711, 3047}}";
|
||||
sepNavSelRange = "{0, 0}";
|
||||
sepNavVisRect = "{{0, 2419}, {711, 628}}";
|
||||
sepNavWindowFrame = "{{15, -1}, {750, 742}}";
|
||||
};
|
||||
};
|
||||
A2A711BD09E5BF0500D0089B /* WindowController.h */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {958, 944}}";
|
||||
sepNavSelRange = "{0, 0}";
|
||||
sepNavVisRect = "{{0, 197}, {711, 613}}";
|
||||
sepNavWindowFrame = "{{15, -1}, {750, 742}}";
|
||||
};
|
||||
};
|
||||
A2A711BE09E5BF0500D0089B /* WindowController.m */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {1399, 4496}}";
|
||||
sepNavSelRange = "{2008, 125}";
|
||||
sepNavVisRect = "{{0, 824}, {784, 608}}";
|
||||
sepNavWindowFrame = "{{15, 4}, {823, 737}}";
|
||||
};
|
||||
};
|
||||
A2D32EFF09A63D7A00EC8662 /* PSMMetalTabStyle.m */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {1728, 8400}}";
|
||||
sepNavSelRange = "{683, 5}";
|
||||
sepNavVisRect = "{{0, 0}, {781, 608}}";
|
||||
sepNavWindowFrame = "{{15, 4}, {820, 737}}";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -8,22 +8,31 @@
|
||||
|
||||
#import "NSBezierPath_AMShading.h"
|
||||
|
||||
// CGFloat was introduced in OS X 10.5
|
||||
#ifndef CGFLOAT_DEFINED
|
||||
typedef float CGFloat;
|
||||
# define CGFLOAT_MIN FLT_MIN
|
||||
# define CGFLOAT_MAX FLT_MAX
|
||||
# define CGFLOAT_IS_DOUBLE 0
|
||||
# define CGFLOAT_DEFINED 1
|
||||
#endif
|
||||
|
||||
|
||||
@implementation NSBezierPath (AMShading)
|
||||
|
||||
static void linearShadedColor(void *info, const float *in, float *out)
|
||||
static void linearShadedColor(void *info, const CGFloat *in, CGFloat *out)
|
||||
{
|
||||
float *colors = info;
|
||||
CGFloat *colors = info;
|
||||
*out++ = colors[0] + *in * colors[8];
|
||||
*out++ = colors[1] + *in * colors[9];
|
||||
*out++ = colors[2] + *in * colors[10];
|
||||
*out++ = colors[3] + *in * colors[11];
|
||||
}
|
||||
|
||||
static void bilinearShadedColor(void *info, const float *in, float *out)
|
||||
static void bilinearShadedColor(void *info, const CGFloat *in, CGFloat *out)
|
||||
{
|
||||
float *colors = info;
|
||||
float factor = (*in)*2.0;
|
||||
CGFloat *colors = info;
|
||||
CGFloat factor = (*in)*2.0;
|
||||
if (*in > 0.5) {
|
||||
factor = 2-factor;
|
||||
}
|
||||
@@ -41,7 +50,7 @@ static void bilinearShadedColor(void *info, const float *in, float *out)
|
||||
CGPoint startPoint = {0, 0};
|
||||
CGPoint endPoint = {0, 0};
|
||||
CGFunctionRef function;
|
||||
float colors[12]; // pointer to color values
|
||||
CGFloat colors[12]; // pointer to color values
|
||||
|
||||
// get my context
|
||||
CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
|
||||
@@ -70,8 +79,8 @@ static void bilinearShadedColor(void *info, const float *in, float *out)
|
||||
colorspace = CGColorSpaceCreateDeviceRGB();
|
||||
|
||||
size_t components = 1 + CGColorSpaceGetNumberOfComponents(colorspace);
|
||||
static const float domain[2] = {0.0, 1.0};
|
||||
static const float range[10] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1};
|
||||
static const CGFloat domain[2] = {0.0, 1.0};
|
||||
static const CGFloat range[10] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1};
|
||||
static const CGFunctionCallbacks callbacks = {0, &shadedColor, NULL};
|
||||
|
||||
// Create a CGFunctionRef that describes a function taking 1 input and kChannelsPerColor outputs.
|
||||
@@ -113,7 +122,7 @@ static void bilinearShadedColor(void *info, const float *in, float *out)
|
||||
CGPoint startPoint = {0, 0};
|
||||
CGPoint endPoint = {0, 0};
|
||||
CGFunctionRef function;
|
||||
float colors[12]; // pointer to color values
|
||||
CGFloat colors[12]; // pointer to color values
|
||||
|
||||
// get my context
|
||||
CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
|
||||
@@ -141,8 +150,8 @@ static void bilinearShadedColor(void *info, const float *in, float *out)
|
||||
// draw gradient
|
||||
colorspace = CGColorSpaceCreateDeviceRGB();
|
||||
size_t components = 1 + CGColorSpaceGetNumberOfComponents(colorspace);
|
||||
static const float domain[2] = {0.0, 1.0};
|
||||
static const float range[10] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1};
|
||||
static const CGFloat domain[2] = {0.0, 1.0};
|
||||
static const CGFloat range[10] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1};
|
||||
//static const CGFunctionCallbacks callbacks = {0, &bilinearShadedColor, NULL};
|
||||
|
||||
// Create a CGFunctionRef that describes a function taking 1 input and kChannelsPerColor outputs.
|
||||
|
||||
@@ -12,6 +12,18 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#ifndef NSINTEGER_DEFINED
|
||||
// NSInteger was introduced in 10.5
|
||||
# if __LP64__ || NS_BUILD_32_LIKE_64
|
||||
typedef long NSInteger;
|
||||
typedef unsigned long NSUInteger;
|
||||
# else
|
||||
typedef int NSInteger;
|
||||
typedef unsigned int NSUInteger;
|
||||
# endif
|
||||
# define NSINTEGER_DEFINED 1
|
||||
#endif
|
||||
|
||||
#define kPSMTabBarControlHeight 22
|
||||
// internal cell border
|
||||
#define MARGIN_X 6
|
||||
@@ -39,7 +51,12 @@ enum {
|
||||
PSMTab_PositionSingleMask = 1 << 7
|
||||
};
|
||||
|
||||
@interface PSMTabBarControl : NSControl {
|
||||
@interface PSMTabBarControl : NSControl
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
|
||||
// 10.6 has turned delegate messages into formal protocols
|
||||
<NSTabViewDelegate>
|
||||
#endif
|
||||
{
|
||||
|
||||
// control basics
|
||||
NSMutableArray *_cells; // the cells that draw the tabs
|
||||
@@ -127,10 +144,10 @@ enum {
|
||||
- (void)tabView:(NSTabView *)aTabView didCloseTabViewItem:(NSTabViewItem *)tabViewItem;
|
||||
- (void)tabView:(NSTabView *)aTabView didDragTabViewItem:(NSTabViewItem *)tabViewItem toIndex:(int)idx;
|
||||
|
||||
- (NSDragOperation)tabBarControl:(PSMTabBarControl *)theTabBarControl draggingEntered:(id <NSDraggingInfo>)sender forTabAtIndex:(unsigned)tabIndex;
|
||||
- (NSDragOperation)tabBarControl:(PSMTabBarControl *)theTabBarControl draggingUpdated:(id <NSDraggingInfo>)sender forTabAtIndex:(unsigned)tabIndex;
|
||||
- (void)tabBarControl:(PSMTabBarControl *)theTabBarControl draggingExited:(id <NSDraggingInfo>)sender forTabAtIndex:(unsigned)tabIndex;
|
||||
- (BOOL)tabBarControl:(PSMTabBarControl *)theTabBarControl prepareForDragOperation:(id <NSDraggingInfo>)sender forTabAtIndex:(unsigned)tabIndex;
|
||||
- (BOOL)tabBarControl:(PSMTabBarControl *)theTabBarControl performDragOperation:(id <NSDraggingInfo>)sender forTabAtIndex:(unsigned)tabIndex;
|
||||
- (void)tabBarControl:(PSMTabBarControl *)theTabBarControl concludeDragOperation:(id <NSDraggingInfo>)sender forTabAtIndex:(unsigned)tabIndex;
|
||||
- (NSDragOperation)tabBarControl:(PSMTabBarControl *)theTabBarControl draggingEntered:(id <NSDraggingInfo>)sender forTabAtIndex:(NSUInteger)tabIndex;
|
||||
- (NSDragOperation)tabBarControl:(PSMTabBarControl *)theTabBarControl draggingUpdated:(id <NSDraggingInfo>)sender forTabAtIndex:(NSUInteger)tabIndex;
|
||||
- (void)tabBarControl:(PSMTabBarControl *)theTabBarControl draggingExited:(id <NSDraggingInfo>)sender forTabAtIndex:(NSUInteger)tabIndex;
|
||||
- (BOOL)tabBarControl:(PSMTabBarControl *)theTabBarControl prepareForDragOperation:(id <NSDraggingInfo>)sender forTabAtIndex:(NSUInteger)tabIndex;
|
||||
- (BOOL)tabBarControl:(PSMTabBarControl *)theTabBarControl performDragOperation:(id <NSDraggingInfo>)sender forTabAtIndex:(NSUInteger)tabIndex;
|
||||
- (void)tabBarControl:(PSMTabBarControl *)theTabBarControl concludeDragOperation:(id <NSDraggingInfo>)sender forTabAtIndex:(NSUInteger)tabIndex;
|
||||
@end
|
||||
|
||||
@@ -57,8 +57,8 @@
|
||||
|
||||
// convenience
|
||||
- (id)cellForPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame;
|
||||
- (unsigned)indexOfCellAtPoint:(NSPoint)point;
|
||||
- (unsigned)indexOfCellAtPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame;
|
||||
- (NSUInteger)indexOfCellAtPoint:(NSPoint)point;
|
||||
- (NSUInteger)indexOfCellAtPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame;
|
||||
- (PSMTabBarCell *)lastVisibleTab;
|
||||
- (int)numberOfVisibleTabs;
|
||||
|
||||
@@ -412,7 +412,7 @@
|
||||
[bindingOptions setObject:NSNegateBooleanTransformerName forKey:@"NSValueTransformerName"];
|
||||
[[cell indicator] bind:@"animate" toObject:[item identifier] withKeyPath:@"selection.isProcessing" options:nil];
|
||||
[[cell indicator] bind:@"hidden" toObject:[item identifier] withKeyPath:@"selection.isProcessing" options:bindingOptions];
|
||||
[[item identifier] addObserver:self forKeyPath:@"selection.isProcessing" options:nil context:nil];
|
||||
[[item identifier] addObserver:self forKeyPath:@"selection.isProcessing" options:0 context:nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -425,7 +425,7 @@
|
||||
NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary];
|
||||
[bindingOptions setObject:NSIsNotNilTransformerName forKey:@"NSValueTransformerName"];
|
||||
[cell bind:@"hasIcon" toObject:[item identifier] withKeyPath:@"selection.icon" options:bindingOptions];
|
||||
[[item identifier] addObserver:self forKeyPath:@"selection.icon" options:nil context:nil];
|
||||
[[item identifier] addObserver:self forKeyPath:@"selection.icon" options:0 context:nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -436,7 +436,7 @@
|
||||
if([[item identifier] respondsToSelector:@selector(content)]){
|
||||
if([[[[cell representedObject] identifier] content] respondsToSelector:@selector(objectCount)]){
|
||||
[cell bind:@"count" toObject:[item identifier] withKeyPath:@"selection.objectCount" options:nil];
|
||||
[[item identifier] addObserver:self forKeyPath:@"selection.objectCount" options:nil context:nil];
|
||||
[[item identifier] addObserver:self forKeyPath:@"selection.objectCount" options:0 context:nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -993,7 +993,7 @@
|
||||
}
|
||||
|
||||
// NSDraggingSource
|
||||
- (unsigned int)draggingSourceOperationMaskForLocal:(BOOL)isLocal
|
||||
- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal
|
||||
{
|
||||
return (isLocal ? NSDragOperationMove : NSDragOperationNone);
|
||||
}
|
||||
@@ -1083,7 +1083,7 @@
|
||||
#if 1
|
||||
// HACK! Notify the delegate that a tab was dragged to a new position.
|
||||
if (delegate && [delegate respondsToSelector:@selector(tabView:didDragTabViewItem:toIndex:)]) {
|
||||
int idx = [[self representedTabViewItems] indexOfObject:tvi];
|
||||
NSUInteger idx = [[self representedTabViewItems] indexOfObject:tvi];
|
||||
if (NSNotFound != idx) {
|
||||
[delegate tabView:[self tabView] didDragTabViewItem:tvi toIndex:idx];
|
||||
}
|
||||
@@ -1252,7 +1252,9 @@
|
||||
{
|
||||
if([self delegate]){
|
||||
if([[self delegate] respondsToSelector:@selector(tabView:shouldSelectTabViewItem:)]){
|
||||
return (int)[[self delegate] performSelector:@selector(tabView:shouldSelectTabViewItem:) withObject:aTabView withObject:tabViewItem];
|
||||
// This is an ugly hack. tabView:shouldSelectTabViewItem: returns
|
||||
// a BOOL and performSelector: assumes that it returns an id.
|
||||
return nil != [[self delegate] performSelector:@selector(tabView:shouldSelectTabViewItem:) withObject:aTabView withObject:tabViewItem];
|
||||
} else {
|
||||
return YES;
|
||||
}
|
||||
@@ -1414,19 +1416,19 @@
|
||||
|
||||
- (id)cellForPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame
|
||||
{
|
||||
unsigned i = [self indexOfCellAtPoint:point cellFrame:outFrame];
|
||||
NSUInteger i = [self indexOfCellAtPoint:point cellFrame:outFrame];
|
||||
if (i == NSNotFound)
|
||||
return nil;
|
||||
PSMTabBarCell *cell = [_cells objectAtIndex:i];
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (unsigned)indexOfCellAtPoint:(NSPoint)point
|
||||
- (NSUInteger)indexOfCellAtPoint:(NSPoint)point
|
||||
{
|
||||
return [self indexOfCellAtPoint:point cellFrame:NULL];
|
||||
}
|
||||
|
||||
- (unsigned)indexOfCellAtPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame
|
||||
- (NSUInteger)indexOfCellAtPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame
|
||||
{
|
||||
NSRect aRect = [self genericCellRect];
|
||||
|
||||
@@ -1434,7 +1436,7 @@
|
||||
return NSNotFound;
|
||||
}
|
||||
|
||||
int i, cnt = [_cells count];
|
||||
NSUInteger i, cnt = [_cells count];
|
||||
for(i = 0; i < cnt; i++){
|
||||
PSMTabBarCell *cell = [_cells objectAtIndex:i];
|
||||
float width = [cell width];
|
||||
|
||||
@@ -113,8 +113,10 @@ static int MMPlugInArchMinorVersion = 0;
|
||||
NSString *errstr = nil;
|
||||
id res = [vimController evaluateVimExpressionCocoa:vimExpression
|
||||
errorString:&errstr];
|
||||
if (!res)
|
||||
[NSException raise:@"VimEvaluationException" format:errstr];
|
||||
if (!res) {
|
||||
// Setting format to %@ instead of just passing errstr avoids warning.
|
||||
[NSException raise:@"VimEvaluationException" format:@"%@", errstr];
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
// Copyright 2004-2006 Rainer Brockerhoff.
|
||||
// Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License.
|
||||
//
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
|
||||
#import "RBSplitView.h"
|
||||
#import "RBSplitViewPrivateDefines.h"
|
||||
@@ -925,3 +926,4 @@ static animationData* currentAnimation = NULL;
|
||||
|
||||
@end
|
||||
|
||||
#endif // MM_ENABLE_PLUGINS
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
// Copyright 2004-2006 Rainer Brockerhoff.
|
||||
// Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License.
|
||||
//
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
|
||||
#import "RBSplitView.h"
|
||||
#import "RBSplitViewPrivateDefines.h"
|
||||
@@ -1732,3 +1733,4 @@ static inline float fMAX(float a,float b) {
|
||||
|
||||
@end
|
||||
|
||||
#endif // MM_ENABLE_PLUGINS
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
17966369093A122C00138851 /* WebView: Edit in ODBEditor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "WebView: Edit in ODBEditor.mm"; path = "src/WebView: Edit in ODBEditor.mm"; sourceTree = "<group>"; };
|
||||
32DBCF630370AF2F00C91783 /* Edit in ODBEditor_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Edit in ODBEditor_Prefix.pch"; sourceTree = "<group>"; };
|
||||
8D5B49B6048680CD000E48DA /* Edit in ODBEditor.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Edit in ODBEditor.bundle"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
D2F7E65807B2D6F200F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
@@ -196,42 +196,6 @@
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
1DD3D5530D82D8D7006E4320 /* Universal */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
ppc,
|
||||
i386,
|
||||
);
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "Edit in ODBEditor_Prefix.pch";
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "";
|
||||
OTHER_LDFLAGS = (
|
||||
"-undefined",
|
||||
dynamic_lookup,
|
||||
);
|
||||
PRODUCT_NAME = "Edit in ODBEditor";
|
||||
SYMROOT = ../build;
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Universal;
|
||||
};
|
||||
1DD3D5540D82D8D7006E4320 /* Universal */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = NO;
|
||||
GCC_ENABLE_CPP_RTTI = NO;
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
};
|
||||
name = Universal;
|
||||
};
|
||||
1DEB913B08733D840010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -282,7 +246,6 @@
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -295,7 +258,6 @@
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -307,7 +269,6 @@
|
||||
buildConfigurations = (
|
||||
1DEB913B08733D840010E9CD /* Debug */,
|
||||
1DEB913C08733D840010E9CD /* Release */,
|
||||
1DD3D5530D82D8D7006E4320 /* Universal */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
@@ -317,7 +278,6 @@
|
||||
buildConfigurations = (
|
||||
1DEB913F08733D840010E9CD /* Debug */,
|
||||
1DEB914008733D840010E9CD /* Release */,
|
||||
1DD3D5540D82D8D7006E4320 /* Universal */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
|
||||
@@ -220,7 +220,11 @@ struct PBX_SelectionRange
|
||||
}
|
||||
else
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
[[NSFileManager defaultManager] removeItemAtPath:fileName error:NULL];
|
||||
#else
|
||||
[[NSFileManager defaultManager] removeFileAtPath:fileName handler:nil];
|
||||
#endif
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||
}
|
||||
|
||||
@@ -256,7 +260,7 @@ struct PBX_SelectionRange
|
||||
{
|
||||
[editMenu addItem:[NSMenuItem separatorItem]];
|
||||
NSString* ellips = [NSString stringWithUTF8String:"\xe2\x80\xa6"]; // utf-8 for the '...' character (literal utf8 is not allowed in source code)
|
||||
id <NSMenuItem> menuItem = [editMenu addItemWithTitle:[NSString stringWithFormat:@"Edit in %@%@", ODBEditorName, ellips] action:@selector(editInODBEditor:) keyEquivalent:@"E"];
|
||||
NSMenuItem *menuItem = [editMenu addItemWithTitle:[NSString stringWithFormat:@"Edit in %@%@", ODBEditorName, ellips] action:@selector(editInODBEditor:) keyEquivalent:@"E"];
|
||||
[menuItem setKeyEquivalentModifierMask:NSControlKeyMask | NSCommandKeyMask];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,7 +313,11 @@ static DOMHTMLTextAreaElement* find_active_text_area (WebView* view)
|
||||
|
||||
if(selection)
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
str = convert_dom_to_text([[[self mainFrame] DOMDocument] createTreeWalker:selection whatToShow:DOM_SHOW_ALL filter:nil expandEntityReferences:YES]);
|
||||
#else
|
||||
str = convert_dom_to_text([[[self mainFrame] DOMDocument] createTreeWalker:selection :DOM_SHOW_ALL :nil :YES]);
|
||||
#endif
|
||||
while([str hasSuffix:@"\n\n"])
|
||||
str = [str substringToIndex:[str length]-1];
|
||||
|
||||
|
||||
+84
-29
@@ -38,6 +38,43 @@ vimmenu_T *menu_for_descriptor(NSArray *desc);
|
||||
|
||||
// -- Initialization --------------------------------------------------------
|
||||
|
||||
void
|
||||
macvim_early_init()
|
||||
{
|
||||
NSBundle *bundle = [NSBundle mainBundle];
|
||||
if (bundle) {
|
||||
// Set environment variables $VIM and $VIMRUNTIME
|
||||
NSString *path = [[bundle resourcePath]
|
||||
stringByAppendingPathComponent:@"vim"];
|
||||
vim_setenv((char_u*)"VIM", (char_u*)[path UTF8String]);
|
||||
|
||||
path = [path stringByAppendingPathComponent:@"runtime"];
|
||||
vim_setenv((char_u*)"VIMRUNTIME", (char_u*)[path UTF8String]);
|
||||
}
|
||||
|
||||
#if 0 // NOTE: setlocale(LC_ALL, "") seems to work after a restart so this is
|
||||
// not necessary. The locale used depends on what "Region" is set
|
||||
// inside the "Formats" tab of the "International" System Preferences
|
||||
// pane.
|
||||
// Try to ensure that the locale is set to match that used by NSBundle to
|
||||
// load localized resources. If there is a mismatch e.g. between the
|
||||
// MacVim menu and other menus, then this code needs to change (nb. the
|
||||
// MacVim menu is set up inside a nib file so the locale used for it is
|
||||
// chosen by NSBundle and the other menus are set up by Vim so their locale
|
||||
// matches whatever we set here).
|
||||
NSLocale *loc = [NSLocale currentLocale];
|
||||
if (loc) {
|
||||
NSString *s = [NSString stringWithFormat:@"%@_%@.UTF-8",
|
||||
[loc objectForKey:NSLocaleLanguageCode],
|
||||
[loc objectForKey:NSLocaleCountryCode]];
|
||||
setlocale(LC_ALL, [s UTF8String]);
|
||||
fprintf(stderr, "locale=%s\n", [s UTF8String]);
|
||||
fflush(stderr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Parse the GUI related command-line arguments. Any arguments used are
|
||||
* deleted from argv, and *argc is decremented accordingly. This is called
|
||||
@@ -47,22 +84,6 @@ vimmenu_T *menu_for_descriptor(NSArray *desc);
|
||||
void
|
||||
gui_mch_prepare(int *argc, char **argv)
|
||||
{
|
||||
// Set environment variables $VIM and $VIMRUNTIME
|
||||
// NOTE! If vim_getenv is called with one of these as parameters before
|
||||
// they have been set here, they will most likely end up with the wrong
|
||||
// values!
|
||||
//
|
||||
// TODO:
|
||||
// - ensure this is called first to avoid above problem
|
||||
// - encoding
|
||||
|
||||
NSString *path = [[[NSBundle mainBundle] resourcePath]
|
||||
stringByAppendingPathComponent:@"vim"];
|
||||
vim_setenv((char_u*)"VIM", (char_u*)[path UTF8String]);
|
||||
|
||||
path = [path stringByAppendingPathComponent:@"runtime"];
|
||||
vim_setenv((char_u*)"VIMRUNTIME", (char_u*)[path UTF8String]);
|
||||
|
||||
int i;
|
||||
for (i = 0; i < *argc; ++i) {
|
||||
if (strncmp(argv[i], "--mmwaitforack", 14) == 0) {
|
||||
@@ -96,6 +117,29 @@ gui_mch_prepare(int *argc, char **argv)
|
||||
int
|
||||
gui_mch_init_check(void)
|
||||
{
|
||||
ASLInit();
|
||||
ASLogDebug(@"");
|
||||
|
||||
// Restore autosaved rows & columns
|
||||
CFNumberRef rowsRef, colsRef;
|
||||
rowsRef = CFPreferencesCopyAppValue((CFStringRef)MMAutosaveRowsKey,
|
||||
kCFPreferencesCurrentApplication);
|
||||
colsRef = CFPreferencesCopyAppValue((CFStringRef)MMAutosaveColumnsKey,
|
||||
kCFPreferencesCurrentApplication);
|
||||
if (rowsRef && colsRef) {
|
||||
int rows, cols;
|
||||
if (CFNumberGetValue(rowsRef, kCFNumberIntType, &rows)
|
||||
&& CFNumberGetValue(colsRef, kCFNumberIntType, &cols)) {
|
||||
if (rows > 4 && rows < 1000 && cols > 29 && cols < 4000) {
|
||||
Rows = rows;
|
||||
Columns = cols;
|
||||
} else {
|
||||
ASLogWarn(@"Autosaved window dimensions invalid: %dx%d",
|
||||
cols, rows);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -107,7 +151,6 @@ gui_mch_init_check(void)
|
||||
int
|
||||
gui_mch_init(void)
|
||||
{
|
||||
ASLInit();
|
||||
ASLogDebug(@"");
|
||||
|
||||
if (![[MMBackend sharedInstance] checkin]) {
|
||||
@@ -781,9 +824,10 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx)
|
||||
&& lookup_menu_iconfile(menu->name, fname))
|
||||
icon = fname;
|
||||
|
||||
// Last resort, use display name (usually signals a builtin icon)
|
||||
// Still no icon found, try using a builtin icon. (If this also fails,
|
||||
// then a warning icon will be displayed).
|
||||
if (!icon)
|
||||
icon = menu->dname;
|
||||
icon = lookup_toolbar_item(menu->iconidx);
|
||||
}
|
||||
|
||||
[[MMBackend sharedInstance] queueMessage:AddMenuItemMsgID properties:
|
||||
@@ -1079,6 +1123,14 @@ gui_macvim_font_with_name(char_u *name)
|
||||
|
||||
// -- Scrollbars ------------------------------------------------------------
|
||||
|
||||
// NOTE: Even though scrollbar identifiers are 'long' we tacitly assume that
|
||||
// they only use 32 bits (in particular when compiling for 64 bit). This is
|
||||
// justified since identifiers are generated from a 32 bit counter in
|
||||
// gui_create_scrollbar(). However if that code changes we may be in trouble
|
||||
// (if ever that many scrollbars are allocated...). The reason behind this is
|
||||
// that we pass scrollbar identifers over process boundaries so the width of
|
||||
// the variable needs to be fixed (and why fix at 64 bit when only 32 are
|
||||
// really used?).
|
||||
|
||||
void
|
||||
gui_mch_create_scrollbar(
|
||||
@@ -1086,7 +1138,7 @@ gui_mch_create_scrollbar(
|
||||
int orient) /* SBAR_VERT or SBAR_HORIZ */
|
||||
{
|
||||
[[MMBackend sharedInstance]
|
||||
createScrollbarWithIdentifier:sb->ident type:sb->type];
|
||||
createScrollbarWithIdentifier:(int32_t)sb->ident type:sb->type];
|
||||
}
|
||||
|
||||
|
||||
@@ -1094,7 +1146,7 @@ gui_mch_create_scrollbar(
|
||||
gui_mch_destroy_scrollbar(scrollbar_T *sb)
|
||||
{
|
||||
[[MMBackend sharedInstance]
|
||||
destroyScrollbarWithIdentifier:sb->ident];
|
||||
destroyScrollbarWithIdentifier:(int32_t)sb->ident];
|
||||
}
|
||||
|
||||
|
||||
@@ -1104,7 +1156,7 @@ gui_mch_enable_scrollbar(
|
||||
int flag)
|
||||
{
|
||||
[[MMBackend sharedInstance]
|
||||
showScrollbarWithIdentifier:sb->ident state:flag];
|
||||
showScrollbarWithIdentifier:(int32_t)sb->ident state:flag];
|
||||
}
|
||||
|
||||
|
||||
@@ -1124,7 +1176,7 @@ gui_mch_set_scrollbar_pos(
|
||||
}
|
||||
|
||||
[[MMBackend sharedInstance]
|
||||
setScrollbarPosition:pos length:len identifier:sb->ident];
|
||||
setScrollbarPosition:pos length:len identifier:(int32_t)sb->ident];
|
||||
}
|
||||
|
||||
|
||||
@@ -1136,7 +1188,10 @@ gui_mch_set_scrollbar_thumb(
|
||||
long max)
|
||||
{
|
||||
[[MMBackend sharedInstance]
|
||||
setScrollbarThumbValue:val size:size max:max identifier:sb->ident];
|
||||
setScrollbarThumbValue:val
|
||||
size:size
|
||||
max:max
|
||||
identifier:(int32_t)sb->ident];
|
||||
}
|
||||
|
||||
|
||||
@@ -1971,7 +2026,7 @@ serverSendReply(char_u *serverid, char_u *reply)
|
||||
* All communication between MacVim and the server goes via Apple Events.
|
||||
*/
|
||||
|
||||
static OSErr
|
||||
static int16_t
|
||||
odb_event(buf_T *buf, const AEEventID action)
|
||||
{
|
||||
if (!(buf->b_odb_server_id && buf->b_ffname))
|
||||
@@ -1980,7 +2035,7 @@ odb_event(buf_T *buf, const AEEventID action)
|
||||
NSAppleEventDescriptor *targetDesc = [NSAppleEventDescriptor
|
||||
descriptorWithDescriptorType:typeApplSignature
|
||||
bytes:&buf->b_odb_server_id
|
||||
length:sizeof(OSType)];
|
||||
length:sizeof(uint32_t)];
|
||||
|
||||
// TODO: Convert b_ffname to UTF-8?
|
||||
NSString *path = [NSString stringWithUTF8String:(char*)buf->b_ffname];
|
||||
@@ -2005,10 +2060,10 @@ odb_event(buf_T *buf, const AEEventID action)
|
||||
kAEDefaultTimeout);
|
||||
}
|
||||
|
||||
OSErr
|
||||
int16_t
|
||||
odb_buffer_close(buf_T *buf)
|
||||
{
|
||||
OSErr err = noErr;
|
||||
int16_t err = noErr;
|
||||
if (buf) {
|
||||
err = odb_event(buf, kAEClosedFile);
|
||||
|
||||
@@ -2028,7 +2083,7 @@ odb_buffer_close(buf_T *buf)
|
||||
return err;
|
||||
}
|
||||
|
||||
OSErr
|
||||
int16_t
|
||||
odb_post_buffer_write(buf_T *buf)
|
||||
{
|
||||
return buf ? odb_event(buf, kAEModifiedFile) : noErr;
|
||||
|
||||
+1
-164
@@ -1,7 +1,7 @@
|
||||
" System gvimrc file for MacVim
|
||||
"
|
||||
" Maintainer: Bjorn Winckler <bjorn.winckler@gmail.com>
|
||||
" Last Change: Sun Mar 15 2009
|
||||
" Last Change: Sun Aug 29 2009
|
||||
"
|
||||
" This is a work in progress. If you feel so inclined, please help me improve
|
||||
" this file.
|
||||
@@ -30,115 +30,11 @@ endif
|
||||
" name and the buffer modified flag.
|
||||
set guitablabel=%M%t
|
||||
|
||||
|
||||
" Send print jobs to Preview.app. This does not delete the temporary ps file
|
||||
" that is generated by :hardcopy.
|
||||
set printexpr=system('open\ -a\ Preview\ '.v:fname_in)\ +\ v:shell_error
|
||||
|
||||
|
||||
"
|
||||
" Extra menus
|
||||
"
|
||||
|
||||
|
||||
" File menu
|
||||
|
||||
aunmenu File.New
|
||||
aunmenu File.Open\.\.\.
|
||||
aunmenu File.Close
|
||||
aunmenu File.-SEP4-
|
||||
aunmenu File.Exit
|
||||
aunmenu File.Save-Exit
|
||||
|
||||
an <silent> 10.290 File.New\ Window <Nop>
|
||||
an 10.295 File.New\ Tab :tabnew<CR>
|
||||
an <silent> 10.310 File.Open\.\.\. <Nop>
|
||||
an <silent> 10.325 File.Open\ Recent <Nop>
|
||||
an 10.328 File.-SEP0- <Nop>
|
||||
an <silent> 10.330 File.Close\ Window<Tab>:qa :conf qa<CR>
|
||||
an <silent> 10.332 File.Close :conf q<CR>
|
||||
an <silent> 10.341 File.Save\ All :browse conf wa<CR>
|
||||
an 10.350 File.Save\ As\.\.\.<Tab>:sav :browse confirm saveas<CR>
|
||||
|
||||
|
||||
" Edit menu
|
||||
|
||||
" The following function is aken from menu.vim
|
||||
fun! s:FixFText()
|
||||
" Fix text in nameless register to be used with :promptfind.
|
||||
return substitute(@", "[\r\n]", '\\n', 'g')
|
||||
endfun
|
||||
|
||||
aunmenu Edit.Find
|
||||
aunmenu Edit.Find\ and\ Replace
|
||||
|
||||
an <silent> 20.410.10 Edit.Find.Find\.\.\. :promptfind<CR>
|
||||
vunmenu Edit.Find.Find\.\.\.
|
||||
vnoremenu <silent> Edit.Find.Find\.\.\. y:promptfind <C-R>=<SID>FixFText()<CR><CR>
|
||||
an 20.410.20 Edit.Find.Find\ Next <Nop>
|
||||
an 20.410.30 Edit.Find.Find\ Previous <Nop>
|
||||
vmenu 20.410.35 Edit.Find.Use\ Selection\ for\ Find y:let @/=@"<CR>:<BS>
|
||||
|
||||
an 20.460 Edit.-SEP4- <Nop>
|
||||
an 20.465.10 Edit.Font.Show\ Fonts <Nop>
|
||||
an 20.465.20 Edit.Font.-SEP5- <Nop>
|
||||
an 20.465.30 Edit.Font.Bigger <Nop>
|
||||
an 20.465.40 Edit.Font.Smaller <Nop>
|
||||
an 20.470 Edit.Special\ Characters\.\.\. <Nop>
|
||||
|
||||
|
||||
" Window menu (should be next to Help so give it a high priority)
|
||||
aunmenu Window
|
||||
|
||||
an <silent> 9900.300 Window.Minimize <Nop>
|
||||
an <silent> 9900.301 Window.Minimize\ All <Nop>
|
||||
an <silent> 9900.310 Window.Zoom <Nop>
|
||||
an <silent> 9900.311 Window.Zoom\ All <Nop>
|
||||
an <silent> 9900.320 Window.Toggle\ Full\ Screen\ Mode :set invfullscreen<CR>
|
||||
an 9900.330 Window.-SEP1- <Nop>
|
||||
" TODO! Grey out if no tabs are visible.
|
||||
an <silent> 9900.340 Window.Select\ Next\ Tab :tabnext<CR>
|
||||
an <silent> 9900.350 Window.Select\ Previous\ Tab :tabprevious<CR>
|
||||
an 9900.360 Window.-SEP2- <Nop>
|
||||
an <silent> 9900.370 Window.Bring\ All\ To\ Front <Nop>
|
||||
|
||||
|
||||
" Help menu
|
||||
an 9999.1 Help.MacVim\ Help :h gui_mac<CR>
|
||||
an <silent> 9999.2 Help.MacVim\ Website <Nop>
|
||||
an 9999.3 Help.-sep0- <Nop>
|
||||
|
||||
|
||||
"
|
||||
" Toolbar
|
||||
"
|
||||
" These items are special ('*' means zero or more arbitrary characters):
|
||||
" -space*- an empty space
|
||||
" -flexspace*- a flexible space
|
||||
" -*- a separator item
|
||||
|
||||
" Remove some items so that all items are visible at the default window size.
|
||||
"aunmenu ToolBar.Undo
|
||||
"aunmenu ToolBar.Redo
|
||||
"aunmenu ToolBar.-sep2-
|
||||
"aunmenu ToolBar.Cut
|
||||
"aunmenu ToolBar.Copy
|
||||
"aunmenu ToolBar.Paste
|
||||
"aunmenu ToolBar.-sep3-
|
||||
aunmenu ToolBar.Replace
|
||||
aunmenu ToolBar.FindNext
|
||||
aunmenu ToolBar.FindPrev
|
||||
aunmenu ToolBar.-sep5-
|
||||
aunmenu ToolBar.-sep6-
|
||||
aunmenu ToolBar.RunCtags
|
||||
aunmenu ToolBar.TagJump
|
||||
"aunmenu ToolBar.-sep7-
|
||||
aunmenu ToolBar.FindHelp
|
||||
|
||||
"an 1.295 ToolBar.-flexspace7- <Nop>
|
||||
|
||||
|
||||
|
||||
" This is so that HIG Cmd and Option movement mappings can be disabled by
|
||||
" adding the line
|
||||
" let macvim_skip_cmd_opt_movement = 1
|
||||
@@ -205,65 +101,6 @@ if exists("macvim_hig_shift_movement")
|
||||
endif " exists("macvim_hig_shift_movement")
|
||||
|
||||
|
||||
|
||||
"
|
||||
" Set up menu key equivalents (these should always have the 'D' modifier set),
|
||||
" action bindings, and alternate items.
|
||||
"
|
||||
" Note: menu items which should execute an action are bound to <Nop>; the
|
||||
" action message is specified here via the :macmenu command.
|
||||
"
|
||||
|
||||
macm File.New\ Window key=<D-n> action=newWindow:
|
||||
macm File.New\ Tab key=<D-t>
|
||||
macm File.Open\.\.\. key=<D-o> action=fileOpen:
|
||||
macm File.Open\ Tab\.\.\. key=<D-T>
|
||||
macm File.Open\ Recent action=recentFilesDummy:
|
||||
macm File.Close\ Window key=<D-W>
|
||||
macm File.Close key=<D-w> action=performClose:
|
||||
macm File.Save key=<D-s>
|
||||
macm File.Save\ All key=<D-M-s> alt=YES
|
||||
macm File.Save\ As\.\.\. key=<D-S>
|
||||
macm File.Print key=<D-p>
|
||||
|
||||
macm Edit.Undo key=<D-z> action=undo:
|
||||
macm Edit.Redo key=<D-Z> action=redo:
|
||||
macm Edit.Cut key=<D-x> action=cut:
|
||||
macm Edit.Copy key=<D-c> action=copy:
|
||||
macm Edit.Paste key=<D-v> action=paste:
|
||||
macm Edit.Select\ All key=<D-a> action=selectAll:
|
||||
macm Edit.Find.Find\.\.\. key=<D-f>
|
||||
macm Edit.Find.Find\ Next key=<D-g> action=findNext:
|
||||
macm Edit.Find.Find\ Previous key=<D-G> action=findPrevious:
|
||||
macm Edit.Find.Use\ Selection\ for\ Find key=<D-e>
|
||||
macm Edit.Special\ Characters\.\.\. key=<D-M-t>
|
||||
macm Edit.Font.Show\ Fonts action=orderFrontFontPanel:
|
||||
macm Edit.Font.Bigger key=<D-=> action=fontSizeUp:
|
||||
macm Edit.Font.Smaller key=<D--> action=fontSizeDown:
|
||||
macm Edit.Special\ Characters\.\.\. action=orderFrontCharacterPalette:
|
||||
|
||||
macm Tools.Spelling.To\ Next\ error key=<D-;>
|
||||
macm Tools.Spelling.Suggest\ Corrections key=<D-:>
|
||||
macm Tools.Make key=<D-b>
|
||||
macm Tools.List\ Errors key=<D-l>
|
||||
macm Tools.List\ Messages key=<D-L>
|
||||
macm Tools.Next\ Error key=<D-C-Right>
|
||||
macm Tools.Previous\ Error key=<D-C-Left>
|
||||
macm Tools.Older\ List key=<D-C-Up>
|
||||
macm Tools.Newer\ List key=<D-C-Down>
|
||||
|
||||
macm Window.Minimize key=<D-m> action=performMiniaturize:
|
||||
macm Window.Minimize\ All key=<D-M-m> action=miniaturizeAll: alt=YES
|
||||
macm Window.Zoom key=<D-C-z> action=performZoom:
|
||||
macm Window.Zoom\ All key=<D-M-C-z> action=zoomAll: alt=YES
|
||||
macm Window.Toggle\ Full\ Screen\ Mode key=<D-F>
|
||||
macm Window.Select\ Next\ Tab key=<D-}>
|
||||
macm Window.Select\ Previous\ Tab key=<D-{>
|
||||
macm Window.Bring\ All\ To\ Front action=arrangeInFront:
|
||||
|
||||
macm Help.MacVim\ Help key=<D-?>
|
||||
macm Help.MacVim\ Website action=openWebsite:
|
||||
|
||||
" Restore the previous value of 'cpoptions'.
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -49,14 +49,21 @@ class Surface(object):
|
||||
def data(self):
|
||||
"""Returns data in ARGB order (on intel, at least)."""
|
||||
r = self.bitmapRep
|
||||
if r.bitmapFormat() != (NSAlphaNonpremultipliedBitmapFormat |
|
||||
NSAlphaFirstBitmapFormat) or \
|
||||
if (r.bitmapFormat() & ~NSAlphaFirstBitmapFormat !=
|
||||
NSAlphaNonpremultipliedBitmapFormat) or \
|
||||
r.bitsPerPixel() != 32 or \
|
||||
r.isPlanar() or \
|
||||
r.samplesPerPixel() != 4:
|
||||
raise Exception("Unsupported image format")
|
||||
return self.bitmapRep.bitmapData()
|
||||
|
||||
def rgbaIndices(self):
|
||||
r = self.bitmapRep
|
||||
if r.bitmapFormat() & NSAlphaFirstBitmapFormat != 0:
|
||||
return 1, 2, 3, 0
|
||||
else:
|
||||
return 0, 1, 2, 3
|
||||
|
||||
def save(self, filename):
|
||||
"""Saves image as png file."""
|
||||
self.bitmapRep.representationUsingType_properties_(NSPNGFileType, None) \
|
||||
@@ -216,6 +223,7 @@ def splitGenericDocumentIcon(img, s):
|
||||
r = img.surfaceOfSize(w, h)
|
||||
bps = 4*w
|
||||
data = r.data()
|
||||
dr, dg, db, da = r.rgbaIndices()
|
||||
|
||||
ground = Surface(w, h, premultiplyAlpha=False)
|
||||
shadow = Surface(w, h, premultiplyAlpha=False)
|
||||
@@ -226,7 +234,10 @@ def splitGenericDocumentIcon(img, s):
|
||||
for y in xrange(h):
|
||||
for x in xrange(w):
|
||||
idx = y*bps + 4*x
|
||||
ia, ir, ig, ib = data[idx:idx + 4]
|
||||
ia = data[idx + da]
|
||||
ir = data[idx + dr]
|
||||
ig = data[idx + dg]
|
||||
ib = data[idx + db]
|
||||
if ia != chr(255):
|
||||
# buffer objects don't support slice assignment :-(
|
||||
grounddata[idx] = ia
|
||||
|
||||
@@ -20,7 +20,8 @@ try:
|
||||
from AppKit import *
|
||||
|
||||
dont_create = False
|
||||
except:
|
||||
except Exception, e:
|
||||
print e
|
||||
dont_create = True # most likely because we're on tiger
|
||||
|
||||
import os
|
||||
|
||||
@@ -176,6 +176,8 @@
|
||||
|
||||
@end
|
||||
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1050 // Scrap Manager has been nixed on Snow Leopard
|
||||
// Methods for interfacing with the Carbon Scrap Manager (analogous to and
|
||||
// interoperable with the Cocoa Pasteboard).
|
||||
@interface IconFamily (ScrapAdditions)
|
||||
@@ -184,3 +186,5 @@
|
||||
- initWithScrap;
|
||||
- (BOOL) putOnScrap;
|
||||
@end
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1498,6 +1498,7 @@ enum {
|
||||
|
||||
@end
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1050 // Scrap Manager has been nixed on Snow Leopard
|
||||
// Methods for interfacing with the Carbon Scrap Manager (analogous to and
|
||||
// interoperable with the Cocoa Pasteboard).
|
||||
|
||||
@@ -1573,4 +1574,4 @@ enum {
|
||||
|
||||
@end
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -41,9 +41,9 @@
|
||||
-->
|
||||
|
||||
<item>
|
||||
<title>Snapshot 48 released</title>
|
||||
<title>Snapshot 49 released</title>
|
||||
<description><![CDATA[
|
||||
<h1>MacVim snapshot 48 released</h1>
|
||||
<h1>MacVim snapshot 49 released</h1>
|
||||
|
||||
<p> Changes since snapshot 47:
|
||||
<ul>
|
||||
@@ -58,11 +58,11 @@
|
||||
</ul>
|
||||
</p>
|
||||
]]></description>
|
||||
<pubDate>Sat, 15 Aug 2009 00:27 CET</pubDate>
|
||||
<pubDate>Sun, 16 Aug 2009 01:17 CET</pubDate>
|
||||
<enclosure type="application/octet-stream"
|
||||
url="http://newmacvim.muskokamug.org/mirror/files/MacVim-snapshot-48.tbz"
|
||||
length="8212911"
|
||||
sparkle:version="48"
|
||||
url="http://newmacvim.muskokamug.org/mirror/files/MacVim-snapshot-49.tbz"
|
||||
length="8212194"
|
||||
sparkle:version="49"
|
||||
sparkle:shortVersionString="7.2"
|
||||
/>
|
||||
</item>
|
||||
|
||||
+6
-1
@@ -1,10 +1,15 @@
|
||||
" System vimrc file for MacVim
|
||||
"
|
||||
" Maintainer: Bjorn Winckler <bjorn.winckler@gmail.com>
|
||||
" Last Change: Sun May 25 2008
|
||||
" Last Change: Sat Aug 29 2009
|
||||
|
||||
set nocompatible
|
||||
|
||||
" The default for 'backspace' is very confusing to new users, so change it to a
|
||||
" more sensible value. Add "set backspace&" to your ~/.vimrc to reset it.
|
||||
set backspace+=indent,eol,start
|
||||
|
||||
" Disable localized menus for now since only some items are translated (e.g.
|
||||
" the entire MacVim menu is set up in a nib file which currently only is
|
||||
" translated to English).
|
||||
set langmenu=none
|
||||
|
||||
+31
-1
@@ -212,13 +212,34 @@ ifndef MZSCHEME_VER
|
||||
MZSCHEME_VER = 209_000
|
||||
endif
|
||||
|
||||
ifndef MZSCHEME_PRECISE_GC
|
||||
MZSCHEME_PRECISE_GC=no
|
||||
endif
|
||||
|
||||
# for version 4.x we need to generate byte-code for Scheme base
|
||||
ifndef MZSCHEME_GENERATE_BASE
|
||||
MZSCHEME_GENERATE_BASE=no
|
||||
endif
|
||||
|
||||
ifeq (yes, $(DYNAMIC_MZSCHEME))
|
||||
DEFINES += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
|
||||
else
|
||||
ifndef MZSCHEME_DLLS
|
||||
MZSCHEME_DLLS = $(MZSCHEME)
|
||||
endif
|
||||
EXTRA_LIBS += -L$(MZSCHEME_DLLS) -lmzsch$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
|
||||
ifeq (yes,$(MZSCHEME_PRECISE_GC))
|
||||
MZSCHEME_LIB=-lmzsch$(MZSCHEME_VER)
|
||||
else
|
||||
MZSCHEME_LIB = -lmzsch$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
|
||||
endif
|
||||
EXTRA_LIBS += -L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)/lib $(MZSCHEME_LIB)
|
||||
endif
|
||||
ifeq (yes,$(MZSCHEME_GENERATE_BASE))
|
||||
DEFINES += -DINCLUDE_MZSCHEME_BASE
|
||||
MZ_EXTRA_DEP += mzscheme_base.c
|
||||
endif
|
||||
ifeq (yes,$(MZSCHEME_PRECISE_GC))
|
||||
DEFINES += -DMZ_PRECISE_GC
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -472,6 +493,9 @@ clean:
|
||||
-$(DEL) $(EXE) vimrun.exe install.exe uninstal.exe
|
||||
ifdef PERL
|
||||
-$(DEL) if_perl.c
|
||||
endif
|
||||
ifdef MZSCHEME
|
||||
-$(DEL) mzscheme_base.c
|
||||
endif
|
||||
-$(DEL) pathdef.c
|
||||
$(MAKE) -C xxd -f Make_cyg.mak clean
|
||||
@@ -523,9 +547,15 @@ endif
|
||||
$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_DEP)
|
||||
$(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
|
||||
|
||||
$(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP)
|
||||
$(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o
|
||||
|
||||
$(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h
|
||||
$(RC) $(RCFLAGS) vim.rc -o $(OUTDIR)/vimrc.o
|
||||
|
||||
mzscheme_base.c:
|
||||
$(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
|
||||
|
||||
pathdef.c: $(INCL)
|
||||
ifneq (sh.exe, $(SHELL))
|
||||
@echo creating pathdef.c
|
||||
|
||||
+4
-1
@@ -135,7 +135,7 @@ endif
|
||||
ifndef MZSCHEME_DLLS
|
||||
MZSCHEME_DLLS=$(MZSCHEME)
|
||||
endif
|
||||
MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS)
|
||||
MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)\lib
|
||||
endif
|
||||
|
||||
endif
|
||||
@@ -562,6 +562,9 @@ clean:
|
||||
-$(DEL) pathdef.c
|
||||
ifdef PERL
|
||||
-$(DEL) if_perl.c
|
||||
endif
|
||||
ifdef MZSCHEME
|
||||
-$(DEL) mzscheme_base.c
|
||||
endif
|
||||
$(MAKE) -C GvimExt -f Make_ming.mak clean
|
||||
$(MAKE) -C xxd -f Make_cyg.mak clean
|
||||
|
||||
@@ -865,6 +865,7 @@ clean:
|
||||
- if exist dimm_i.c del dimm_i.c
|
||||
- if exist dimm.tlb del dimm.tlb
|
||||
- if exist dosinst.exe del dosinst.exe
|
||||
- if exist mzscheme_base.c del mzscheme_base.c
|
||||
cd xxd
|
||||
$(MAKE) /NOLOGO -f Make_mvc.mak clean
|
||||
cd ..
|
||||
|
||||
+15
-3
@@ -1257,7 +1257,7 @@ MACVIMGUI_SRC = gui.c MacVim/gui_macvim.m MacVim/MMBackend.m \
|
||||
MACVIMGUI_OBJ = objects/gui.o objects/pty.o objects/gui_macvim.o \
|
||||
objects/MMBackend.o objects/MacVim.o
|
||||
MACVIMGUI_DEFS = -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe
|
||||
MACVIMGUI_IPATH = -I. -Iproto
|
||||
MACVIMGUI_IPATH =
|
||||
MACVIMGUI_LIBS_DIR =
|
||||
MACVIMGUI_LIBS1 = -framework Cocoa -framework Carbon
|
||||
MACVIMGUI_LIBS2 =
|
||||
@@ -1265,7 +1265,7 @@ MACVIMGUI_INSTALL = install_normal
|
||||
MACVIMGUI_TARGETS =
|
||||
MACVIMGUI_MAN_TARGETS =
|
||||
MACVIMGUI_TESTTARGET = gui
|
||||
MACVIMGUI_BUNDLE =
|
||||
MACVIMGUI_BUNDLE = macvim
|
||||
|
||||
# All GUI files
|
||||
ALL_GUI_SRC = gui.c gui_gtk.c gui_gtk_f.c gui_motif.c gui_xmdlg.c gui_xmebw.c gui_athena.c gui_gtk_x11.c gui_x11.c gui_at_sb.c gui_at_fs.c pty.c
|
||||
@@ -2211,7 +2211,7 @@ uninstall_runtime:
|
||||
|
||||
# Clean up all the files that have been produced, except configure's.
|
||||
# We support common typing mistakes for Juergen! :-)
|
||||
clean celan: testclean
|
||||
clean celan: testclean macvimclean
|
||||
-rm -f *.o objects/* core $(VIMTARGET).core $(VIMTARGET) vim xxd/*.o
|
||||
-rm -f $(TOOLS) auto/osdef.h auto/pathdef.c auto/if_perl.c
|
||||
-rm -f conftest* *~ auto/link.sed
|
||||
@@ -2686,6 +2686,18 @@ $(APPDIR)/Contents:
|
||||
-$(SHELL) ./mkinstalldirs $(RESDIR)/English.lproj
|
||||
|
||||
|
||||
##############################################################################
|
||||
### MacVim GUI
|
||||
.PHONY: macvim macvimclean
|
||||
macvim: $(VIMTARGET)
|
||||
xcodebuild -project MacVim/MacVim.xcodeproj $(XCODEFLAGS)
|
||||
|
||||
macvimclean:
|
||||
if test -d MacVim; then \
|
||||
xcodebuild -project MacVim/MacVim.xcodeproj clean; \
|
||||
fi
|
||||
|
||||
|
||||
###############################################################################
|
||||
### (automatically generated by 'make depend')
|
||||
### Dependencies:
|
||||
|
||||
Vendored
+3761
-4366
File diff suppressed because it is too large
Load Diff
@@ -174,6 +174,11 @@ buf_init_chartab(buf, global)
|
||||
if (VIM_ISDIGIT(*p))
|
||||
c = getdigits(&p);
|
||||
else
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
c = mb_ptr2char_adv(&p);
|
||||
else
|
||||
#endif
|
||||
c = *p++;
|
||||
c2 = -1;
|
||||
if (*p == '-' && p[1] != NUL)
|
||||
@@ -1213,6 +1218,8 @@ in_win_border(wp, vcol)
|
||||
if ((int)vcol == width1 - 1)
|
||||
return TRUE;
|
||||
width2 = width1 + win_col_off2(wp);
|
||||
if (width2 <= 0)
|
||||
return FALSE;
|
||||
return ((vcol - width1) % width2 == width2 - 1);
|
||||
}
|
||||
#endif /* FEAT_MBYTE */
|
||||
|
||||
@@ -21,6 +21,7 @@ CC = @CC@
|
||||
DEFS = @DEFS@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
XCODEFLAGS = @XCODEFLAGS@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
|
||||
Vendored
+7597
-6598
File diff suppressed because it is too large
Load Diff
+121
-77
@@ -111,56 +111,65 @@ if test "`(uname) 2>/dev/null`" = Darwin; then
|
||||
AC_MSG_RESULT([yes, Darwin support excluded])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(--with-mac-arch argument)
|
||||
AC_ARG_WITH(mac-arch, [ --with-mac-arch=ARCH current, intel, ppc or both],
|
||||
MACARCH="$withval"; AC_MSG_RESULT($MACARCH),
|
||||
MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH))
|
||||
|
||||
if test "x$MACARCH" = "xboth"; then
|
||||
AC_MSG_CHECKING(for 10.4 universal SDK)
|
||||
dnl There is a terrible inconsistency (but we appear to get away with it):
|
||||
dnl $CFLAGS uses the 10.4u SDK library for the headers, while $CPPFLAGS
|
||||
dnl doesn't, because "gcc -E" doesn't grok it. That means the configure
|
||||
dnl tests using the preprocessor are actually done with the wrong header
|
||||
dnl files. $LDFLAGS is set at the end, because configure uses it together
|
||||
dnl with $CFLAGS and we can only have one -sysroot argument.
|
||||
save_cppflags="$CPPFLAGS"
|
||||
AC_MSG_CHECKING(--with-macsdk argument)
|
||||
AC_ARG_WITH(macsdk,
|
||||
[ --with-macsdk=SDK SDK version (10.4, 10.5, 10.6, ...)],
|
||||
[ MACSDK="$withval"; AC_MSG_RESULT($MACSDK) ],
|
||||
[ MACSDK=""; AC_MSG_RESULT(using default) ])
|
||||
|
||||
if test -n "$MACSDK"; then
|
||||
AC_MSG_CHECKING(if SDK is supported)
|
||||
save_cflags="$CFLAGS"
|
||||
save_ldflags="$LDFLAGS"
|
||||
CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
|
||||
sdkflags="/Developer/SDKs/MacOSX$MACSDK"
|
||||
if test "x$MACSDK" = "x10.4"; then
|
||||
sdkflags="$sdkflags""u"
|
||||
fi
|
||||
sdkflags="$sdkflags.sdk -mmacosx-version-min=$MACSDK"
|
||||
CFLAGS="$CFLAGS -isysroot $sdkflags"
|
||||
LDFLAGS="$LDFLAGS -Wl,-syslibroot,$sdkflags"
|
||||
AC_TRY_LINK([ ], [ ],
|
||||
AC_MSG_RESULT(found, will make universal binary),
|
||||
|
||||
AC_MSG_RESULT(not found)
|
||||
CFLAGS="$save_cflags"
|
||||
AC_MSG_CHECKING(if Intel architecture is supported)
|
||||
CPPFLAGS="$CPPFLAGS -arch i386"
|
||||
LDFLAGS="$save_ldflags -arch i386"
|
||||
AC_TRY_LINK([ ], [ ],
|
||||
AC_MSG_RESULT(yes); MACARCH="intel",
|
||||
AC_MSG_RESULT(no, using PowerPC)
|
||||
MACARCH="ppc"
|
||||
CPPFLAGS="$save_cppflags -arch ppc"
|
||||
LDFLAGS="$save_ldflags -arch ppc"))
|
||||
elif test "x$MACARCH" = "xintel"; then
|
||||
CPPFLAGS="$CPPFLAGS -arch intel"
|
||||
LDFLAGS="$LDFLAGS -arch intel"
|
||||
elif test "x$MACARCH" = "xppc"; then
|
||||
CPPFLAGS="$CPPFLAGS -arch ppc"
|
||||
LDFLAGS="$LDFLAGS -arch ppc"
|
||||
[ AC_MSG_RESULT([yes])
|
||||
XCODEFLAGS="$XCODEFLAGS -sdk macosx$MACSDK MACOSX_DEPLOYMENT_TARGET=$MACSDK" ],
|
||||
[ AC_MSG_RESULT([no])
|
||||
dnl Important to clear MACSDK so later on in the script we can assume
|
||||
dnl that no SDK was chosen if it is empty.
|
||||
MACSDK=""
|
||||
CFLAGS="$save_cflags"
|
||||
LDFLAGS="$save_ldflags" ])
|
||||
fi
|
||||
|
||||
|
||||
AC_MSG_CHECKING(--with-macarchs argument)
|
||||
AC_ARG_WITH(macarchs,
|
||||
[ --with-macarchs=ARCHS space separated list of archs (i386 x86_64 ppc ...)],
|
||||
[ ARCHS="$withval"; AC_MSG_RESULT($ARCHS) ],
|
||||
[ ARCHS=""; AC_MSG_RESULT(defaulting to native arch) ])
|
||||
|
||||
if test -n "$ARCHS"; then
|
||||
AC_MSG_CHECKING(if architectures are supported)
|
||||
save_cflags="$CFLAGS"
|
||||
save_ldflags="$LDFLAGS"
|
||||
archflags=`echo "$ARCHS" | sed -e 's/[[[:<:]]]/-arch /g'`
|
||||
CFLAGS="$CFLAGS $archflags"
|
||||
LDFLAGS="$LDFLAGS $archflags"
|
||||
AC_TRY_LINK([ ], [ ],
|
||||
[ AC_MSG_RESULT([yes])
|
||||
XCODEFLAGS="$XCODEFLAGS ARCHS=\"$ARCHS\" ONLY_ACTIVE_ARCH=\"NO\"" ],
|
||||
[ AC_MSG_RESULT([no, will build for native arch only])
|
||||
ARCHS=""
|
||||
CFLAGS="$save_cflags"
|
||||
LDFLAGS="$save_ldflags" ])
|
||||
fi
|
||||
|
||||
|
||||
if test "$enable_darwin" = "yes"; then
|
||||
MACOSX=yes
|
||||
OS_EXTRA_SRC="os_macosx.c os_mac_conv.c";
|
||||
OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o"
|
||||
dnl TODO: use -arch i386 on Intel machines
|
||||
CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp"
|
||||
if test "x$MACARCH" = "xboth"; then
|
||||
CPPFLAGS="$CPPFLAGS -I/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon"
|
||||
else
|
||||
CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon"
|
||||
fi
|
||||
|
||||
dnl If Carbon or Cocoa is found, assume we don't want
|
||||
dnl X11 unless it was specifically asked for (--with-x)
|
||||
@@ -181,14 +190,6 @@ if test "`(uname) 2>/dev/null`" = Darwin; then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Avoid a bug with -O2 with gcc 4.0.1. Symptom: malloc() reports double
|
||||
dnl free. This happens in expand_filename(), because the optimizer swaps
|
||||
dnl two blocks of code, both using "repl", that can't be swapped.
|
||||
if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then
|
||||
CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-Oz/'`
|
||||
fi
|
||||
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
@@ -578,6 +579,14 @@ if test "$enable_perlinterp" = "yes"; then
|
||||
perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \
|
||||
-e 'ccdlflags' | sed -e 's/-bE:perl.exp//'`
|
||||
|
||||
if test "x$MACOSX" = "xyes"; then
|
||||
dnl Perl on Mac OS X 10.5 and later adds "-arch" flags but these
|
||||
dnl should only be included if requested by passing --with-archs
|
||||
dnl to configure, so strip these flags first (if present)
|
||||
perllibs=`echo "$perllibs" | sed -e 's/-arch[[^-]]*//g'`
|
||||
perlcppflags=`echo "$perlcppflags" | sed -e 's/-arch[[^-]]*//g'`
|
||||
fi
|
||||
|
||||
dnl check that compiling a simple program still works with the flags
|
||||
dnl added for Perl.
|
||||
AC_MSG_CHECKING([if compile and link flags for Perl are sane])
|
||||
@@ -791,6 +800,16 @@ eof
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
dnl On Mac OS X, when an SDK has been explicitly chosen we can't rely
|
||||
dnl on any of the search paths set above. The -framework flag does it
|
||||
dnl all for us.
|
||||
if test -n "$MACSDK"; then
|
||||
PYTHON_CFLAGS=
|
||||
PYTHON_LIBS=-framework Python
|
||||
PYTHON_CONFDIR=
|
||||
PYTHON_GETPATH_CFLAGS=
|
||||
fi
|
||||
|
||||
dnl check that compiling a simple program still works with the flags
|
||||
dnl added for Python.
|
||||
AC_MSG_CHECKING([if compile and link flags for Python are sane])
|
||||
@@ -978,7 +997,11 @@ if test "$enable_rubyinterp" = "yes"; then
|
||||
librubyarg="$rubyhdrdir/$librubyarg"
|
||||
else
|
||||
rubylibdir=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["libdir"]])'`
|
||||
if test -f "$rubylibdir/$librubyarg"; then
|
||||
if test -d "/System/Library/Frameworks/Ruby.framework"; then
|
||||
dnl On Mac OS X it is safer to just use the -framework flag
|
||||
RUBY_LIBS="-framework Ruby"
|
||||
librubyarg=
|
||||
elif test -f "$rubylibdir/$librubyarg"; then
|
||||
librubyarg="$rubylibdir/$librubyarg"
|
||||
elif test "$librubyarg" = "libruby.a"; then
|
||||
dnl required on Mac OS 10.3 where libruby.a doesn't exist
|
||||
@@ -992,18 +1015,27 @@ if test "$enable_rubyinterp" = "yes"; then
|
||||
RUBY_LIBS="$librubyarg $RUBY_LIBS"
|
||||
fi
|
||||
rubyldflags=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LDFLAGS"]]'`
|
||||
if test "X$rubyldflags" != "X"; then
|
||||
dnl Ruby on Mac OS X 10.5 adds "-arch" flags but these should only
|
||||
dnl be included if requested by passing --with-mac-arch to
|
||||
dnl configure, so strip these flags first (if present)
|
||||
rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//'`
|
||||
if test "X$rubyldflags" != "X"; then
|
||||
LDFLAGS="$rubyldflags $LDFLAGS"
|
||||
fi
|
||||
if test "x$MACOSX" = "xyes"; then
|
||||
dnl Ruby on Mac OS X 10.5 and later adds "-arch" flags but these
|
||||
dnl should only be included if requested by passing --with-archs
|
||||
dnl to configure, so strip these flags first (if present)
|
||||
rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch[[^-]]*//g'`
|
||||
fi
|
||||
if test "X$rubyldflags" != "X"; then
|
||||
LDFLAGS="$rubyldflags $LDFLAGS"
|
||||
fi
|
||||
RUBY_SRC="if_ruby.c"
|
||||
RUBY_OBJ="objects/if_ruby.o"
|
||||
RUBY_PRO="if_ruby.pro"
|
||||
|
||||
dnl On Mac OS X, when an SDK has been explicitly chosen we can't rely
|
||||
dnl on any of the search paths set above. The -framework flag does it
|
||||
dnl all for us.
|
||||
if test -n "$MACSDK"; then
|
||||
RUBY_CFLAGS=
|
||||
RUBY_LIBS="-framework Ruby"
|
||||
fi
|
||||
|
||||
AC_DEFINE(FEAT_RUBY)
|
||||
else
|
||||
AC_MSG_RESULT(not found, disabling Ruby)
|
||||
@@ -1432,7 +1464,7 @@ 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 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
|
||||
@@ -1441,29 +1473,32 @@ if test "x$SKIP_MACVIM" != "xYES" -a "$enable_gui_canon" != "macvim"; then
|
||||
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 "$VIMNAME" = "vim"; then
|
||||
VIMNAME=Vim
|
||||
fi
|
||||
|
||||
dnl Default install directory is not /usr/local
|
||||
if test x$prefix = xNONE; then
|
||||
prefix=/Applications
|
||||
fi
|
||||
|
||||
dnl Sorry for the hard coded default
|
||||
datadir='${prefix}/Vim.app/Contents/Resources'
|
||||
if 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
|
||||
dnl Sorry for the hard coded default
|
||||
datadir='${prefix}/MacVim.app/Contents/Resources'
|
||||
elif 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
|
||||
dnl Sorry for the hard coded default
|
||||
datadir='${prefix}/Vim.app/Contents/Resources'
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon"
|
||||
fi
|
||||
|
||||
if test "$VIMNAME" = "vim"; then
|
||||
VIMNAME=Vim
|
||||
fi
|
||||
|
||||
dnl skip everything else
|
||||
SKIP_GTK=YES;
|
||||
@@ -3246,10 +3281,19 @@ if test "x$MACOSX" = "xyes" && test "x$CARBON" = "xyes" \
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
if test "x$MACARCH" = "xboth"; then
|
||||
LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
|
||||
|
||||
if test "x$MACOSX" = "xyes"; then
|
||||
AC_MSG_CHECKING(--with-xcodecfg argument)
|
||||
AC_ARG_WITH(xcodecfg,
|
||||
[ --with-xcodecfg=CFG Debug, Release (default: Release)],
|
||||
[ XCODEFLAGS="$XCODEFLAGS -configuration $withval"
|
||||
AC_MSG_RESULT($withval) ],
|
||||
[ AC_MSG_RESULT(using default) ])
|
||||
|
||||
AC_SUBST(XCODEFLAGS)
|
||||
fi
|
||||
|
||||
|
||||
dnl gcc 3.1 changed the meaning of -MM. The only solution appears to be to
|
||||
dnl use "-isystem" instead of "-I" for all non-Vim include dirs.
|
||||
dnl But only when making dependencies, cproto and lint don't take "-isystem".
|
||||
@@ -3269,7 +3313,7 @@ if test "$GCC" = yes; then
|
||||
dnl declared as char x[1] but actually longer. Introduced in gcc 4.0.
|
||||
AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1)
|
||||
if test "$gccmajor" -gt "3"; then
|
||||
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=1"
|
||||
CFLAGS=`echo "$CFLAGS -D_FORTIFY_SOURCE=1" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//g' -e 's/-D_FORTIFY_SOURCE=2//g'`
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
+25
@@ -18121,6 +18121,31 @@ get_vim_var_list(idx)
|
||||
return vimvars[idx].vv_list;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set v:char to character "c".
|
||||
*/
|
||||
void
|
||||
set_vim_var_char(c)
|
||||
int c;
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
char_u buf[MB_MAXBYTES];
|
||||
#else
|
||||
char_u buf[2];
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
buf[(*mb_char2bytes)(c, buf)] = NUL;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
buf[0] = c;
|
||||
buf[1] = NUL;
|
||||
}
|
||||
set_vim_var_string(VV_CHAR, buf, -1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set v:count to "count" and v:count1 to "count1".
|
||||
* When "set_prevcount" is TRUE first set v:prevcount from v:count.
|
||||
|
||||
+1
-1
@@ -598,7 +598,7 @@ EX(CMD_match, "match", ex_match,
|
||||
EX(CMD_macaction, "macaction", ex_macaction,
|
||||
EXTRA|NOSPC|NEEDARG),
|
||||
EX(CMD_macmenu, "macmenu", ex_macmenu,
|
||||
EXTRA|TRLBAR|CMDWIN),
|
||||
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,
|
||||
|
||||
+1
-1
@@ -2702,7 +2702,7 @@ doend:
|
||||
{
|
||||
/* messages could be enabled for a serious error, need to check if the
|
||||
* counters don't become negative */
|
||||
if (!did_emsg)
|
||||
if (!did_emsg || msg_silent > save_msg_silent)
|
||||
msg_silent = save_msg_silent;
|
||||
emsg_silent -= did_esilent;
|
||||
if (emsg_silent < 0)
|
||||
|
||||
+12
-9
@@ -3269,7 +3269,6 @@ nextwild(xp, type, options)
|
||||
int i, j;
|
||||
char_u *p1;
|
||||
char_u *p2;
|
||||
int oldlen;
|
||||
int difflen;
|
||||
int v;
|
||||
|
||||
@@ -3294,7 +3293,7 @@ nextwild(xp, type, options)
|
||||
out_flush();
|
||||
|
||||
i = (int)(xp->xp_pattern - ccline.cmdbuff);
|
||||
oldlen = ccline.cmdpos - i;
|
||||
xp->xp_pattern_len = ccline.cmdpos - i;
|
||||
|
||||
if (type == WILD_NEXT || type == WILD_PREV)
|
||||
{
|
||||
@@ -3308,18 +3307,20 @@ nextwild(xp, type, options)
|
||||
/*
|
||||
* Translate string into pattern and expand it.
|
||||
*/
|
||||
if ((p1 = addstar(&ccline.cmdbuff[i], oldlen, xp->xp_context)) == NULL)
|
||||
if ((p1 = addstar(xp->xp_pattern, xp->xp_pattern_len,
|
||||
xp->xp_context)) == NULL)
|
||||
p2 = NULL;
|
||||
else
|
||||
{
|
||||
p2 = ExpandOne(xp, p1, vim_strnsave(&ccline.cmdbuff[i], oldlen),
|
||||
p2 = ExpandOne(xp, p1,
|
||||
vim_strnsave(&ccline.cmdbuff[i], xp->xp_pattern_len),
|
||||
WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE
|
||||
|options, type);
|
||||
vim_free(p1);
|
||||
/* longest match: make sure it is not shorter (happens with :help */
|
||||
if (p2 != NULL && type == WILD_LONGEST)
|
||||
{
|
||||
for (j = 0; j < oldlen; ++j)
|
||||
for (j = 0; j < xp->xp_pattern_len; ++j)
|
||||
if (ccline.cmdbuff[i + j] == '*'
|
||||
|| ccline.cmdbuff[i + j] == '?')
|
||||
break;
|
||||
@@ -3334,7 +3335,7 @@ nextwild(xp, type, options)
|
||||
|
||||
if (p2 != NULL && !got_int)
|
||||
{
|
||||
difflen = (int)STRLEN(p2) - oldlen;
|
||||
difflen = (int)STRLEN(p2) - xp->xp_pattern_len;
|
||||
if (ccline.cmdlen + difflen > ccline.cmdbufflen - 4)
|
||||
{
|
||||
v = realloc_cmdbuff(ccline.cmdlen + difflen);
|
||||
@@ -3623,6 +3624,7 @@ ExpandInit(xp)
|
||||
expand_T *xp;
|
||||
{
|
||||
xp->xp_pattern = NULL;
|
||||
xp->xp_pattern_len = 0;
|
||||
xp->xp_backslash = XP_BS_NONE;
|
||||
#ifndef BACKSLASH_IN_FILENAME
|
||||
xp->xp_shell = FALSE;
|
||||
@@ -4314,8 +4316,8 @@ expand_cmdline(xp, str, col, matchcount, matches)
|
||||
}
|
||||
|
||||
/* add star to file name, or convert to regexp if not exp. files. */
|
||||
file_str = addstar(xp->xp_pattern,
|
||||
(int)(str + col - xp->xp_pattern), xp->xp_context);
|
||||
xp->xp_pattern_len = (int)(str + col - xp->xp_pattern);
|
||||
file_str = addstar(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context);
|
||||
if (file_str == NULL)
|
||||
return EXPAND_UNSUCCESSFUL;
|
||||
|
||||
@@ -4787,7 +4789,7 @@ call_user_expand_func(user_expand_func, xp, num_file, file)
|
||||
sprintf((char *)num, "%d", ccline.cmdpos);
|
||||
args[1] = ccline.cmdbuff;
|
||||
}
|
||||
args[0] = xp->xp_pattern;
|
||||
args[0] = vim_strnsave(xp->xp_pattern, xp->xp_pattern_len);
|
||||
args[2] = num;
|
||||
|
||||
/* Save the cmdline, we don't know what the function may do. */
|
||||
@@ -4803,6 +4805,7 @@ call_user_expand_func(user_expand_func, xp, num_file, file)
|
||||
if (ccline.cmdbuff != NULL)
|
||||
ccline.cmdbuff[ccline.cmdlen] = keep;
|
||||
|
||||
vim_free(args[0]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+6
-10
@@ -4568,7 +4568,7 @@ restore_backup:
|
||||
c = TRUE;
|
||||
if (write_info.bw_conv_error_lnum != 0)
|
||||
{
|
||||
int l = STRLEN(IObuff);
|
||||
size_t l = STRLEN(IObuff);
|
||||
vim_snprintf((char *)IObuff + l, IOSIZE - l, _(" in line %ld;"),
|
||||
(long)write_info.bw_conv_error_lnum);
|
||||
}
|
||||
@@ -9536,15 +9536,10 @@ au_exists(arg)
|
||||
ap = first_autopat[(int)event];
|
||||
if (ap == NULL)
|
||||
goto theend;
|
||||
if (pattern == NULL)
|
||||
{
|
||||
retval = TRUE;
|
||||
goto theend;
|
||||
}
|
||||
|
||||
/* if pattern is "<buffer>", special handling is needed which uses curbuf */
|
||||
/* for pattern "<buffer=N>, fnamecmp() will work fine */
|
||||
if (STRICMP(pattern, "<buffer>") == 0)
|
||||
if (pattern != NULL && STRICMP(pattern, "<buffer>") == 0)
|
||||
buflocal_buf = curbuf;
|
||||
|
||||
/* Check if there is an autocommand with the given pattern. */
|
||||
@@ -9553,9 +9548,10 @@ au_exists(arg)
|
||||
/* For buffer-local autocommands, fnamecmp() works fine. */
|
||||
if (ap->pat != NULL && ap->cmds != NULL
|
||||
&& (group == AUGROUP_ALL || ap->group == group)
|
||||
&& (buflocal_buf == NULL
|
||||
? fnamecmp(ap->pat, pattern) == 0
|
||||
: ap->buflocal_nr == buflocal_buf->b_fnum))
|
||||
&& (pattern == NULL
|
||||
|| (buflocal_buf == NULL
|
||||
? fnamecmp(ap->pat, pattern) == 0
|
||||
: ap->buflocal_nr == buflocal_buf->b_fnum)))
|
||||
{
|
||||
retval = TRUE;
|
||||
break;
|
||||
|
||||
+8
-4
@@ -1607,11 +1607,11 @@ foldMarkAdjustRecurse(gap, line1, line2, amount, amount_after)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 2, 3, or 5: need to correct nested folds too */
|
||||
foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top,
|
||||
line2 - fp->fd_top, amount, amount_after);
|
||||
if (fp->fd_top < top)
|
||||
{
|
||||
/* 2 or 3: need to correct nested folds too */
|
||||
foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top,
|
||||
line2 - fp->fd_top, amount, amount_after);
|
||||
if (last <= line2)
|
||||
{
|
||||
/* 2. fold contains line1, line2 is below fold */
|
||||
@@ -1628,7 +1628,11 @@ foldMarkAdjustRecurse(gap, line1, line2, amount, amount_after)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 5. fold is below line1 and contains line2 */
|
||||
/* 5. fold is below line1 and contains line2; need to
|
||||
* correct nested folds too */
|
||||
foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top,
|
||||
line2 - fp->fd_top, amount,
|
||||
amount_after + (fp->fd_top - top));
|
||||
if (amount == MAXLNUM)
|
||||
{
|
||||
fp->fd_len -= line2 - fp->fd_top + 1;
|
||||
|
||||
+7
-5
@@ -129,7 +129,7 @@ static void map_free __ARGS((mapblock_T **));
|
||||
static void validate_maphash __ARGS((void));
|
||||
static void showmap __ARGS((mapblock_T *mp, int local));
|
||||
#ifdef FEAT_EVAL
|
||||
static char_u *eval_map_expr __ARGS((char_u *str));
|
||||
static char_u *eval_map_expr __ARGS((char_u *str, int c));
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -2446,7 +2446,7 @@ vgetorpeek(advance)
|
||||
if (tabuf.typebuf_valid)
|
||||
{
|
||||
vgetc_busy = 0;
|
||||
s = eval_map_expr(mp->m_str);
|
||||
s = eval_map_expr(mp->m_str, NUL);
|
||||
vgetc_busy = save_vgetc_busy;
|
||||
}
|
||||
else
|
||||
@@ -4367,9 +4367,9 @@ check_abbr(c, ptr, col, mincol)
|
||||
* abbreviation, but is not inserted into the input stream.
|
||||
*/
|
||||
j = 0;
|
||||
/* special key code, split up */
|
||||
if (c != Ctrl_RSB)
|
||||
{
|
||||
/* special key code, split up */
|
||||
if (IS_SPECIAL(c) || c == K_SPECIAL)
|
||||
{
|
||||
tb[j++] = K_SPECIAL;
|
||||
@@ -4398,7 +4398,7 @@ check_abbr(c, ptr, col, mincol)
|
||||
}
|
||||
#ifdef FEAT_EVAL
|
||||
if (mp->m_expr)
|
||||
s = eval_map_expr(mp->m_str);
|
||||
s = eval_map_expr(mp->m_str, c);
|
||||
else
|
||||
#endif
|
||||
s = mp->m_str;
|
||||
@@ -4434,8 +4434,9 @@ check_abbr(c, ptr, col, mincol)
|
||||
* special characters.
|
||||
*/
|
||||
static char_u *
|
||||
eval_map_expr(str)
|
||||
eval_map_expr(str, c)
|
||||
char_u *str;
|
||||
int c; /* NUL or typed character for abbreviation */
|
||||
{
|
||||
char_u *res;
|
||||
char_u *p;
|
||||
@@ -4452,6 +4453,7 @@ eval_map_expr(str)
|
||||
#ifdef FEAT_EX_EXTRA
|
||||
++ex_normal_lock;
|
||||
#endif
|
||||
set_vim_var_char(c); /* set v:char to the typed character */
|
||||
save_cursor = curwin->w_cursor;
|
||||
p = eval_to_string(str, NULL, FALSE);
|
||||
--textlock;
|
||||
|
||||
@@ -1404,6 +1404,10 @@ gui_set_shellsize(mustset, fit_to_display, direction)
|
||||
int min_height;
|
||||
int screen_w;
|
||||
int screen_h;
|
||||
#ifdef HAVE_GTK2
|
||||
int un_maximize = mustset;
|
||||
int did_adjust = 0;
|
||||
#endif
|
||||
|
||||
if (!gui.shell_created)
|
||||
return;
|
||||
@@ -1443,22 +1447,47 @@ gui_set_shellsize(mustset, fit_to_display, direction)
|
||||
if (Columns < MIN_COLUMNS)
|
||||
Columns = MIN_COLUMNS;
|
||||
width = Columns * gui.char_width + base_width;
|
||||
#ifdef HAVE_GTK2
|
||||
++did_adjust;
|
||||
#endif
|
||||
}
|
||||
if ((direction & RESIZE_VERT) && height > screen_h)
|
||||
{
|
||||
Rows = (screen_h - base_height) / gui.char_height;
|
||||
check_shellsize();
|
||||
height = Rows * gui.char_height + base_height;
|
||||
#ifdef HAVE_GTK2
|
||||
++did_adjust;
|
||||
#endif
|
||||
}
|
||||
#ifdef HAVE_GTK2
|
||||
if (did_adjust == 2 || (width + gui.char_width >= screen_w
|
||||
&& height + gui.char_height >= screen_h))
|
||||
/* don't unmaximize if at maximum size */
|
||||
un_maximize = FALSE;
|
||||
#endif
|
||||
}
|
||||
gui.num_cols = Columns;
|
||||
gui.num_rows = Rows;
|
||||
|
||||
min_width = base_width + MIN_COLUMNS * gui.char_width;
|
||||
min_height = base_height + MIN_LINES * gui.char_height;
|
||||
# ifdef FEAT_WINDOWS
|
||||
#ifdef FEAT_WINDOWS
|
||||
min_height += tabline_height() * gui.char_height;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GTK2
|
||||
if (un_maximize)
|
||||
{
|
||||
/* If the window size is smaller than the screen unmaximize the
|
||||
* window, otherwise resizing won't work. */
|
||||
gui_mch_get_screen_dimensions(&screen_w, &screen_h);
|
||||
if ((width + gui.char_width < screen_w
|
||||
|| height + gui.char_height * 2 < screen_h)
|
||||
&& gui_mch_maximized())
|
||||
gui_mch_unmaximize();
|
||||
}
|
||||
#endif
|
||||
|
||||
gui_mch_set_shellsize(width, height, min_width, min_height,
|
||||
base_width, base_height, direction);
|
||||
@@ -3627,7 +3656,12 @@ gui_create_scrollbar(sb, type, wp)
|
||||
int type;
|
||||
win_T *wp;
|
||||
{
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
/* This is passed over to another process, make sure it fits in 32 bit */
|
||||
static int32_t sbar_ident = 0;
|
||||
#else
|
||||
static int sbar_ident = 0;
|
||||
#endif
|
||||
|
||||
sb->ident = sbar_ident++; /* No check for too big, but would it happen? */
|
||||
sb->wp = wp;
|
||||
|
||||
+3
-5
@@ -860,11 +860,9 @@ gtk_form_main_filter(GdkXEvent *gdk_xevent,
|
||||
gtk_form_set_static_gravity(GdkWindow *window, gboolean use_static)
|
||||
{
|
||||
#ifdef HAVE_GTK2
|
||||
gboolean static_gravity_supported;
|
||||
|
||||
static_gravity_supported = gdk_window_set_static_gravities(window,
|
||||
use_static);
|
||||
g_return_if_fail(static_gravity_supported);
|
||||
/* We don't check if static gravity is actually supported, because it
|
||||
* results in an annoying assertion error message. */
|
||||
gdk_window_set_static_gravities(window, use_static);
|
||||
#else
|
||||
XSetWindowAttributes xattributes;
|
||||
|
||||
|
||||
+41
-5
@@ -4066,6 +4066,8 @@ gui_mch_open(void)
|
||||
{
|
||||
guicolor_T fg_pixel = INVALCOLOR;
|
||||
guicolor_T bg_pixel = INVALCOLOR;
|
||||
guint pixel_width;
|
||||
guint pixel_height;
|
||||
|
||||
#ifdef HAVE_GTK2
|
||||
/*
|
||||
@@ -4106,8 +4108,6 @@ gui_mch_open(void)
|
||||
unsigned int w, h;
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
guint pixel_width;
|
||||
guint pixel_height;
|
||||
|
||||
mask = XParseGeometry((char *)gui.geom, &x, &y, &w, &h);
|
||||
|
||||
@@ -4160,9 +4160,16 @@ gui_mch_open(void)
|
||||
}
|
||||
}
|
||||
|
||||
gtk_form_set_size(GTK_FORM(gui.formwin),
|
||||
(guint)(gui_get_base_width() + Columns * gui.char_width),
|
||||
(guint)(gui_get_base_height() + Rows * gui.char_height));
|
||||
pixel_width = (guint)(gui_get_base_width() + Columns * gui.char_width);
|
||||
pixel_height = (guint)(gui_get_base_height() + Rows * gui.char_height);
|
||||
#ifdef HAVE_GTK2
|
||||
/* For GTK2 changing the size of the form widget doesn't cause window
|
||||
* resizing. */
|
||||
if (gtk_socket_id == 0)
|
||||
gtk_window_resize(GTK_WINDOW(gui.mainwin), pixel_width, pixel_height);
|
||||
#else
|
||||
gtk_form_set_size(GTK_FORM(gui.formwin), pixel_width, pixel_height);
|
||||
#endif
|
||||
update_window_manager_hints(0, 0);
|
||||
|
||||
if (foreground_argument != NULL)
|
||||
@@ -4369,6 +4376,29 @@ force_shell_resize_idle(gpointer data)
|
||||
#endif
|
||||
#endif /* HAVE_GTK2 */
|
||||
|
||||
#if defined(HAVE_GTK2) || defined(PROTO)
|
||||
/*
|
||||
* Return TRUE if the main window is maximized.
|
||||
*/
|
||||
int
|
||||
gui_mch_maximized()
|
||||
{
|
||||
return (gui.mainwin != NULL && gui.mainwin->window != NULL
|
||||
&& (gdk_window_get_state(gui.mainwin->window)
|
||||
& GDK_WINDOW_STATE_MAXIMIZED));
|
||||
}
|
||||
|
||||
/*
|
||||
* Unmaximize the main window
|
||||
*/
|
||||
void
|
||||
gui_mch_unmaximize()
|
||||
{
|
||||
if (gui.mainwin != NULL)
|
||||
gtk_window_unmaximize(GTK_WINDOW(gui.mainwin));
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set the windows size.
|
||||
*/
|
||||
@@ -4729,6 +4759,9 @@ gui_mch_font_dialog(char_u *oldval)
|
||||
if (oldval != NULL && *oldval != NUL)
|
||||
gtk_font_selection_dialog_set_font_name(
|
||||
GTK_FONT_SELECTION_DIALOG(gui.fontdlg), (char *)oldval);
|
||||
else
|
||||
gtk_font_selection_dialog_set_font_name(
|
||||
GTK_FONT_SELECTION_DIALOG(gui.fontdlg), DEFAULT_FONT);
|
||||
|
||||
if (gui.fontname)
|
||||
{
|
||||
@@ -4816,6 +4849,9 @@ gui_mch_font_dialog(char_u *oldval)
|
||||
if (oldname != oldval)
|
||||
vim_free(oldname);
|
||||
}
|
||||
else
|
||||
gtk_font_selection_dialog_set_font_name(
|
||||
GTK_FONT_SELECTION_DIALOG(dialog), DEFAULT_FONT);
|
||||
|
||||
response = gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
|
||||
|
||||
+5
-3
@@ -635,8 +635,10 @@ dynamic_mzscheme_end(void)
|
||||
#endif /* DYNAMIC_MZSCHEME */
|
||||
|
||||
/* need to put it here for dynamic stuff to work */
|
||||
#ifdef INCLUDE_MZSCHEME_BASE
|
||||
#if defined(INCLUDE_MZSCHEME_BASE)
|
||||
# include "mzscheme_base.c"
|
||||
#elif MZSCHEME_VERSION_MAJOR >= 400
|
||||
# error MzScheme 4.x must include mzscheme_base.c, for MinGW32 you need to define MZSCHEME_GENERATE_BASE=yes
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -875,14 +877,14 @@ startup_mzscheme(void)
|
||||
#ifdef INCLUDE_MZSCHEME_BASE
|
||||
{
|
||||
/*
|
||||
* versions 4.x do not provide Scheme bindings by defaults
|
||||
* versions 4.x do not provide Scheme bindings by default
|
||||
* we need to add them explicitly
|
||||
*/
|
||||
Scheme_Object *scheme_base_symbol = NULL;
|
||||
MZ_GC_DECL_REG(1);
|
||||
MZ_GC_VAR_IN_REG(0, scheme_base_symbol);
|
||||
MZ_GC_REG();
|
||||
/* invoke function from generated and included base.c */
|
||||
/* invoke function from generated and included mzscheme_base.c */
|
||||
declare_modules(environment);
|
||||
scheme_base_symbol = scheme_intern_symbol("scheme/base");
|
||||
MZ_GC_CHECK();
|
||||
|
||||
+6
-1
@@ -40,7 +40,12 @@
|
||||
|
||||
#define PY_SSIZE_T_CLEAN
|
||||
|
||||
#include <Python.h>
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
# include <Python/Python.h>
|
||||
#else
|
||||
# include <Python.h>
|
||||
#endif
|
||||
|
||||
#if defined(MACOS) && !defined(MACOS_X_UNIX)
|
||||
# include "macglue.h"
|
||||
# include <CodeFragments.h>
|
||||
|
||||
+5
-1
@@ -48,7 +48,11 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <ruby.h>
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
# include <Ruby/Ruby.h>
|
||||
#else
|
||||
# include <ruby.h>
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#undef _
|
||||
|
||||
+11
@@ -2859,6 +2859,17 @@ theend:
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
char_u *
|
||||
lookup_toolbar_item(idx)
|
||||
int idx;
|
||||
{
|
||||
if (idx >= 0 && idx < TOOLBAR_NAME_COUNT)
|
||||
return (char_u*)toolbar_names[idx];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif /* FEAT_GUI_MACVIM */
|
||||
|
||||
#endif /* FEAT_MENU */
|
||||
|
||||
+12
-6
@@ -1557,7 +1557,8 @@ nb_do_cmd(
|
||||
return FAIL;
|
||||
}
|
||||
first = *pos;
|
||||
nbdebug((" FIRST POS: line %d, col %d\n", first.lnum, first.col));
|
||||
nbdebug((" FIRST POS: line %d, col %d\n",
|
||||
first.lnum, first.col));
|
||||
pos = off2pos(buf->bufp, off+count-1);
|
||||
if (!pos)
|
||||
{
|
||||
@@ -1568,7 +1569,8 @@ nb_do_cmd(
|
||||
return FAIL;
|
||||
}
|
||||
last = *pos;
|
||||
nbdebug((" LAST POS: line %d, col %d\n", last.lnum, last.col));
|
||||
nbdebug((" LAST POS: line %d, col %d\n",
|
||||
last.lnum, last.col));
|
||||
del_from_lnum = first.lnum;
|
||||
del_to_lnum = last.lnum;
|
||||
doupdate = 1;
|
||||
@@ -1579,7 +1581,8 @@ nb_do_cmd(
|
||||
next = off2pos(buf->bufp, off + count);
|
||||
|
||||
/* Remove part of the first line. */
|
||||
if (first.col != 0 || (next != NULL && first.lnum == next->lnum))
|
||||
if (first.col != 0
|
||||
|| (next != NULL && first.lnum == next->lnum))
|
||||
{
|
||||
if (first.lnum != last.lnum
|
||||
|| (next != NULL && first.lnum != next->lnum))
|
||||
@@ -1642,7 +1645,8 @@ nb_do_cmd(
|
||||
int id = buf_findsign_id(buf->bufp, (linenr_T)i);
|
||||
if (id > 0)
|
||||
{
|
||||
nbdebug((" Deleting sign %d on line %d\n", id, i));
|
||||
nbdebug((" Deleting sign %d on line %d\n",
|
||||
id, i));
|
||||
buf_delsign(buf->bufp, id);
|
||||
}
|
||||
else
|
||||
@@ -1651,7 +1655,8 @@ nb_do_cmd(
|
||||
}
|
||||
}
|
||||
|
||||
nbdebug((" Deleting lines %d through %d\n", del_from_lnum, del_to_lnum));
|
||||
nbdebug((" Deleting lines %d through %d\n",
|
||||
del_from_lnum, del_to_lnum));
|
||||
curwin->w_cursor.lnum = del_from_lnum;
|
||||
curwin->w_cursor.col = 0;
|
||||
del_lines(del_to_lnum - del_from_lnum + 1, FALSE);
|
||||
@@ -3576,7 +3581,8 @@ get_buf_size(buf_T *bufp)
|
||||
eol_size = 1;
|
||||
for (lnum = 1; lnum <= bufp->b_ml.ml_line_count; ++lnum)
|
||||
{
|
||||
char_count += (long)STRLEN(ml_get(lnum)) + eol_size;
|
||||
char_count += (long)STRLEN(ml_get_buf(bufp, lnum, FALSE))
|
||||
+ eol_size;
|
||||
/* Check for a CTRL-C every 100000 characters */
|
||||
if (char_count > last_check)
|
||||
{
|
||||
|
||||
@@ -4473,11 +4473,6 @@ fex_format(lnum, count, c)
|
||||
int use_sandbox = was_set_insecurely((char_u *)"formatexpr",
|
||||
OPT_LOCAL);
|
||||
int r;
|
||||
#ifdef FEAT_MBYTE
|
||||
char_u buf[MB_MAXBYTES];
|
||||
#else
|
||||
char_u buf[2];
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set v:lnum to the first line number and v:count to the number of lines.
|
||||
@@ -4485,17 +4480,7 @@ fex_format(lnum, count, c)
|
||||
*/
|
||||
set_vim_var_nr(VV_LNUM, lnum);
|
||||
set_vim_var_nr(VV_COUNT, count);
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
buf[(*mb_char2bytes)(c, buf)] = NUL;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
buf[0] = c;
|
||||
buf[1] = NUL;
|
||||
}
|
||||
set_vim_var_string(VV_CHAR, buf, -1);
|
||||
set_vim_var_char(c);
|
||||
|
||||
/*
|
||||
* Evaluate the function.
|
||||
|
||||
@@ -7546,6 +7546,8 @@ set_bool_option(opt_idx, varp, value, opt_flags)
|
||||
{
|
||||
if (curwin->w_p_wrap)
|
||||
curwin->w_leftcol = 0;
|
||||
if (curwin->w_curswant != MAXCOL)
|
||||
curwin->w_set_curswant = TRUE;
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
@@ -7783,6 +7785,22 @@ set_bool_option(opt_idx, varp, value, opt_flags)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_LINEBREAK
|
||||
if ((int *)varp == &curwin->w_p_lbr)
|
||||
{
|
||||
if (curwin->w_curswant != MAXCOL)
|
||||
curwin->w_set_curswant = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_RIGHTLEFT
|
||||
if ((int *)varp == &curwin->w_p_rl)
|
||||
{
|
||||
if (curwin->w_curswant != MAXCOL)
|
||||
curwin->w_set_curswant = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* End of handling side effects for bool options.
|
||||
*/
|
||||
|
||||
+16
-11
@@ -23,17 +23,22 @@
|
||||
* files have many conflicts).
|
||||
*/
|
||||
#ifndef FEAT_X11
|
||||
# include <Quickdraw.h> /* Apple calls it QuickDraw.h... */
|
||||
# include <ToolUtils.h>
|
||||
# include <LowMem.h>
|
||||
# include <Scrap.h>
|
||||
# include <Sound.h>
|
||||
# include <TextUtils.h>
|
||||
# include <Memory.h>
|
||||
# include <OSUtils.h>
|
||||
# include <Files.h>
|
||||
# ifdef FEAT_MBYTE
|
||||
# include <Script.h>
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
/* Don't include Carbon here to avoid polluting the global namespace. */
|
||||
/* # include <Carbon/Carbon.h> */
|
||||
# else
|
||||
# include <Quickdraw.h> /* Apple calls it QuickDraw.h... */
|
||||
# include <ToolUtils.h>
|
||||
# include <LowMem.h>
|
||||
# include <Scrap.h>
|
||||
# include <Sound.h>
|
||||
# include <TextUtils.h>
|
||||
# include <Memory.h>
|
||||
# include <OSUtils.h>
|
||||
# include <Files.h>
|
||||
# ifdef FEAT_MBYTE
|
||||
# include <Script.h>
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -16,6 +16,12 @@
|
||||
#define NO_X11_INCLUDES
|
||||
#include "vim.h"
|
||||
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
/* Include Carbon here instead of in one of the header files to avoid polluting
|
||||
* the global namespace. */
|
||||
# include <Carbon/Carbon.h>
|
||||
#endif
|
||||
|
||||
#if defined(MACOS_CONVERT) || defined(PROTO)
|
||||
# ifdef PROTO
|
||||
/* A few dummy types to be able to generate function prototypes. */
|
||||
|
||||
@@ -2941,6 +2941,10 @@ mch_early_init()
|
||||
signal_stack = (char *)alloc(SIGSTKSZ);
|
||||
init_signal_stack();
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
macvim_early_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(EXITFREE) || defined(PROTO)
|
||||
|
||||
@@ -23,6 +23,9 @@ func! GetMline()
|
||||
" remove '%', not used for formatting.
|
||||
let idline = substitute(idline, "'%'", '', 'g')
|
||||
|
||||
" remove '%' used for plural forms.
|
||||
let idline = substitute(idline, '\\nPlural-Forms: .\+;\\n', '', '')
|
||||
|
||||
" remove everything but % items.
|
||||
return substitute(idline, '[^%]*\(%[-+ #''.0-9*]*l\=[dsuxXpoc%]\)\=', '\1', 'g')
|
||||
endfunc
|
||||
|
||||
@@ -61,6 +61,7 @@ void set_vim_var_nr __ARGS((int idx, long val));
|
||||
long get_vim_var_nr __ARGS((int idx));
|
||||
char_u *get_vim_var_str __ARGS((int idx));
|
||||
list_T *get_vim_var_list __ARGS((int idx));
|
||||
void set_vim_var_char __ARGS((int c));
|
||||
void set_vcount __ARGS((long count, long count1, int set_prevcount));
|
||||
void set_vim_var_string __ARGS((int idx, char_u *val, int len));
|
||||
void set_vim_var_list __ARGS((int idx, list_T *val));
|
||||
|
||||
@@ -16,6 +16,8 @@ int gui_mch_open __ARGS((void));
|
||||
void gui_mch_exit __ARGS((int rc));
|
||||
int gui_mch_get_winpos __ARGS((int *x, int *y));
|
||||
void gui_mch_set_winpos __ARGS((int x, int y));
|
||||
int gui_mch_maximized __ARGS((void));
|
||||
void gui_mch_unmaximize __ARGS((void));
|
||||
void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height, int direction));
|
||||
void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
|
||||
void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
|
||||
void
|
||||
macvim_early_init();
|
||||
void
|
||||
gui_mch_prepare(int *argc, char **argv);
|
||||
int
|
||||
@@ -200,8 +202,8 @@ void gui_macvim_update_modified_flag();
|
||||
void gui_macvim_add_to_find_pboard(char_u *pat);
|
||||
void gui_macvim_set_antialias(int antialias);
|
||||
|
||||
OSErr odb_buffer_close(buf_T *buf);
|
||||
OSErr odb_post_buffer_write(buf_T *buf);
|
||||
int16_t odb_buffer_close(buf_T *buf);
|
||||
int16_t odb_post_buffer_write(buf_T *buf);
|
||||
void odb_end(void);
|
||||
|
||||
char_u *get_macaction_name(expand_T *xp, int idx);
|
||||
|
||||
@@ -22,5 +22,6 @@ void ex_menutranslate __ARGS((exarg_T *eap));
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
void ex_macmenu __ARGS((exarg_T *eap));
|
||||
void ex_macmenukey __ARGS((exarg_T *eap));
|
||||
char_u *lookup_toolbar_item __ARGS((int idx));
|
||||
#endif
|
||||
/* vim: set ft=c : */
|
||||
|
||||
+2
-1
@@ -432,6 +432,7 @@ typedef struct expand
|
||||
{
|
||||
int xp_context; /* type of expansion */
|
||||
char_u *xp_pattern; /* start of item to expand */
|
||||
int xp_pattern_len; /* bytes in xp_pattern before cursor */
|
||||
#if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
|
||||
char_u *xp_arg; /* completion function */
|
||||
int xp_scriptID; /* SID for completion function */
|
||||
@@ -1595,7 +1596,7 @@ struct file_buffer
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_ODB_EDITOR
|
||||
OSType b_odb_server_id; /* FourCC of the ODB server (0 if none) */
|
||||
uint32_t b_odb_server_id; /* FourCC of the ODB server (0 if none) */
|
||||
void *b_odb_token; /* NSAppleEventDescriptor (optional) */
|
||||
char_u *b_odb_fname; /* Custom file name (optional) */
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
|
||||
test48.out test51.out test53.out test54.out test55.out \
|
||||
test56.out test57.out test58.out test59.out test60.out \
|
||||
test61.out test62.out test63.out test64.out test65.out \
|
||||
test66.out
|
||||
test66.out test67.out
|
||||
|
||||
.SUFFIXES: .in .out
|
||||
|
||||
@@ -112,3 +112,4 @@ test63.out: test63.in
|
||||
test64.out: test64.in
|
||||
test65.out: test65.in
|
||||
test66.out: test66.in
|
||||
test67.out: test67.in
|
||||
|
||||
@@ -26,7 +26,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
|
||||
test15.out test17.out test18.out test21.out test26.out \
|
||||
test30.out test31.out test32.out test33.out test34.out \
|
||||
test37.out test38.out test39.out test40.out test41.out \
|
||||
test42.out test52.out test65.out test66.out
|
||||
test42.out test52.out test65.out test66.out test67.out
|
||||
|
||||
SCRIPTS32 = test50.out
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user