mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-05-28 00:21:57 +02:00
Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a54dd7370 | |||
| 6e8e20588d | |||
| 296634f40e | |||
| 13d45e4ff9 | |||
| 3e314dee6e | |||
| 779811f241 | |||
| 22017e1410 | |||
| af8ea2cc11 | |||
| ac3b778ddb | |||
| 1de2bc973a | |||
| cdb8dc17ca | |||
| b11e6ca3c9 | |||
| 69c366f7ed | |||
| 7792c4e8ab | |||
| 3910f20697 | |||
| 472eda54f6 | |||
| c09ef35588 | |||
| bf90097520 | |||
| 3292e01a82 | |||
| ba210fdada | |||
| 2d57fac276 | |||
| 4868c3cb85 | |||
| d38abe1843 | |||
| 045cef0a51 | |||
| 560504f7ba | |||
| 4ba3129468 | |||
| 98cc0fee24 | |||
| 26349fc938 | |||
| 52b5ee23fc | |||
| d97c301011 | |||
| 343bd24d2e | |||
| a58654a6b0 | |||
| af62299744 | |||
| 60cd2a75c1 | |||
| 2ef7f8c8a0 | |||
| f2282b0096 | |||
| 5d748c8f27 | |||
| b884eef376 | |||
| 49cb3f99b8 |
+11
-6
@@ -1,4 +1,4 @@
|
||||
*gui_mac.txt* For Vim version 7.1. Last change: 2008 Feb 05
|
||||
*gui_mac.txt* For Vim version 7.1. Last change: 2008 Mar 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bjorn Winckler
|
||||
@@ -124,7 +124,7 @@ strings like "((3) of 2)" to appear in the window title.
|
||||
|
||||
*macvim-options*
|
||||
These are the non-standard options that MacVim supports:
|
||||
'fullscreen' 'toolbariconsize' 'transparency'
|
||||
'fullscreen' 'fuoptions' 'toolbariconsize' 'transparency'
|
||||
|
||||
*macvim-find*
|
||||
Whenever you search for something in Vim (e.g. using "/") the search query is
|
||||
@@ -220,6 +220,7 @@ as general information regarding Mac OS X user defaults.
|
||||
Here is a list of relevant dictionary entries:
|
||||
|
||||
KEY VALUE ~
|
||||
MMAtsuiRenderer enable ATSUI renderer [bool]
|
||||
MMCellWidthMultiplier width of a normal glyph in em units [float]
|
||||
MMLoginShellArgument login shell parameter [string]
|
||||
MMLoginShellCommand which shell to use to launch Vim [string]
|
||||
@@ -340,16 +341,16 @@ to "~/.gvimrc": >
|
||||
<
|
||||
*:maca* *:macaction*
|
||||
It is typical for menu items in Cocoa applications to bind to Objective-C
|
||||
selectors. To support this, MacVim introduces the ":macaction" command. This
|
||||
selectors. To support this, MacVim introduces the |:macaction| command. This
|
||||
command takes the name of an action message as its only parameter. (An action
|
||||
message is an Objective-C message with "void" return type and a single
|
||||
parameter of type "id".) For example, the "New Window" menu item on the
|
||||
"File" menu is created in the following manner: >
|
||||
:an 10.290 File.New\ Window :macaction newWindow:<CR>
|
||||
|
||||
Note 1: A menu item which is bound to ":macaction" will automatically be bound
|
||||
Note 1: A menu item which is bound to |:macaction| will automatically be bound
|
||||
to that action in all modes (as if ":an" was used). It is not possible to
|
||||
bind to ":macaction" in one mode only.
|
||||
bind to |:macaction| in one mode only.
|
||||
Note 2: The action is "nil-targeted", which means it is passed down the first
|
||||
responder chain.
|
||||
|
||||
@@ -360,8 +361,11 @@ application bundle) which contains all actions that may be called. The key in
|
||||
this dictionary is the name of the action message (case sensitive), the value
|
||||
is not used.
|
||||
|
||||
Hint: The |:macaction| command supports command-line completion so you can
|
||||
enter ":maca<Space><C-d>" to see a list of all available actions.
|
||||
|
||||
Here is a random assortment of actions from Actions.plist which might be
|
||||
useful.
|
||||
useful.
|
||||
|
||||
Action Description ~
|
||||
findNext: Search forward using the "Find Pasteboard"
|
||||
@@ -372,6 +376,7 @@ newWindow: Open a new (empty) window
|
||||
orderFrontCharacterPalette: Show the the "Special Characters" dialog
|
||||
orderFrontFontPanel: Show the Font panel
|
||||
orderFrontPreferencePanel: Show the Preferences panel
|
||||
performClose: Close tab/window
|
||||
performZoom: Zoom window (same as clicking the green blob)
|
||||
selectNextWindow: Select next window (similar to <D-`>)
|
||||
selectPreviousWindow: Select previous window (similar to <S-D-`>)
|
||||
|
||||
+63
-18
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 7.1. Last change: 2007 Aug 10
|
||||
*options.txt* For Vim version 7.1. Last change: 2008 Feb 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -666,17 +666,21 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Standard Annex #11 (http://www.unicode.org/reports/tr11).
|
||||
|
||||
*'antialias'* *'anti'* *'noantialias'* *'noanti'*
|
||||
'antialias' 'anti' boolean (default: off)
|
||||
'antialias' 'anti' boolean (default off, on for MacVim)
|
||||
global
|
||||
{not in Vi}
|
||||
{only available when compiled with Carbon GUI enabled
|
||||
on Mac OS X}
|
||||
This option only has an effect in the Carbon GUI version of Vim on Mac
|
||||
OS X v10.2 or later. When on, Vim will use smooth ("antialiased")
|
||||
fonts, which can be easier to read at certain sizes on certain
|
||||
displays. Setting this option can sometimes cause problems if
|
||||
'guifont' is set to its default (empty string).
|
||||
Note: Antialiasing is handled automatically on MacVim.
|
||||
{only available when compiled with GUI enabled on
|
||||
Mac OS X}
|
||||
This option only has an effect in the GUI version of Vim on Mac OS X
|
||||
v10.2 or later. When on, Vim will use smooth ("antialiased") fonts,
|
||||
which can be easier to read at certain sizes on certain displays.
|
||||
|
||||
Setting this option in the Carbon version can sometimes cause problems
|
||||
if 'guifont' is set to its default (empty string).
|
||||
|
||||
Support for this option is not flawless in MacVim. In particular,
|
||||
Monaco always seems to render not antialiased for point sizes up
|
||||
to 10. The ATSUI renderer has better antialias support.
|
||||
|
||||
*'autochdir'* *'acd'* *'noautochdir'* *'noacd'*
|
||||
'autochdir' 'acd' boolean (default off)
|
||||
@@ -3046,16 +3050,57 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'fullscreen' 'fu' boolean (default off)
|
||||
global
|
||||
{not in Vi}
|
||||
{only available in the MacVim GUI}
|
||||
When this option is set, the whole screen is covered by vim. Screen
|
||||
{only in MacVim GUI}
|
||||
When this option is set, the whole screen is covered by Vim. Screen
|
||||
decorations drawn by the operating system (such as the dock or the
|
||||
menu bar) are hidden. Most of vim's window chrome is hidden as well
|
||||
(e.g. toolbar, title bar). The tab bar and scroll bars remains visible.
|
||||
|
||||
Most of the screen is black, only a 'columns' x 'lines' part of the
|
||||
screen is covered by the actual vim control. The control is centered.
|
||||
menu bar) are hidden. Most of Vim's window chrome is hidden as well
|
||||
(e.g. toolbar, title bar). The tab bar and scroll bars remain visible.
|
||||
Updates to the window position are ignored in fullscreen mode.
|
||||
|
||||
See 'fuoptions' for how Vim resizes when entering and leaving
|
||||
fullscreen mode.
|
||||
|
||||
XXX: Add fuenter/fuleave autocommands? You might want to display
|
||||
a NERDTree or a Tlist only in fullscreen for example. Then again, this
|
||||
could probably be in a sizechanged autocommand that triggers if the
|
||||
size is above a certain threshold.
|
||||
XXX: Think about how 'fullscreen' and 'transparency' should interact.
|
||||
|
||||
*'fuoptions'* *'fuopt'*
|
||||
'fuoptions' 'fuopt' string (default "maxvert")
|
||||
global
|
||||
{not in Vi}
|
||||
{only in MacVim GUI}
|
||||
In fullscreen mode, most of the screen is black, only a part of the
|
||||
screen is covered by the actual Vim control. The control is centered.
|
||||
This option controls the size of the Vim control.
|
||||
value effect ~
|
||||
maxvert When entering fullscreen, 'lines' is set to the maximum number
|
||||
of lines fitting on the screen in fullscreen mode. When
|
||||
leaving fullscreen, if 'lines' is still equal to the maximized
|
||||
number of lines, it is restored to the value it had before
|
||||
entering fullscreen.
|
||||
maxhorz When entering fullscreen, 'columns' is set to the maximum number
|
||||
of columns fitting on the screen in fullscreen mode. When
|
||||
leaving fullscreen, if 'columns' is still equal to the maximized
|
||||
number of columns, it is restored to the value it had before
|
||||
entering fullscreen.
|
||||
|
||||
Examples:
|
||||
Don't change size of Vim when entering fullscreen: >
|
||||
:set fuoptions=
|
||||
< Maximize Vim when entering fullscreen: >
|
||||
:set fuoptions=maxvert,maxhorz
|
||||
<
|
||||
XXX: what if the font size is changed? you probably never want to
|
||||
restore the old 'lines' or 'columns' in that case.
|
||||
XXX: Each time the Vim window resizes (for example due to font size
|
||||
changes, re-maximize Vim to fullscreen?)
|
||||
XXX: The approach doesn't restore vertical Vim size if fu is entered
|
||||
without tabs and leaves with tabs (or the other way round).
|
||||
|
||||
|
||||
|
||||
*'gdefault'* *'gd'* *'nogdefault'* *'nogd'*
|
||||
'gdefault' 'gd' boolean (default off)
|
||||
global
|
||||
@@ -4906,7 +4951,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|autocmd-osfiletypes|
|
||||
|
||||
*'paragraphs'* *'para'*
|
||||
'paragraphs' 'para' string (default "IPLPPPQPP LIpplpipbp")
|
||||
'paragraphs' 'para' string (default "IPLPPPQPP TPHPLIPpLpItpplpipbp")
|
||||
global
|
||||
Specifies the nroff macros that separate paragraphs. These are pairs
|
||||
of two letters (see |object-motions|).
|
||||
|
||||
@@ -697,6 +697,7 @@ Short explanation of each option: *option-list*
|
||||
'formatexpr' 'fex' expression used with "gq" command
|
||||
'fsync' 'fs' whether to invoke fsync() after file write
|
||||
'fullscreen' 'fu' let vim cover the whole screen (MacVim only)
|
||||
'fuoptions' 'fuopt' controls how 'fullscreen' behaves (MacVim only)
|
||||
'gdefault' 'gd' the ":substitute" flag 'g' is default on
|
||||
'grepformat' 'gfm' format of 'grepprg' output
|
||||
'grepprg' 'gp' program to use for ":grep"
|
||||
|
||||
@@ -617,6 +617,8 @@ if has("gui")
|
||||
call append("$", " \tset transparency=" . &transp)
|
||||
call append("$", "fullscreen\tdisplay vim in fullscreen mode")
|
||||
call <SID>BinOptionG("fullscreen", &fullscreen)
|
||||
call append("$", "fuoptions\tcontrol how fullscreen mode should behave")
|
||||
call <SID>OptionG("fuoptions", &fuoptions)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim plugin for showing matching parens
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2008 Jan 06
|
||||
" Last Change: 2008 Feb 27
|
||||
|
||||
" Exit quickly when:
|
||||
" - this plugin was already loaded (or disabled)
|
||||
@@ -34,7 +34,8 @@ function! s:Highlight_Matching_Pair()
|
||||
endif
|
||||
|
||||
" Avoid that we remove the popup menu.
|
||||
if pumvisible()
|
||||
" Return when there are no colors (looks like the cursor jumps).
|
||||
if pumvisible() || (&t_Co < 8 && !has("gui_running"))
|
||||
return
|
||||
endif
|
||||
|
||||
@@ -60,39 +61,13 @@ function! s:Highlight_Matching_Pair()
|
||||
endif
|
||||
|
||||
" Figure out the arguments for searchpairpos().
|
||||
" Restrict the search to visible lines with "stopline".
|
||||
" And avoid searching very far (e.g., for closed folds and long lines)
|
||||
" The "viewable" variables give a range in which we can scroll while keeping
|
||||
" the cursor at the same position
|
||||
" adjustedScrolloff accounts for very large numbers of scrolloff
|
||||
let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2])
|
||||
let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2])
|
||||
let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2])
|
||||
" one of these stoplines will be adjusted below, but the current values are
|
||||
" minimal boundaries within the current window
|
||||
let stoplinebottom = line('w$')
|
||||
let stoplinetop = line('w0')
|
||||
if i % 2 == 0
|
||||
let s_flags = 'nW'
|
||||
let c2 = plist[i + 1]
|
||||
if has("byte_offset") && has("syntax_items") && &smc > 0
|
||||
let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2])
|
||||
let stopline = min([bottom_viewable, byte2line(stopbyte)])
|
||||
else
|
||||
let stopline = min([bottom_viewable, c_lnum + 100])
|
||||
endif
|
||||
let stoplinebottom = stopline
|
||||
else
|
||||
let s_flags = 'nbW'
|
||||
let c2 = c
|
||||
let c = plist[i - 1]
|
||||
if has("byte_offset") && has("syntax_items") && &smc > 0
|
||||
let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2])
|
||||
let stopline = max([top_viewable, byte2line(stopbyte)])
|
||||
else
|
||||
let stopline = max([top_viewable, c_lnum - 100])
|
||||
endif
|
||||
let stoplinetop = stopline
|
||||
endif
|
||||
if c == '['
|
||||
let c = '\['
|
||||
@@ -111,10 +86,47 @@ function! s:Highlight_Matching_Pair()
|
||||
\ '=~? "string\\|character\\|singlequote\\|comment"'
|
||||
execute 'if' s_skip '| let s_skip = 0 | endif'
|
||||
|
||||
" Limit the search to lines visible in the window.
|
||||
let stoplinebottom = line('w$')
|
||||
let stoplinetop = line('w0')
|
||||
if i % 2 == 0
|
||||
let stopline = stoplinebottom
|
||||
else
|
||||
let stopline = stoplinetop
|
||||
endif
|
||||
|
||||
try
|
||||
" Limit the search time to 500 msec to avoid a hang on very long lines.
|
||||
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, 500)
|
||||
" Limit the search time to 300 msec to avoid a hang on very long lines.
|
||||
" This fails when a timeout is not supported.
|
||||
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, 300)
|
||||
catch /E118/
|
||||
" Can't use the timeout, restrict the stopline a bit more to avoid taking
|
||||
" a long time on closed folds and long lines.
|
||||
" The "viewable" variables give a range in which we can scroll while
|
||||
" keeping the cursor at the same position.
|
||||
" adjustedScrolloff accounts for very large numbers of scrolloff.
|
||||
let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2])
|
||||
let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2])
|
||||
let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2])
|
||||
" one of these stoplines will be adjusted below, but the current values are
|
||||
" minimal boundaries within the current window
|
||||
if i % 2 == 0
|
||||
if has("byte_offset") && has("syntax_items") && &smc > 0
|
||||
let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2])
|
||||
let stopline = min([bottom_viewable, byte2line(stopbyte)])
|
||||
else
|
||||
let stopline = min([bottom_viewable, c_lnum + 100])
|
||||
endif
|
||||
let stoplinebottom = stopline
|
||||
else
|
||||
if has("byte_offset") && has("syntax_items") && &smc > 0
|
||||
let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2])
|
||||
let stopline = max([top_viewable, byte2line(stopbyte)])
|
||||
else
|
||||
let stopline = max([top_viewable, c_lnum - 100])
|
||||
endif
|
||||
let stoplinetop = stopline
|
||||
endif
|
||||
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
|
||||
endtry
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ gvimext.dll: gvimext.obj \
|
||||
gvimext.obj: gvimext.h
|
||||
|
||||
.cpp.obj:
|
||||
$(cc) $(cflags) -DFEAT_GETTEXT $(cvarsdll) $*.cpp
|
||||
$(cc) $(cflags) -DFEAT_GETTEXT $(cvarsmt) $*.cpp
|
||||
|
||||
gvimext.res: gvimext.rc
|
||||
$(rc) $(rcflags) $(rcvars) gvimext.rc
|
||||
|
||||
+10
-3
@@ -82,9 +82,8 @@ To compile and debug Vim with the VC2003 Toolkit, you will also need
|
||||
|ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|,
|
||||
and |windbg-download|.
|
||||
|
||||
It's easier to download Visual C++ 2005 Express Edition, |msvc-2005-express|.
|
||||
The advantage of the VC 2003 Toolkit is that it will be freely available
|
||||
long after VC 2005 Express Edition stops being free in November 2006.
|
||||
It's easier to download Visual C++ 2008 Express Edition, |msvc-2008-express|,
|
||||
which is freely available in perpetuity.
|
||||
|
||||
The free Code::Blocks IDE works with the VC2003 Toolkit, as described at
|
||||
http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE
|
||||
@@ -152,6 +151,14 @@ Instructions for integrating the Platform SDK into VC Express:
|
||||
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
|
||||
|
||||
|
||||
Visual C++ 2008 Express Edition *msvc-2008-express*
|
||||
-------------------------------
|
||||
|
||||
Visual C++ 2008 Express Edition can be downloaded for free from:
|
||||
http://msdn2.microsoft.com/en-us/express/default.aspx
|
||||
This includes the IDE and the debugger. You can build Vim with Make_mvc.mak.
|
||||
|
||||
|
||||
2. MinGW
|
||||
========
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
<string></string>
|
||||
<key>newWindow:</key>
|
||||
<string></string>
|
||||
<key>openWebsite:</key>
|
||||
<string></string>
|
||||
<key>orderFrontCharacterPalette:</key>
|
||||
<string></string>
|
||||
<key>orderFrontFontPanel:</key>
|
||||
|
||||
@@ -25,6 +25,7 @@ Jjgod Jiang\
|
||||
Tim Allen\
|
||||
Chris Willmore\
|
||||
Ben Schmidt\
|
||||
Scott Renfro\
|
||||
|
||||
\f1\i0 \
|
||||
...and many others who have helped by reporting bugs etc.\
|
||||
|
||||
@@ -545,7 +545,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>VIMM</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>24</string>
|
||||
<string>25</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
||||
@@ -31,5 +31,6 @@
|
||||
- (IBAction)fontSizeUp:(id)sender;
|
||||
- (IBAction)fontSizeDown:(id)sender;
|
||||
- (IBAction)orderFrontPreferencePanel:(id)sender;
|
||||
- (IBAction)openWebsite:(id)sender;
|
||||
|
||||
@end
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
static NSTimeInterval MMRequestTimeout = 5;
|
||||
static NSTimeInterval MMReplyTimeout = 5;
|
||||
|
||||
static NSString *MMWebsiteString = @"http://code.google.com/p/macvim/";
|
||||
|
||||
|
||||
#pragma options align=mac68k
|
||||
typedef struct
|
||||
@@ -467,15 +469,15 @@ static int executeInLoginShell(NSString *path, NSArray *args);
|
||||
- (void)windowControllerWillOpen:(MMWindowController *)windowController
|
||||
{
|
||||
NSPoint topLeft = NSZeroPoint;
|
||||
NSWindow *keyWin = [NSApp keyWindow];
|
||||
NSWindow *topWin = [[[self topmostVimController] windowController] window];
|
||||
NSWindow *win = [windowController window];
|
||||
|
||||
if (!win) return;
|
||||
|
||||
// If there is a key window, cascade from it, otherwise use the autosaved
|
||||
// window position (if any).
|
||||
if (keyWin) {
|
||||
NSRect frame = [keyWin frame];
|
||||
// If there is a window belonging to a Vim process, cascade from it,
|
||||
// otherwise use the autosaved window position (if any).
|
||||
if (topWin) {
|
||||
NSRect frame = [topWin frame];
|
||||
topLeft = NSMakePoint(frame.origin.x, NSMaxY(frame));
|
||||
} else {
|
||||
NSString *topLeftString = [[NSUserDefaults standardUserDefaults]
|
||||
@@ -485,7 +487,7 @@ static int executeInLoginShell(NSString *path, NSArray *args);
|
||||
}
|
||||
|
||||
if (!NSEqualPoints(topLeft, NSZeroPoint)) {
|
||||
if (keyWin)
|
||||
if (topWin)
|
||||
topLeft = [win cascadeTopLeftFromPoint:topLeft];
|
||||
|
||||
[win setFrameTopLeftPoint:topLeft];
|
||||
@@ -578,6 +580,12 @@ static int executeInLoginShell(NSString *path, NSArray *args);
|
||||
[[MMPreferenceController sharedPrefsWindowController] showWindow:self];
|
||||
}
|
||||
|
||||
- (IBAction)openWebsite:(id)sender
|
||||
{
|
||||
[[NSWorkspace sharedWorkspace] openURL:
|
||||
[NSURL URLWithString:MMWebsiteString]];
|
||||
}
|
||||
|
||||
- (byref id <MMFrontendProtocol>)
|
||||
connectBackend:(byref in id <MMBackendProtocol>)backend
|
||||
pid:(int)pid
|
||||
|
||||
@@ -30,6 +30,7 @@ enum { MMMaxCellsPerChar = 2 };
|
||||
NSImage *contentImage;
|
||||
NSSize imageSize;
|
||||
ATSUStyle atsuStyles[MMMaxCellsPerChar];
|
||||
BOOL antialias;
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(NSRect)frame;
|
||||
@@ -57,6 +58,8 @@ enum { MMMaxCellsPerChar = 2 };
|
||||
- (void)setShouldDrawInsertionPoint:(BOOL)on;
|
||||
- (void)setPreEditRow:(int)row column:(int)col;
|
||||
- (void)hideMarkedTextField;
|
||||
- (void)setMouseShape:(int)shape;
|
||||
- (void)setAntialias:(BOOL)state;
|
||||
|
||||
//
|
||||
// NSTextView methods
|
||||
|
||||
@@ -108,6 +108,10 @@ enum {
|
||||
imageSize = NSZeroSize;
|
||||
insetSize = NSZeroSize;
|
||||
|
||||
// NOTE: If the default changes to 'NO' then the intialization of
|
||||
// p_antialias in option.c must change as well.
|
||||
antialias = YES;
|
||||
|
||||
[self initAtsuStyles];
|
||||
}
|
||||
|
||||
@@ -258,6 +262,15 @@ enum {
|
||||
{
|
||||
}
|
||||
|
||||
- (void)setMouseShape:(int)shape
|
||||
{
|
||||
}
|
||||
|
||||
- (void)setAntialias:(BOOL)state
|
||||
{
|
||||
antialias = state;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -918,6 +931,9 @@ enum {
|
||||
[contentImage unlockFocus];
|
||||
}
|
||||
|
||||
#define atsu_style_set_bool(s, t, b) \
|
||||
ATSUSetAttributes(s, 1, &t, &(sizeof(Boolean)), &&b);
|
||||
|
||||
- (void)drawString:(UniChar *)string length:(UniCharCount)length
|
||||
atRow:(int)row column:(int)col cells:(int)cells
|
||||
withFlags:(int)flags foregroundColor:(NSColor *)fg
|
||||
@@ -929,6 +945,26 @@ enum {
|
||||
ATSUStyle style = (flags & DRAW_WIDE) ? atsuStyles[1] : atsuStyles[0];
|
||||
ATSUTextLayout layout;
|
||||
|
||||
// Font selection and rendering options for ATSUI
|
||||
ATSUAttributeTag attribTags[3] = { kATSUQDBoldfaceTag,
|
||||
kATSUQDItalicTag,
|
||||
kATSUStyleRenderingOptionsTag };
|
||||
ByteCount attribSizes[] = { sizeof(Boolean),
|
||||
sizeof(Boolean),
|
||||
sizeof(UInt32) };
|
||||
Boolean useBold, useItalic;
|
||||
UInt32 useAntialias;
|
||||
ATSUAttributeValuePtr attribValues[3] = { &useBold, &useItalic,
|
||||
&useAntialias };
|
||||
|
||||
useBold = (flags & DRAW_BOLD) ? true : false;
|
||||
useItalic = (flags & DRAW_ITALIC) ? true : false;
|
||||
useAntialias = antialias ? kATSStyleApplyAntiAliasing
|
||||
: kATSStyleNoAntiAliasing;
|
||||
|
||||
ATSUSetAttributes(style, sizeof(attribValues) / sizeof(attribValues[0]),
|
||||
attribTags, attribSizes, attribValues);
|
||||
|
||||
// NSLog(@"drawString: %d", length);
|
||||
|
||||
ATSUCreateTextLayout(&layout);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
id frontendProxy;
|
||||
NSDictionary *colorDict;
|
||||
NSDictionary *sysColorDict;
|
||||
NSDictionary *actionDict;
|
||||
BOOL inputReceived;
|
||||
BOOL tabBarVisible;
|
||||
unsigned backgroundColor;
|
||||
@@ -54,6 +55,7 @@
|
||||
- (void)setSpecialColor:(int)color;
|
||||
- (void)setDefaultColorsBackground:(int)bg foreground:(int)fg;
|
||||
- (NSConnection *)connection;
|
||||
- (NSDictionary *)actionDict;
|
||||
|
||||
- (BOOL)checkin;
|
||||
- (BOOL)openVimWindow;
|
||||
@@ -112,9 +114,11 @@
|
||||
- (int)lookupColorWithKey:(NSString *)key;
|
||||
- (BOOL)hasSpecialKeyWithValue:(NSString *)value;
|
||||
|
||||
- (void)enterFullscreen;
|
||||
- (void)enterFullscreen:(int)fuoptions;
|
||||
- (void)leaveFullscreen;
|
||||
|
||||
- (void)setAntialias:(BOOL)antialias;
|
||||
|
||||
- (void)updateModifiedFlag;
|
||||
|
||||
- (void)registerServerWithName:(NSString *)name;
|
||||
|
||||
+43
-4
@@ -142,8 +142,12 @@ static NSString *MMSymlinkWarningString =
|
||||
sysColorDict = [[NSDictionary dictionaryWithContentsOfFile:path]
|
||||
retain];
|
||||
|
||||
if (!(colorDict && sysColorDict))
|
||||
NSLog(@"ERROR: Failed to load color dictionaries.%@",
|
||||
path = [mainBundle pathForResource:@"Actions" ofType:@"plist"];
|
||||
if (path)
|
||||
actionDict = [[NSDictionary dictionaryWithContentsOfFile:path] retain];
|
||||
|
||||
if (!(colorDict && sysColorDict && actionDict))
|
||||
NSLog(@"ERROR: Failed to load dictionaries.%@",
|
||||
MMSymlinkWarningString);
|
||||
|
||||
return self;
|
||||
@@ -165,6 +169,7 @@ static NSString *MMSymlinkWarningString =
|
||||
[drawData release]; drawData = nil;
|
||||
[frontendProxy release]; frontendProxy = nil;
|
||||
[connection release]; connection = nil;
|
||||
[actionDict release]; actionDict = nil;
|
||||
[sysColorDict release]; sysColorDict = nil;
|
||||
[colorDict release]; colorDict = nil;
|
||||
|
||||
@@ -215,6 +220,11 @@ static NSString *MMSymlinkWarningString =
|
||||
return connection;
|
||||
}
|
||||
|
||||
- (NSDictionary *)actionDict
|
||||
{
|
||||
return actionDict;
|
||||
}
|
||||
|
||||
- (BOOL)checkin
|
||||
{
|
||||
if (![self connection]) {
|
||||
@@ -1055,9 +1065,11 @@ static NSString *MMSymlinkWarningString =
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)enterFullscreen
|
||||
- (void)enterFullscreen:(int)fuoptions
|
||||
{
|
||||
[self queueMessage:EnterFullscreenMsgID data:nil];
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
[data appendBytes:&fuoptions length:sizeof(int)];
|
||||
[self queueMessage:EnterFullscreenMsgID data:data];
|
||||
}
|
||||
|
||||
- (void)leaveFullscreen
|
||||
@@ -1065,6 +1077,13 @@ static NSString *MMSymlinkWarningString =
|
||||
[self queueMessage:LeaveFullscreenMsgID data:nil];
|
||||
}
|
||||
|
||||
- (void)setAntialias:(BOOL)antialias
|
||||
{
|
||||
int msgid = antialias ? EnableAntialiasMsgID : DisableAntialiasMsgID;
|
||||
|
||||
[self queueMessage:msgid data:nil];
|
||||
}
|
||||
|
||||
- (void)updateModifiedFlag
|
||||
{
|
||||
// Notify MacVim if _any_ buffer has changed from unmodified to modified or
|
||||
@@ -1243,6 +1262,8 @@ static NSString *MMSymlinkWarningString =
|
||||
|
||||
- (BOOL)starRegisterToPasteboard:(byref NSPasteboard *)pboard
|
||||
{
|
||||
// TODO: This method should share code with clip_mch_request_selection().
|
||||
|
||||
if (VIsual_active && (State & NORMAL) && clip_star.available) {
|
||||
// If there is no pasteboard, return YES to indicate that there is text
|
||||
// to copy.
|
||||
@@ -1639,6 +1660,24 @@ static NSString *MMSymlinkWarningString =
|
||||
[self handleOdbEdit:data];
|
||||
} else if (XcodeModMsgID == msgid) {
|
||||
[self handleXcodeMod:data];
|
||||
} else if (CloseMsgID == msgid) {
|
||||
// If in Ex mode, then simply exit Ex mode (^U:vi<CR>). Otherwise
|
||||
// try to close one (Vim-)window by going to Normal mode first
|
||||
// (CTRL-\_CTRL-N) and then sending ":q<CR>", but only if the
|
||||
// command-line window is not open. If the command-line window is open
|
||||
// then we just go back to normal mode (since CTRL-\_CTRL-N closes the
|
||||
// command-line window).
|
||||
if (exmode_active) {
|
||||
// Exit Ex mode
|
||||
add_to_input_buf((char_u*)"\x15:vi\n", 5);
|
||||
} else {
|
||||
// Go to normal mode
|
||||
add_to_input_buf((char_u*)"\x1c\xe", 2);
|
||||
if (0 == cmdwin_type) {
|
||||
// Command-line window was not open, so :q
|
||||
add_to_input_buf((char_u*)":q\n", 3);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
NSLog(@"WARNING: Unknown message received (msgid=%d)", msgid);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* vi:set ts=8 sts=4 sw=4 ft=objc:
|
||||
*
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
* MacVim GUI port by Bjorn Winckler
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
* MacVim GUI port by Bjorn Winckler
|
||||
*
|
||||
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||
@@ -19,11 +19,20 @@
|
||||
MMVimView *view;
|
||||
NSPoint oldPosition;
|
||||
NSString *oldTabBarStyle;
|
||||
|
||||
// These are only valid in fullscreen mode and store pre-fu vim size
|
||||
int nonFuRows, nonFuColumns;
|
||||
|
||||
// These store the size vim had right after entering fu mode
|
||||
int startFuRows, startFuColumns;
|
||||
|
||||
// This stores the contents of fuoptions_flags at fu start time
|
||||
int startFuFlags;
|
||||
}
|
||||
|
||||
- (MMFullscreenWindow *)initWithWindow:(NSWindow *)t view:(MMVimView *)v;
|
||||
|
||||
- (void)enterFullscreen;
|
||||
- (void)enterFullscreen:(int)fuoptions;
|
||||
- (void)leaveFullscreen;
|
||||
- (void)centerView;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* vi:set ts=8 sts=4 sw=4 ft=objc:
|
||||
*
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
* MacVim GUI port by Bjorn Winckler
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
* MacVim GUI port by Bjorn Winckler
|
||||
*
|
||||
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||
@@ -23,6 +23,7 @@
|
||||
* Author: Nico Weber
|
||||
*/
|
||||
|
||||
#import "MMVimController.h"
|
||||
#import "MMFullscreenWindow.h"
|
||||
#import <PSMTabBarControl.h>
|
||||
#import "MMVimView.h"
|
||||
@@ -30,6 +31,10 @@
|
||||
#import "MMWindowController.h"
|
||||
#import <Carbon/Carbon.h>
|
||||
|
||||
// These have to be the same as in option.h
|
||||
#define FUOPT_MAXVERT 0x001
|
||||
#define FUOPT_MAXHORZ 0x002
|
||||
|
||||
|
||||
static int numFullscreenWindows = 0;
|
||||
|
||||
@@ -82,7 +87,7 @@ static int numFullscreenWindows = 0;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)enterFullscreen
|
||||
- (void)enterFullscreen:(int)fuoptions
|
||||
{
|
||||
[self hideDockIfAppropriate];
|
||||
|
||||
@@ -123,6 +128,42 @@ static int numFullscreenWindows = 0;
|
||||
// focus gained message
|
||||
[self setDelegate:delegate];
|
||||
|
||||
// resize vim view according to fuoptions
|
||||
int currRows, currColumns;
|
||||
[[view textView] getMaxRows:&currRows columns:&currColumns];
|
||||
|
||||
int fuRows = currRows, fuColumns = currColumns;
|
||||
|
||||
int maxRows, maxColumns;
|
||||
NSSize size = [[self screen] frame].size;
|
||||
[view constrainRows:&maxRows columns:&maxColumns toSize:size];
|
||||
|
||||
// Store current pre-fu vim size
|
||||
nonFuRows = currRows;
|
||||
nonFuColumns = currColumns;
|
||||
|
||||
// Compute current fu size
|
||||
if (fuoptions & FUOPT_MAXVERT)
|
||||
fuRows = maxRows;
|
||||
if (fuoptions & FUOPT_MAXHORZ)
|
||||
fuColumns = maxColumns;
|
||||
|
||||
startFuFlags = fuoptions;
|
||||
|
||||
// if necessary, resize vim to target fu size
|
||||
if (currRows != fuRows || currColumns != fuColumns) {
|
||||
int newSize[2] = { fuRows, fuColumns };
|
||||
NSData *data = [NSData dataWithBytes:newSize length:2*sizeof(int)];
|
||||
MMVimController *vimController =
|
||||
[[self windowController] vimController];
|
||||
|
||||
[vimController sendMessage:SetTextDimensionsMsgID data:data];
|
||||
[[view textView] setMaxRows:fuRows columns:fuColumns];
|
||||
}
|
||||
|
||||
startFuRows = fuRows;
|
||||
startFuColumns = fuColumns;
|
||||
|
||||
// move vim view to the window's center
|
||||
[self centerView];
|
||||
|
||||
@@ -149,6 +190,32 @@ static int numFullscreenWindows = 0;
|
||||
didBlend = YES;
|
||||
}
|
||||
|
||||
// restore old vim view size
|
||||
int currRows, currColumns;
|
||||
[[view textView] getMaxRows:&currRows columns:&currColumns];
|
||||
int newRows = currRows, newColumns = currColumns;
|
||||
|
||||
// compute desired non-fu size.
|
||||
// if current fu size is equal to fu size at fu enter time,
|
||||
// restore the old size
|
||||
//
|
||||
if (startFuFlags & FUOPT_MAXVERT && startFuRows == currRows)
|
||||
newRows = nonFuRows;
|
||||
|
||||
if (startFuFlags & FUOPT_MAXHORZ && startFuColumns == currColumns)
|
||||
newColumns = nonFuColumns;
|
||||
|
||||
// resize vim if necessary
|
||||
if (currRows != newRows || currColumns != newColumns) {
|
||||
int newSize[2] = { newRows, newColumns };
|
||||
NSData *data = [NSData dataWithBytes:newSize length:2*sizeof(int)];
|
||||
MMVimController *vimController =
|
||||
[[self windowController] vimController];
|
||||
|
||||
[vimController sendMessage:SetTextDimensionsMsgID data:data];
|
||||
[[view textView] setMaxRows:newRows columns:newColumns];
|
||||
}
|
||||
|
||||
// fix up target controller
|
||||
[self retain]; // NSWindowController releases us once
|
||||
[[self windowController] setWindow:target];
|
||||
@@ -166,6 +233,7 @@ static int numFullscreenWindows = 0;
|
||||
// window.
|
||||
[view removeFromSuperviewWithoutNeedingDisplay];
|
||||
[[target contentView] addSubview:view];
|
||||
|
||||
[view setFrameOrigin:oldPosition];
|
||||
[self close];
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
int preEditRow;
|
||||
int preEditColumn;
|
||||
int mouseShape;
|
||||
BOOL antialias;
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(NSRect)frame;
|
||||
@@ -41,6 +42,7 @@
|
||||
- (void)hideMarkedTextField;
|
||||
- (void)performBatchDrawWithData:(NSData *)data;
|
||||
- (void)setMouseShape:(int)shape;
|
||||
- (void)setAntialias:(BOOL)antialias;
|
||||
|
||||
//
|
||||
// MMTextStorage methods
|
||||
|
||||
@@ -111,6 +111,9 @@ enum {
|
||||
return nil;
|
||||
}
|
||||
|
||||
// NOTE: If the default changes to 'NO' then the intialization of
|
||||
// p_antialias in option.c must change as well.
|
||||
antialias = YES;
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -334,6 +337,11 @@ enum {
|
||||
[self setCursor];
|
||||
}
|
||||
|
||||
- (void)setAntialias:(BOOL)state
|
||||
{
|
||||
antialias = state;
|
||||
}
|
||||
|
||||
- (NSFont *)font
|
||||
{
|
||||
return [(MMTextStorage*)[self textStorage] font];
|
||||
@@ -442,6 +450,9 @@ enum {
|
||||
|
||||
- (void)drawRect:(NSRect)rect
|
||||
{
|
||||
NSGraphicsContext *context = [NSGraphicsContext currentContext];
|
||||
[context setShouldAntialias:antialias];
|
||||
|
||||
[super drawRect:rect];
|
||||
|
||||
if (shouldDrawInsertionPoint) {
|
||||
|
||||
@@ -878,7 +878,8 @@ static NSTimeInterval MMResendInterval = 0.5;
|
||||
[self setServerName:name];
|
||||
[name release];
|
||||
} else if (EnterFullscreenMsgID == msgid) {
|
||||
[windowController enterFullscreen];
|
||||
int fuoptions = *(int*)[data bytes];
|
||||
[windowController enterFullscreen:fuoptions];
|
||||
} else if (LeaveFullscreenMsgID == msgid) {
|
||||
[windowController leaveFullscreen];
|
||||
} else if (BuffersNotModifiedMsgID == msgid) {
|
||||
@@ -889,6 +890,10 @@ static NSTimeInterval MMResendInterval = 0.5;
|
||||
const int *dim = (const int*)[data bytes];
|
||||
[[[windowController vimView] textView] setPreEditRow:dim[0]
|
||||
column:dim[1]];
|
||||
} else if (EnableAntialiasMsgID == msgid) {
|
||||
[[[windowController vimView] textView] setAntialias:YES];
|
||||
} else if (DisableAntialiasMsgID == msgid) {
|
||||
[[[windowController vimView] textView] setAntialias:NO];
|
||||
} else {
|
||||
NSLog(@"WARNING: Unknown message received (msgid=%d)", msgid);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
- (void)liveResizeWillStart;
|
||||
- (void)liveResizeDidEnd;
|
||||
|
||||
- (void)enterFullscreen;
|
||||
- (void)enterFullscreen:(int)fuoptions;
|
||||
- (void)leaveFullscreen;
|
||||
- (void)setBuffersModified:(BOOL)mod;
|
||||
|
||||
|
||||
@@ -367,7 +367,9 @@
|
||||
// NOTE: This is called when the transparency changes so set the opacity
|
||||
// flag on the window here (should be faster if the window is opaque).
|
||||
BOOL isOpaque = [back alphaComponent] == 1.0f;
|
||||
[[self window] setOpaque:isOpaque];
|
||||
[decoratedWindow setOpaque:isOpaque];
|
||||
if (fullscreenEnabled)
|
||||
[fullscreenWindow setOpaque:isOpaque];
|
||||
|
||||
[vimView setDefaultColorsBackground:back foreground:fore];
|
||||
}
|
||||
@@ -544,13 +546,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)enterFullscreen
|
||||
- (void)enterFullscreen:(int)fuoptions
|
||||
{
|
||||
if (fullscreenEnabled) return;
|
||||
|
||||
fullscreenWindow = [[MMFullscreenWindow alloc]
|
||||
initWithWindow:decoratedWindow view:vimView];
|
||||
[fullscreenWindow enterFullscreen];
|
||||
[fullscreenWindow enterFullscreen:fuoptions];
|
||||
[fullscreenWindow setDelegate:self];
|
||||
fullscreenEnabled = YES;
|
||||
|
||||
@@ -593,11 +595,9 @@
|
||||
|
||||
- (IBAction)performClose:(id)sender
|
||||
{
|
||||
// NOTE: File->Close is bound to this action message instead binding it
|
||||
// directly to the below vim input so that File->Close also works for
|
||||
// auxiliary windows such as the About dialog. (If we were to bind the
|
||||
// below, then <D-w> will not close e.g. the About dialog.)
|
||||
[vimController addVimInput:@"<C-\\><C-N>:conf q<CR>"];
|
||||
// NOTE: File->Close is bound to this action message so that File->Close
|
||||
// also works for auxiliary windows such as the About dialog.
|
||||
[vimController sendMessage:CloseMsgID data:nil];
|
||||
}
|
||||
|
||||
- (IBAction)findNext:(id)sender
|
||||
|
||||
+9
-1
@@ -160,6 +160,9 @@ enum {
|
||||
ODBEditMsgID,
|
||||
XcodeModMsgID,
|
||||
LiveResizeMsgID,
|
||||
EnableAntialiasMsgID,
|
||||
DisableAntialiasMsgID,
|
||||
CloseMsgID,
|
||||
};
|
||||
|
||||
|
||||
@@ -235,6 +238,12 @@ enum {
|
||||
|
||||
|
||||
|
||||
|
||||
// Vim pasteboard type (holds motion type + string)
|
||||
extern NSString *VimPBoardType;
|
||||
|
||||
|
||||
|
||||
// Loads all fonts in the Resouces folder of the app bundle and returns a font
|
||||
// container reference (which should be used to deactivate the loaded fonts).
|
||||
ATSFontContainerRef loadFonts();
|
||||
@@ -281,4 +290,3 @@ NSString *buildSearchTextCommand(NSString *searchText);
|
||||
|
||||
// MacVim Apple Event Constants
|
||||
#define keyMMUntitledWindow 'MMuw'
|
||||
|
||||
|
||||
@@ -73,6 +73,9 @@ char *MessageStrings[] =
|
||||
"ODBEditMsgID",
|
||||
"XcodeModMsgID",
|
||||
"LiveResizeMsgID",
|
||||
"EnableAntialiasMsgID",
|
||||
"DisableAntialiasMsgID",
|
||||
"CloseMsgID",
|
||||
};
|
||||
|
||||
|
||||
@@ -108,6 +111,12 @@ NSString *MMLoginShellArgumentKey = @"MMLoginShellArgument";
|
||||
|
||||
|
||||
|
||||
// Vim pasteboard type (holds motion type + string)
|
||||
NSString *VimPBoardType = @"VimPBoardType";
|
||||
|
||||
|
||||
|
||||
|
||||
ATSFontContainerRef
|
||||
loadFonts()
|
||||
{
|
||||
|
||||
@@ -698,7 +698,7 @@
|
||||
i386,
|
||||
);
|
||||
COPY_PHASE_STRIP = YES;
|
||||
CURRENT_PROJECT_VERSION = 24;
|
||||
CURRENT_PROJECT_VERSION = 25;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
|
||||
@@ -739,7 +739,7 @@
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 24;
|
||||
CURRENT_PROJECT_VERSION = 25;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
|
||||
@@ -770,7 +770,7 @@
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH)";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
CURRENT_PROJECT_VERSION = 24;
|
||||
CURRENT_PROJECT_VERSION = 25;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
|
||||
|
||||
+111
-48
@@ -480,44 +480,75 @@ clip_mch_own_selection(VimClipboard *cbd)
|
||||
clip_mch_request_selection(VimClipboard *cbd)
|
||||
{
|
||||
NSPasteboard *pb = [NSPasteboard generalPasteboard];
|
||||
NSString *pbType = [pb availableTypeFromArray:
|
||||
[NSArray arrayWithObject:NSStringPboardType]];
|
||||
if (pbType) {
|
||||
NSMutableString *string =
|
||||
NSArray *supportedTypes = [NSArray arrayWithObjects:VimPBoardType,
|
||||
NSStringPboardType, nil];
|
||||
NSString *bestType = [pb availableTypeFromArray:supportedTypes];
|
||||
if (!bestType) return;
|
||||
|
||||
int motion_type = MCHAR;
|
||||
NSString *string = nil;
|
||||
|
||||
if ([bestType isEqual:VimPBoardType]) {
|
||||
// This type should consist of an array with two objects:
|
||||
// 1. motion type (NSNumber)
|
||||
// 2. text (NSString)
|
||||
// If this is not the case we fall back on using NSStringPboardType.
|
||||
id plist = [pb propertyListForType:VimPBoardType];
|
||||
if ([plist isKindOfClass:[NSArray class]] && [plist count] == 2) {
|
||||
id obj = [plist objectAtIndex:1];
|
||||
if ([obj isKindOfClass:[NSString class]]) {
|
||||
motion_type = [[plist objectAtIndex:0] intValue];
|
||||
string = obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!string) {
|
||||
// Use NSStringPboardType. The motion type is set to line-wise if the
|
||||
// string contains at least one EOL character, otherwise it is set to
|
||||
// character-wise (block-wise is never used).
|
||||
NSMutableString *mstring =
|
||||
[[pb stringForType:NSStringPboardType] mutableCopy];
|
||||
if (!mstring) return;
|
||||
|
||||
// Replace unrecognized end-of-line sequences with \x0a (line feed).
|
||||
NSRange range = { 0, [string length] };
|
||||
unsigned n = [string replaceOccurrencesOfString:@"\x0d\x0a"
|
||||
NSRange range = { 0, [mstring length] };
|
||||
unsigned n = [mstring replaceOccurrencesOfString:@"\x0d\x0a"
|
||||
withString:@"\x0a" options:0
|
||||
range:range];
|
||||
if (0 == n) {
|
||||
n = [string replaceOccurrencesOfString:@"\x0d" withString:@"\x0a"
|
||||
n = [mstring replaceOccurrencesOfString:@"\x0d" withString:@"\x0a"
|
||||
options:0 range:range];
|
||||
}
|
||||
|
||||
// Scan for newline character to decide whether the string should be
|
||||
// pasted linewise or characterwise.
|
||||
int type = MCHAR;
|
||||
if (0 < n || NSNotFound != [string rangeOfString:@"\n"].location)
|
||||
type = MLINE;
|
||||
// pasted line-wise or character-wise.
|
||||
motion_type = MCHAR;
|
||||
if (0 < n || NSNotFound != [mstring rangeOfString:@"\n"].location)
|
||||
motion_type = MLINE;
|
||||
|
||||
char_u *str = (char_u*)[string UTF8String];
|
||||
int len = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
if (input_conv.vc_type != CONV_NONE)
|
||||
str = string_convert(&input_conv, str, &len);
|
||||
#endif
|
||||
|
||||
if (str)
|
||||
clip_yank_selection(type, str, len, cbd);
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
if (input_conv.vc_type != CONV_NONE)
|
||||
vim_free(str);
|
||||
#endif
|
||||
string = mstring;
|
||||
}
|
||||
|
||||
if (!(MCHAR == motion_type || MLINE == motion_type || MBLOCK == motion_type
|
||||
|| MAUTO == motion_type))
|
||||
motion_type = MCHAR;
|
||||
|
||||
char_u *str = (char_u*)[string UTF8String];
|
||||
int len = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
if (input_conv.vc_type != CONV_NONE)
|
||||
str = string_convert(&input_conv, str, &len);
|
||||
#endif
|
||||
|
||||
if (str)
|
||||
clip_yank_selection(motion_type, str, len, cbd);
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
if (input_conv.vc_type != CONV_NONE)
|
||||
vim_free(str);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -534,8 +565,8 @@ clip_mch_set_selection(VimClipboard *cbd)
|
||||
|
||||
// Get the text to put on the pasteboard.
|
||||
long_u llen = 0; char_u *str = 0;
|
||||
int type = clip_convert_selection(&str, &llen, cbd);
|
||||
if (type < 0)
|
||||
int motion_type = clip_convert_selection(&str, &llen, cbd);
|
||||
if (motion_type < 0)
|
||||
return;
|
||||
|
||||
// TODO: Avoid overflow.
|
||||
@@ -554,9 +585,16 @@ clip_mch_set_selection(VimClipboard *cbd)
|
||||
NSString *string = [[NSString alloc]
|
||||
initWithBytes:str length:len encoding:NSUTF8StringEncoding];
|
||||
|
||||
// See clip_mch_request_selection() for info on pasteboard types.
|
||||
NSPasteboard *pb = [NSPasteboard generalPasteboard];
|
||||
[pb declareTypes:[NSArray arrayWithObject:NSStringPboardType]
|
||||
owner:nil];
|
||||
NSArray *supportedTypes = [NSArray arrayWithObjects:VimPBoardType,
|
||||
NSStringPboardType, nil];
|
||||
[pb declareTypes:supportedTypes owner:nil];
|
||||
|
||||
NSNumber *motion = [NSNumber numberWithInt:motion_type];
|
||||
NSArray *plist = [NSArray arrayWithObjects:motion, string, nil];
|
||||
[pb setPropertyList:plist forType:VimPBoardType];
|
||||
|
||||
[pb setString:string forType:NSStringPboardType];
|
||||
|
||||
[string release];
|
||||
@@ -1478,29 +1516,15 @@ gui_mch_toggle_tearoffs(int enable)
|
||||
static BOOL
|
||||
gui_macvim_is_valid_action(NSString *action)
|
||||
{
|
||||
static NSDictionary *actionDict = nil;
|
||||
|
||||
if (!actionDict) {
|
||||
NSBundle *mainBundle = [NSBundle mainBundle];
|
||||
NSString *path = [mainBundle pathForResource:@"Actions"
|
||||
ofType:@"plist"];
|
||||
if (path) {
|
||||
actionDict = [[NSDictionary alloc] initWithContentsOfFile:path];
|
||||
} else {
|
||||
// Allocate bogus dictionary so that error only pops up once.
|
||||
actionDict = [NSDictionary new];
|
||||
EMSG(_("E???: Failed to load action dictionary"));
|
||||
}
|
||||
}
|
||||
|
||||
return [actionDict objectForKey:action] != nil;
|
||||
NSDictionary *actionDict = [[MMBackend sharedInstance] actionDict];
|
||||
return actionDict && [actionDict objectForKey:action] != nil;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gui_mch_enter_fullscreen()
|
||||
gui_mch_enter_fullscreen(int fuoptions_flags)
|
||||
{
|
||||
[[MMBackend sharedInstance] enterFullscreen];
|
||||
[[MMBackend sharedInstance] enterFullscreen:fuoptions_flags];
|
||||
}
|
||||
|
||||
|
||||
@@ -1542,6 +1566,13 @@ gui_macvim_add_to_find_pboard(char_u *pat)
|
||||
[pb setString:s forType:NSStringPboardType];
|
||||
}
|
||||
|
||||
void
|
||||
gui_macvim_set_antialias(int antialias)
|
||||
{
|
||||
[[MMBackend sharedInstance] setAntialias:antialias];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1827,3 +1858,35 @@ odb_end(void)
|
||||
}
|
||||
|
||||
#endif // FEAT_ODB_EDITOR
|
||||
|
||||
|
||||
char_u *
|
||||
get_macaction_name(expand_T *xp, int idx)
|
||||
{
|
||||
static char_u *str = NULL;
|
||||
NSDictionary *actionDict = [[MMBackend sharedInstance] actionDict];
|
||||
|
||||
if (nil == actionDict || idx < 0 || idx >= [actionDict count])
|
||||
return NULL;
|
||||
|
||||
NSString *string = [[actionDict allKeys] objectAtIndex:idx];
|
||||
if (!string)
|
||||
return NULL;
|
||||
|
||||
char_u *plainStr = (char_u*)[string UTF8String];
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
if (str) {
|
||||
vim_free(str);
|
||||
str = NULL;
|
||||
}
|
||||
if (input_conv.vc_type != CONV_NONE) {
|
||||
int len = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
|
||||
str = string_convert(&input_conv, plainStr, &len);
|
||||
plainStr = str;
|
||||
}
|
||||
#endif
|
||||
|
||||
return plainStr;
|
||||
}
|
||||
|
||||
|
||||
+10
-1
@@ -1,7 +1,7 @@
|
||||
" System gvimrc file for MacVim
|
||||
"
|
||||
" Maintainer: Bjorn Winckler <bjorn.winckler@gmail.com>
|
||||
" Last Change: Thu Mar 6 2008
|
||||
" Last Change: Fri Mar 21 2008
|
||||
"
|
||||
" This is a work in progress. If you feel so inclined, please help me improve
|
||||
" this file.
|
||||
@@ -87,6 +87,11 @@ an 9900.360 Window.-SEP2- <Nop>
|
||||
an <silent> 9900.370 Window.Bring\ All\ To\ Front :maca arrangeInFront:<CR>
|
||||
|
||||
|
||||
" Help menu
|
||||
an 9999.1 Help.MacVim\ Help :h gui_mac<CR>
|
||||
an <silent> 9999.2 Help.MacVim\ Website :maca openWebsite:<CR>
|
||||
an 9999.3 Help.-sep0- <Nop>
|
||||
|
||||
|
||||
"
|
||||
" Toolbar
|
||||
@@ -228,6 +233,10 @@ macmenukey Window.Toggle\ Full\ Screen\ Mode <D-F>
|
||||
macmenukey Window.Previous\ Tab <D-{>
|
||||
macmenukey Window.Next\ Tab <D-}>
|
||||
|
||||
" TODO: <D-?> seems to be reserved by the system on Leopard. Disable this key
|
||||
" equivalent until I can figure out what to do about it.
|
||||
"macmenukey Help.MacVim\ Help <D-?>
|
||||
|
||||
|
||||
" Restore the previous value of 'cpoptions'.
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
@@ -40,6 +40,47 @@
|
||||
Sparkle supports updates in zip, tar, tbz, tgz, or dmg format.
|
||||
-->
|
||||
|
||||
<item>
|
||||
<title>Snapshot 25 released</title>
|
||||
<description><![CDATA[
|
||||
<h1>MacVim snapshot 25 released</h1>
|
||||
|
||||
<p> This snapshot adds support for two new options: 'antialias' and
|
||||
'fuoptions'. The former lets you turn text antialiasing on or off (it's
|
||||
on by default), the latter can be used to make the view maximize when
|
||||
full-screen is entered. See the built-in help for more information (:h
|
||||
'anti' and :h 'fuopt'). </p>
|
||||
|
||||
<p> Another minor addition is that <C-c> and <C-v> work with
|
||||
block-wise selections (do note that <C-v> behaves like "P", not "p").
|
||||
Also, <D-w> now works in ex-mode and in a command-line window. </p>
|
||||
|
||||
<p> Here is the list of changes since snapshot 24:
|
||||
<ul>
|
||||
<li> support 'antialias' option (Jjgod Jiang) </li>
|
||||
<li> add option 'fuoptions' to control resizing when full-screen is entered
|
||||
(Nico Weber) </li>
|
||||
<li> fixed bug where transparency setting was lost after leaving full-screen
|
||||
(Nico Weber) </li>
|
||||
<li> help menu contains MacVim help and website link </li>
|
||||
<li> <D-w> now works in ex-mode and in command-line window </li>
|
||||
<li> :macaction command supports command-line completion (Nico Weber) </li>
|
||||
<li> copy/paste respects block selections (requested by George Harker) </li>
|
||||
<li> window no longer cascades from preferences panel </li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
]]></description>
|
||||
<pubDate>Fri, 06 Apr 2008 19:11 CET</pubDate>
|
||||
<enclosure type="application/octet-stream"
|
||||
url="http://macvim.googlecode.com/files/MacVim-snapshot-25.tbz"
|
||||
length="8042440"
|
||||
sparkle:version="25"
|
||||
sparkle:shortVersionString="7.1"
|
||||
/>
|
||||
</item>
|
||||
|
||||
|
||||
<item>
|
||||
<title>Snapshot 24 released</title>
|
||||
<description><![CDATA[
|
||||
|
||||
+18
-12
@@ -1,6 +1,7 @@
|
||||
# Makefile for Vim on Win32 (Windows NT/2000/XP/2003 and Windows 95/98/Me)
|
||||
# and Win64, using the Microsoft Visual C++ compilers. Known to work with
|
||||
# VC5, VC6 (VS98), VC7.0 (VS2002), VC7.1 (VS2003), and VC8 (VS2005).
|
||||
# VC5, VC6 (VS98), VC7.0 (VS2002), VC7.1 (VS2003), VC8 (VS2005),
|
||||
# and VC9 (VS2008).
|
||||
#
|
||||
# To build using other Windows compilers, see INSTALLpc.txt
|
||||
#
|
||||
@@ -285,7 +286,8 @@ XPM_INC = -I $(XPM)\include
|
||||
# need shell32.lib for ExtractIcon()
|
||||
# gdi32.lib and comdlg32.lib for printing support
|
||||
# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
|
||||
CON_LIB = advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib
|
||||
CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \
|
||||
comdlg32.lib ole32.lib uuid.lib /machine:$(CPU) /nodefaultlib
|
||||
!if "$(DELAYLOAD)" == "yes"
|
||||
CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
|
||||
!endif
|
||||
@@ -331,6 +333,7 @@ MSVCVER = 5.0
|
||||
!endif
|
||||
!if "$(_NMAKE_VER)" == "6.00.8168.0"
|
||||
MSVCVER = 6.0
|
||||
CPU = ix86
|
||||
!endif
|
||||
!if "$(_NMAKE_VER)" == "7.00.9466"
|
||||
MSVCVER = 7.0
|
||||
@@ -344,6 +347,9 @@ MSVCVER = 8.0
|
||||
!if "$(_NMAKE_VER)" == "8.00.50727.762"
|
||||
MSVCVER = 8.0
|
||||
!endif
|
||||
!if "$(_NMAKE_VER)" == "9.00.20706.01"
|
||||
MSVCVER = 9.0
|
||||
!endif
|
||||
!endif
|
||||
|
||||
# Abort bulding VIM if version of VC is unrecognised.
|
||||
@@ -352,13 +358,13 @@ MSVCVER = 8.0
|
||||
!message Cannot determine Visual C version being used. If you are using the
|
||||
!message Windows SDK then you must have the environment variable MSVCVER set to
|
||||
!message your version of the VC compiler. If you are not using the Express
|
||||
!message version of Visual C you van either set MSVCVER or update this makefile
|
||||
!message to handle the new value for _NMAKE_VER.
|
||||
!message version of Visual C, you can either set MSVCVER or update this makefile
|
||||
!message to handle the new value for _NMAKE_VER, "$(_NMAKE_VER)".
|
||||
!error Make aborted.
|
||||
!endif
|
||||
|
||||
# Convert processor ID to MVC-compatible number
|
||||
!if "$(MSVCVER)" != "8.0"
|
||||
!if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0")
|
||||
!if "$(CPUNR)" == "i386"
|
||||
CPUARG = /G3
|
||||
!elseif "$(CPUNR)" == "i486"
|
||||
@@ -373,7 +379,7 @@ CPUARG = /G7 /arch:SSE2
|
||||
CPUARG =
|
||||
!endif
|
||||
!else
|
||||
# VC8 only allows specifying SSE architecture
|
||||
# VC8/9 only allows specifying SSE architecture
|
||||
!if "$(CPUNR)" == "pentium4"
|
||||
CPUARG = /arch:SSE2
|
||||
!endif
|
||||
@@ -391,7 +397,7 @@ OPTFLAG = /O2
|
||||
!else # MAXSPEED
|
||||
OPTFLAG = /Ox
|
||||
!endif
|
||||
!if "$(MSVCVER)" == "8.0"
|
||||
!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0")
|
||||
# Use link time code generation if not worried about size
|
||||
!if "$(OPTIMIZE)" != "SPACE"
|
||||
OPTFLAG = $(OPTFLAG) /GL
|
||||
@@ -404,11 +410,11 @@ CFLAGS = $(CFLAGS) /MD
|
||||
LIBC = msvcrt.lib
|
||||
! else
|
||||
LIBC = libcmt.lib
|
||||
CFLAGS = $(CFLAGS) /MT
|
||||
CFLAGS = $(CFLAGS) /Zl /MT
|
||||
! endif
|
||||
!else # DEBUG
|
||||
VIM = vimd
|
||||
! if "$(CPU)" == "i386"
|
||||
! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86")
|
||||
DEBUGINFO = /ZI
|
||||
! endif
|
||||
CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
|
||||
@@ -424,7 +430,7 @@ CFLAGS = $(CFLAGS) /MDd
|
||||
LIBC = $(LIBC) msvcrtd.lib
|
||||
! else
|
||||
LIBC = $(LIBC) libcmtd.lib
|
||||
CFLAGS = $(CFLAGS) /MTd
|
||||
CFLAGS = $(CFLAGS) /Zl /MTd
|
||||
! endif
|
||||
!endif # DEBUG
|
||||
|
||||
@@ -534,7 +540,7 @@ GUI_OBJ = \
|
||||
$(OUTDIR)\gui_w32.obj \
|
||||
$(OUTDIR)\os_w32exe.obj
|
||||
GUI_LIB = \
|
||||
oldnames.lib kernel32.lib gdi32.lib version.lib $(IME_LIB) \
|
||||
gdi32.lib version.lib $(IME_LIB) \
|
||||
winspool.lib comctl32.lib advapi32.lib shell32.lib \
|
||||
/machine:$(CPU) /nodefaultlib
|
||||
!else
|
||||
@@ -757,7 +763,7 @@ LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
|
||||
|
||||
# Report link time code generation progress if used.
|
||||
!ifdef NODEBUG
|
||||
!if "$(MSVCVER)" == "8.0"
|
||||
!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0")
|
||||
!if "$(OPTIMIZE)" != "SPACE"
|
||||
LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
|
||||
!endif
|
||||
|
||||
+1
-1
@@ -545,7 +545,7 @@ LINT_OPTIONS = -beprxzF
|
||||
# For unknown reasons adding "-lc" fixes a linking problem with GCC. That's
|
||||
# probably a bug in the "-pg" implementation.
|
||||
# Need to recompile everything after changing this: "make clean" "make".
|
||||
#PROFILE_CFLAGS = -pg -g
|
||||
#PROFILE_CFLAGS = -pg -g -DWE_ARE_PROFILING
|
||||
#PROFILE_LIBS = -pg
|
||||
#PROFILE_LIBS = -pg -lc
|
||||
|
||||
|
||||
+4
-3
@@ -4922,7 +4922,7 @@ chk_modeline(lnum, flags)
|
||||
return retval;
|
||||
}
|
||||
|
||||
#ifdef FEAT_VIMINFO
|
||||
#if defined(FEAT_VIMINFO) || defined(PROTO)
|
||||
int
|
||||
read_viminfo_bufferlist(virp, writing)
|
||||
vir_T *virp;
|
||||
@@ -5043,13 +5043,14 @@ buf_spname(buf)
|
||||
#if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
|
||||
if (bt_quickfix(buf))
|
||||
{
|
||||
win_T *win;
|
||||
win_T *win = NULL;
|
||||
tabpage_T *tp;
|
||||
|
||||
/*
|
||||
* For location list window, w_llist_ref points to the location list.
|
||||
* For quickfix window, w_llist_ref is NULL.
|
||||
*/
|
||||
FOR_ALL_WINDOWS(win)
|
||||
FOR_ALL_TAB_WINDOWS(tp, win)
|
||||
if (win->w_buffer == buf)
|
||||
break;
|
||||
if (win != NULL && win->w_llist_ref != NULL)
|
||||
|
||||
+1
-1
@@ -1365,7 +1365,7 @@ install_registry(void)
|
||||
|
||||
printf("Creating \"Edit with Vim\" popup menu entry\n");
|
||||
|
||||
fprintf(fd, "HKEY_CLASSES_ROOT\\CLSID\\%s\n", vim_ext_clsid);
|
||||
fprintf(fd, "[HKEY_CLASSES_ROOT\\CLSID\\%s]\n", vim_ext_clsid);
|
||||
fprintf(fd, "@=\"%s\"\n", vim_ext_name);
|
||||
fprintf(fd, "[HKEY_CLASSES_ROOT\\CLSID\\%s\\InProcServer32]\n",
|
||||
vim_ext_clsid);
|
||||
|
||||
+2
-2
@@ -5491,7 +5491,7 @@ insertchar(c, flags, second_indent)
|
||||
#if defined(FEAT_EVAL)
|
||||
int do_internal = TRUE;
|
||||
|
||||
if (*curbuf->b_p_fex != NUL)
|
||||
if (*curbuf->b_p_fex != NUL && (flags & INSCHAR_NO_FEX) == 0)
|
||||
{
|
||||
do_internal = (fex_format(curwin->w_cursor.lnum, 1L, c) != 0);
|
||||
/* It may be required to save for undo again, e.g. when setline()
|
||||
@@ -6057,7 +6057,7 @@ auto_format(trailblank, prev_line)
|
||||
* be adjusted for the text formatting.
|
||||
*/
|
||||
saved_cursor = pos;
|
||||
format_lines((linenr_T)-1);
|
||||
format_lines((linenr_T)-1, FALSE);
|
||||
curwin->w_cursor = saved_cursor;
|
||||
saved_cursor.lnum = 0;
|
||||
|
||||
|
||||
+4
-1
@@ -13974,6 +13974,7 @@ f_reverse(argvars, rettv)
|
||||
rettv->vval.v_list = l;
|
||||
rettv->v_type = VAR_LIST;
|
||||
++l->lv_refcount;
|
||||
l->lv_idx = l->lv_len - l->lv_idx - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14682,6 +14683,8 @@ f_setline(argvars, rettv)
|
||||
appended_lines_mark(lcount, added);
|
||||
}
|
||||
|
||||
static void set_qf_ll_list __ARGS((win_T *wp, typval_T *list_arg, typval_T *action_arg, typval_T *rettv));
|
||||
|
||||
/*
|
||||
* Used by "setqflist()" and "setloclist()" functions
|
||||
*/
|
||||
@@ -15220,7 +15223,7 @@ f_sort(argvars, rettv)
|
||||
if (!item_compare_func_err)
|
||||
{
|
||||
/* Clear the List and append the items in the sorted order. */
|
||||
l->lv_first = l->lv_last = NULL;
|
||||
l->lv_first = l->lv_last = l->lv_idx_item = NULL;
|
||||
l->lv_len = 0;
|
||||
for (i = 0; i < len; ++i)
|
||||
list_append(l, ptrs[i]);
|
||||
|
||||
+11
-5
@@ -3015,7 +3015,7 @@ modifier_len(cmd)
|
||||
break;
|
||||
if (!isalpha(p[j]) && j >= cmdmods[i].minlen
|
||||
&& (p == cmd || cmdmods[i].has_count))
|
||||
return j + (p - cmd);
|
||||
return j + (int)(p - cmd);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -3792,6 +3792,14 @@ set_one_cmd_context(xp, buff)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
case CMD_macaction:
|
||||
xp->xp_context = EXPAND_MACACTION;
|
||||
xp->xp_pattern = arg;
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* FEAT_CMDL_COMPL */
|
||||
|
||||
default:
|
||||
@@ -3941,8 +3949,7 @@ get_address(ptr, skip, to_other_file)
|
||||
curwin->w_cursor.col = 0;
|
||||
searchcmdlen = 0;
|
||||
if (!do_search(NULL, c, cmd, 1L,
|
||||
SEARCH_HIS + SEARCH_MSG + SEARCH_START,
|
||||
NULL))
|
||||
SEARCH_HIS | SEARCH_MSG, NULL))
|
||||
{
|
||||
curwin->w_cursor = pos;
|
||||
cmd = NULL;
|
||||
@@ -3989,8 +3996,7 @@ get_address(ptr, skip, to_other_file)
|
||||
pos.col = 0;
|
||||
if (searchit(curwin, curbuf, &pos,
|
||||
*cmd == '?' ? BACKWARD : FORWARD,
|
||||
(char_u *)"", 1L,
|
||||
SEARCH_MSG + SEARCH_START,
|
||||
(char_u *)"", 1L, SEARCH_MSG,
|
||||
i, (linenr_T)0, NULL) != FAIL)
|
||||
lnum = pos.lnum;
|
||||
else
|
||||
|
||||
@@ -4449,6 +4449,9 @@ ExpandFromContext(xp, pat, num_file, file, options)
|
||||
{EXPAND_LANGUAGE, get_lang_arg, TRUE},
|
||||
#endif
|
||||
{EXPAND_ENV_VARS, get_env_name, TRUE},
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
{EXPAND_MACACTION, get_macaction_name, FALSE},
|
||||
#endif
|
||||
};
|
||||
int i;
|
||||
|
||||
|
||||
@@ -1296,3 +1296,10 @@
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
#define FEAT_GUI_SCROLL_WHEEL_FORCE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Support for enabling/disabling antialiased text.
|
||||
*/
|
||||
#if defined(FEAT_GUI) && defined(MACOS_X)
|
||||
#define FEAT_ANTIALIAS
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -9244,7 +9244,7 @@ aucmd_prepbuf(aco, buf)
|
||||
aco_save_T *aco; /* structure to save values in */
|
||||
buf_T *buf; /* new curbuf */
|
||||
{
|
||||
aco->save_buf = buf;
|
||||
aco->save_buf = curbuf;
|
||||
curbuf = buf;
|
||||
curwin->w_buffer = buf;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1263,7 +1263,7 @@ EXTERN int echo_wid_arg INIT(= FALSE); /* --echo-wid argument */
|
||||
* The value of the --windowid argument.
|
||||
* For embedding gvim inside another application.
|
||||
*/
|
||||
EXTERN int win_socket_id INIT(= 0);
|
||||
EXTERN long_u win_socket_id INIT(= 0);
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL)
|
||||
|
||||
@@ -495,7 +495,7 @@ typedef struct Gui
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_GUI_SCROLL_WHEEL_FORCE
|
||||
int scroll_wheel_force;
|
||||
int scroll_wheel_force;
|
||||
#endif
|
||||
} gui_T;
|
||||
|
||||
|
||||
+667
-231
File diff suppressed because it is too large
Load Diff
+95
-16
@@ -1400,7 +1400,7 @@ cs_lookup_cmd(eap)
|
||||
return NULL;
|
||||
|
||||
/* Store length of eap->arg before it gets modified by strtok(). */
|
||||
eap_arg_len = STRLEN(eap->arg);
|
||||
eap_arg_len = (int)STRLEN(eap->arg);
|
||||
|
||||
if ((stok = strtok((char *)(eap->arg), (const char *)" ")) == NULL)
|
||||
return NULL;
|
||||
@@ -2096,6 +2096,18 @@ cs_read_prompt(i)
|
||||
return CSCOPE_SUCCESS;
|
||||
}
|
||||
|
||||
#if defined(UNIX) && defined(SIGALRM)
|
||||
/*
|
||||
* Used to catch and ignore SIGALRM below.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static RETSIGTYPE
|
||||
sig_handler SIGDEFARG(sigarg)
|
||||
{
|
||||
/* do nothing */
|
||||
SIGRETURN;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* PRIVATE: cs_release_csp
|
||||
@@ -2108,9 +2120,6 @@ cs_release_csp(i, freefnpp)
|
||||
int i;
|
||||
int freefnpp;
|
||||
{
|
||||
#if defined(UNIX)
|
||||
int pstat;
|
||||
#else
|
||||
/*
|
||||
* Trying to exit normally (not sure whether it is fit to UNIX cscope
|
||||
*/
|
||||
@@ -2119,6 +2128,88 @@ cs_release_csp(i, freefnpp)
|
||||
(void)fputs("q\n", csinfo[i].to_fp);
|
||||
(void)fflush(csinfo[i].to_fp);
|
||||
}
|
||||
#if defined(UNIX)
|
||||
{
|
||||
int waitpid_errno;
|
||||
int pstat;
|
||||
pid_t pid;
|
||||
|
||||
# if defined(HAVE_SIGACTION)
|
||||
struct sigaction sa, old;
|
||||
|
||||
/* Use sigaction() to limit the waiting time to two seconds. */
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_handler = sig_handler;
|
||||
sa.sa_flags = SA_NODEFER;
|
||||
sigaction(SIGALRM, &sa, &old);
|
||||
alarm(2); /* 2 sec timeout */
|
||||
|
||||
/* Block until cscope exits or until timer expires */
|
||||
pid = waitpid(csinfo[i].pid, &pstat, 0);
|
||||
waitpid_errno = errno;
|
||||
|
||||
/* cancel pending alarm if still there and restore signal */
|
||||
alarm(0);
|
||||
sigaction(SIGALRM, &old, NULL);
|
||||
# else
|
||||
int waited;
|
||||
|
||||
/* Can't use sigaction(), loop for two seconds. First yield the CPU
|
||||
* to give cscope a chance to exit quickly. */
|
||||
sleep(0);
|
||||
for (waited = 0; waited < 40; ++waited)
|
||||
{
|
||||
pid = waitpid(csinfo[i].pid, &pstat, WNOHANG);
|
||||
waitpid_errno = errno;
|
||||
if (pid != 0)
|
||||
break; /* break unless the process is still running */
|
||||
mch_delay(50L, FALSE); /* sleep 50 ms */
|
||||
}
|
||||
# endif
|
||||
/*
|
||||
* If the cscope process is still running: kill it.
|
||||
* Safety check: If the PID would be zero here, the entire X session
|
||||
* would be killed. -1 and 1 are dangerous as well.
|
||||
*/
|
||||
if (pid < 0 && csinfo[i].pid > 1)
|
||||
{
|
||||
# ifdef ECHILD
|
||||
int alive = TRUE;
|
||||
|
||||
if (waitpid_errno == ECHILD)
|
||||
{
|
||||
/*
|
||||
* When using 'vim -g', vim is forked and cscope process is
|
||||
* no longer a child process but a sibling. So waitpid()
|
||||
* fails with errno being ECHILD (No child processes).
|
||||
* Don't send SIGKILL to cscope immediately but wait
|
||||
* (polling) for it to exit normally as result of sending
|
||||
* the "q" command, hence giving it a chance to clean up
|
||||
* its temporary files.
|
||||
*/
|
||||
int waited;
|
||||
|
||||
sleep(0);
|
||||
for (waited = 0; waited < 40; ++waited)
|
||||
{
|
||||
/* Check whether cscope process is still alive */
|
||||
if (kill(csinfo[i].pid, 0) != 0)
|
||||
{
|
||||
alive = FALSE; /* cscope process no longer exists */
|
||||
break;
|
||||
}
|
||||
mch_delay(50L, FALSE); /* sleep 50ms */
|
||||
}
|
||||
}
|
||||
if (alive)
|
||||
# endif
|
||||
{
|
||||
kill(csinfo[i].pid, SIGKILL);
|
||||
(void)waitpid(csinfo[i].pid, &pstat, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else /* !UNIX */
|
||||
if (csinfo[i].hProc != NULL)
|
||||
{
|
||||
/* Give cscope a chance to exit normally */
|
||||
@@ -2133,18 +2224,6 @@ cs_release_csp(i, freefnpp)
|
||||
if (csinfo[i].to_fp != NULL)
|
||||
(void)fclose(csinfo[i].to_fp);
|
||||
|
||||
/*
|
||||
* Safety check: If the PID would be zero here, the entire X session would
|
||||
* be killed. -1 and 1 are dangerous as well.
|
||||
*/
|
||||
#if defined(UNIX)
|
||||
if (csinfo[i].pid > 1)
|
||||
{
|
||||
kill(csinfo[i].pid, SIGTERM);
|
||||
(void)waitpid(csinfo[i].pid, &pstat, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (freefnpp)
|
||||
{
|
||||
vim_free(csinfo[i].fname);
|
||||
|
||||
+9
-3
@@ -34,6 +34,12 @@ extern HWND s_hwnd;
|
||||
extern HWND vim_parent_hwnd;
|
||||
}
|
||||
|
||||
#if _MSC_VER < 1300
|
||||
/* Work around old versions of basetsd.h which wrongly declares
|
||||
* UINT_PTR as unsigned long */
|
||||
# define UINT_PTR UINT
|
||||
#endif
|
||||
|
||||
#include "if_ole.h" // Interface definitions
|
||||
#include "iid_ole.c" // UUID definitions (compile here)
|
||||
|
||||
@@ -107,7 +113,7 @@ public:
|
||||
STDMETHOD(SendKeys)(BSTR keys);
|
||||
STDMETHOD(Eval)(BSTR expr, BSTR *result);
|
||||
STDMETHOD(SetForeground)(void);
|
||||
STDMETHOD(GetHwnd)(UINT *result);
|
||||
STDMETHOD(GetHwnd)(UINT_PTR *result);
|
||||
|
||||
private:
|
||||
// Constructor is private - create using CVim::Create()
|
||||
@@ -288,9 +294,9 @@ CVim::Invoke(
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
CVim::GetHwnd(UINT *result)
|
||||
CVim::GetHwnd(UINT_PTR *result)
|
||||
{
|
||||
*result = (UINT) s_hwnd;
|
||||
*result = (UINT_PTR)s_hwnd;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -79,7 +79,7 @@ EXTERN_C const IID IID_IVim;
|
||||
virtual HRESULT STDMETHODCALLTYPE SetForeground( void) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetHwnd(
|
||||
/* [retval][out] */ UINT __RPC_FAR *result) = 0;
|
||||
/* [retval][out] */ UINT_PTR __RPC_FAR *result) = 0;
|
||||
|
||||
};
|
||||
|
||||
@@ -143,7 +143,7 @@ EXTERN_C const IID IID_IVim;
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetHwnd )(
|
||||
IVim __RPC_FAR * This,
|
||||
/* [retval][out] */ UINT __RPC_FAR *result);
|
||||
/* [retval][out] */ UINT_PTR __RPC_FAR *result);
|
||||
|
||||
END_INTERFACE
|
||||
} IVimVtbl;
|
||||
@@ -236,7 +236,7 @@ void __RPC_STUB IVim_SetForeground_Stub(
|
||||
|
||||
HRESULT STDMETHODCALLTYPE IVim_GetHwnd_Proxy(
|
||||
IVim __RPC_FAR * This,
|
||||
/* [retval][out] */ UINT __RPC_FAR *result);
|
||||
/* [retval][out] */ UINT_PTR __RPC_FAR *result);
|
||||
|
||||
|
||||
void __RPC_STUB IVim_GetHwnd_Stub(
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ interface IVim : IDispatch
|
||||
HRESULT SendKeys([in]BSTR keys);
|
||||
HRESULT Eval([in]BSTR expr, [out, retval]BSTR* result);
|
||||
HRESULT SetForeground(void);
|
||||
HRESULT GetHwnd([out, retval]UINT* result);
|
||||
HRESULT GetHwnd([out, retval]UINT_PTR* result);
|
||||
};
|
||||
|
||||
// Component and type library definitions
|
||||
|
||||
+4
-4
@@ -1605,15 +1605,15 @@ early_arg_scan(parmp)
|
||||
else if (STRICMP(argv[i], "--socketid") == 0)
|
||||
# endif
|
||||
{
|
||||
unsigned int id;
|
||||
int count;
|
||||
long_u id;
|
||||
int count;
|
||||
|
||||
if (i == argc - 1)
|
||||
mainerr_arg_missing((char_u *)argv[i]);
|
||||
if (STRNICMP(argv[i+1], "0x", 2) == 0)
|
||||
count = sscanf(&(argv[i + 1][2]), "%x", &id);
|
||||
count = sscanf(&(argv[i + 1][2]), SCANF_HEX_LONG_U, &id);
|
||||
else
|
||||
count = sscanf(argv[i+1], "%u", &id);
|
||||
count = sscanf(argv[i + 1], SCANF_DECIMAL_LONG_U, &id);
|
||||
if (count != 1)
|
||||
mainerr(ME_INVALID_ARG, (char_u *)argv[i]);
|
||||
else
|
||||
|
||||
+1
-1
@@ -522,7 +522,7 @@ fname2fnum(fm)
|
||||
int len;
|
||||
|
||||
expand_env((char_u *)"~/", NameBuff, MAXPATHL);
|
||||
len = STRLEN(NameBuff);
|
||||
len = (int)STRLEN(NameBuff);
|
||||
vim_strncpy(NameBuff + len, fm->fname + 2, MAXPATHL - len - 1);
|
||||
}
|
||||
else
|
||||
|
||||
+6
-2
@@ -751,7 +751,7 @@ vim_mem_profile_dump()
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Note: if unsinged is 16 bits we can only allocate up to 64K with alloc().
|
||||
* Note: if unsigned is 16 bits we can only allocate up to 64K with alloc().
|
||||
* Use lalloc for larger blocks.
|
||||
*/
|
||||
char_u *
|
||||
@@ -1082,7 +1082,11 @@ free_all_mem()
|
||||
win_free_all();
|
||||
#endif
|
||||
|
||||
/* Free all buffers. */
|
||||
/* Free all buffers. Reset 'autochdir' to avoid accessing things that
|
||||
* were freed already. */
|
||||
#ifdef FEAT_AUTOCHDIR
|
||||
p_acd = FALSE;
|
||||
#endif
|
||||
for (buf = firstbuf; buf != NULL; )
|
||||
{
|
||||
nextbuf = buf->b_next;
|
||||
|
||||
+3
-3
@@ -1216,7 +1216,7 @@ nb_partialremove(linenr_T lnum, colnr_T first, colnr_T last)
|
||||
int lastbyte = last;
|
||||
|
||||
oldtext = ml_get(lnum);
|
||||
oldlen = STRLEN(oldtext);
|
||||
oldlen = (int)STRLEN(oldtext);
|
||||
if (first >= (colnr_T)oldlen || oldlen == 0) /* just in case */
|
||||
return;
|
||||
if (lastbyte >= oldlen)
|
||||
@@ -1241,8 +1241,8 @@ nb_joinlines(linenr_T first, linenr_T other)
|
||||
int len_first, len_other;
|
||||
char_u *p;
|
||||
|
||||
len_first = STRLEN(ml_get(first));
|
||||
len_other = STRLEN(ml_get(other));
|
||||
len_first = (int)STRLEN(ml_get(first));
|
||||
len_other = (int)STRLEN(ml_get(other));
|
||||
p = alloc((unsigned)(len_first + len_other + 1));
|
||||
if (p != NULL)
|
||||
{
|
||||
|
||||
+4
-2
@@ -8364,6 +8364,7 @@ nv_wordcmd(cap)
|
||||
int n;
|
||||
int word_end;
|
||||
int flag = FALSE;
|
||||
pos_T startpos = curwin->w_cursor;
|
||||
|
||||
/*
|
||||
* Set inclusive for the "E" and "e" command.
|
||||
@@ -8424,8 +8425,9 @@ nv_wordcmd(cap)
|
||||
else
|
||||
n = fwd_word(cap->count1, cap->arg, cap->oap->op_type != OP_NOP);
|
||||
|
||||
/* Don't leave the cursor on the NUL past the end of line. */
|
||||
if (n != FAIL)
|
||||
/* Don't leave the cursor on the NUL past the end of line. Unless we
|
||||
* didn't move it forward. */
|
||||
if (lt(startpos, curwin->w_cursor))
|
||||
adjust_cursor(cap->oap);
|
||||
|
||||
if (n == FAIL && cap->oap->op_type == OP_NOP)
|
||||
|
||||
@@ -4380,7 +4380,7 @@ op_format(oap, keep_cursor)
|
||||
if (keep_cursor)
|
||||
saved_cursor = oap->cursor_start;
|
||||
|
||||
format_lines(oap->line_count);
|
||||
format_lines(oap->line_count, keep_cursor);
|
||||
|
||||
/*
|
||||
* Leave the cursor at the first non-blank of the last formatted line.
|
||||
@@ -4495,8 +4495,9 @@ fex_format(lnum, count, c)
|
||||
* first line.
|
||||
*/
|
||||
void
|
||||
format_lines(line_count)
|
||||
format_lines(line_count, avoid_fex)
|
||||
linenr_T line_count;
|
||||
int avoid_fex; /* don't use 'formatexpr' */
|
||||
{
|
||||
int max_len;
|
||||
int is_not_par; /* current line not part of parag. */
|
||||
@@ -4666,7 +4667,7 @@ format_lines(line_count)
|
||||
#ifdef FEAT_COMMENTS
|
||||
+ (do_comments ? INSCHAR_DO_COM : 0)
|
||||
#endif
|
||||
, second_indent);
|
||||
+ (avoid_fex ? INSCHAR_NO_FEX : 0), second_indent);
|
||||
State = old_State;
|
||||
p_smd = smd_save;
|
||||
second_indent = -1;
|
||||
|
||||
+44
-6
@@ -478,14 +478,16 @@ static struct vimoption
|
||||
#endif
|
||||
(char_u *)0L}},
|
||||
{"antialias", "anti", P_BOOL|P_VI_DEF|P_VIM|P_RCLR,
|
||||
#if defined(FEAT_GUI) && defined(MACOS_X)
|
||||
#ifdef FEAT_ANTIALIAS
|
||||
(char_u *)&p_antialias, PV_NONE,
|
||||
{(char_u *)FALSE, (char_u *)FALSE}
|
||||
#else
|
||||
(char_u *)NULL, PV_NONE,
|
||||
{(char_u *)FALSE, (char_u *)FALSE}
|
||||
#endif
|
||||
},
|
||||
#if FEAT_GUI_MACVIM
|
||||
{(char_u *)TRUE, (char_u *)0L}},
|
||||
#else
|
||||
{(char_u *)FALSE, (char_u *)0L}},
|
||||
#endif
|
||||
{"arabic", "arab", P_BOOL|P_VI_DEF|P_VIM,
|
||||
#ifdef FEAT_ARABIC
|
||||
(char_u *)VAR_WIN, PV_ARAB,
|
||||
@@ -1159,6 +1161,14 @@ static struct vimoption
|
||||
(char_u *)NULL, PV_NONE,
|
||||
#endif
|
||||
{(char_u *)FALSE, (char_u *)0L}},
|
||||
{"fuoptions", "fuopt", P_STRING|P_COMMA|P_NODUP|P_VI_DEF,
|
||||
#ifdef FEAT_FULLSCREEN
|
||||
(char_u *)&p_fuoptions, PV_NONE,
|
||||
{(char_u *)"maxvert", (char_u *)0L}},
|
||||
#else
|
||||
(char_u *)NULL, PV_NONE,
|
||||
{(char_u *)NULL, (char_u *)0L}},
|
||||
#endif
|
||||
{"gdefault", "gd", P_BOOL|P_VI_DEF|P_VIM,
|
||||
(char_u *)&p_gd, PV_NONE,
|
||||
{(char_u *)FALSE, (char_u *)0L}},
|
||||
@@ -1846,7 +1856,8 @@ static struct vimoption
|
||||
},
|
||||
{"paragraphs", "para", P_STRING|P_VI_DEF,
|
||||
(char_u *)&p_para, PV_NONE,
|
||||
{(char_u *)"IPLPPPQPP LIpplpipbp", (char_u *)0L}},
|
||||
{(char_u *)"IPLPPPQPP TPHPLIPpLpItpplpipbp",
|
||||
(char_u *)0L}},
|
||||
{"paste", NULL, P_BOOL|P_VI_DEF|P_PRI_MKRC,
|
||||
(char_u *)&p_paste, PV_NONE,
|
||||
{(char_u *)FALSE, (char_u *)0L}},
|
||||
@@ -5068,6 +5079,12 @@ didset_options()
|
||||
#ifdef FEAT_FOLDING
|
||||
(void)opt_strings_flags(p_fdo, p_fdo_values, &fdo_flags, TRUE);
|
||||
#endif
|
||||
#ifdef FEAT_FULLSCREEN
|
||||
(void)opt_strings_flags(p_fuoptions, p_fuoptions_values, &fuoptions_flags,
|
||||
TRUE);
|
||||
|
||||
(void)opt_strings_flags(p_fdo, p_fdo_values, &fdo_flags, TRUE);
|
||||
#endif
|
||||
(void)opt_strings_flags(p_dy, p_dy_values, &dy_flags, TRUE);
|
||||
#ifdef FEAT_VIRTUALEDIT
|
||||
(void)opt_strings_flags(p_ve, p_ve_values, &ve_flags, TRUE);
|
||||
@@ -6590,6 +6607,16 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_FULLSCREEN
|
||||
/* 'fuoptions' */
|
||||
else if (varp == &p_fuoptions)
|
||||
{
|
||||
if (opt_strings_flags(p_fuoptions, p_fuoptions_values,
|
||||
&fuoptions_flags, TRUE) != OK)
|
||||
errmsg = e_invarg;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_VIRTUALEDIT
|
||||
/* 'virtualedit' */
|
||||
else if (varp == &p_ve)
|
||||
@@ -7302,9 +7329,20 @@ set_bool_option(opt_idx, varp, value, opt_flags)
|
||||
else if ((int *)varp == &p_fullscreen && gui.in_use)
|
||||
{
|
||||
if (p_fullscreen && !old_value)
|
||||
gui_mch_enter_fullscreen();
|
||||
{
|
||||
gui_mch_enter_fullscreen(fuoptions_flags);
|
||||
}
|
||||
else if (!p_fullscreen && old_value)
|
||||
{
|
||||
gui_mch_leave_fullscreen();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_ANTIALIAS) && defined(FEAT_GUI_MACVIM)
|
||||
else if ((int *)varp == &p_antialias && gui.in_use)
|
||||
{
|
||||
gui_macvim_set_antialias(p_antialias);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+9
-2
@@ -309,8 +309,8 @@ EXTERN int p_acd; /* 'autochdir' */
|
||||
#ifdef FEAT_MBYTE
|
||||
EXTERN char_u *p_ambw; /* 'ambiwidth' */
|
||||
#endif
|
||||
#if defined(FEAT_GUI) && defined(MACOS_X)
|
||||
EXTERN int *p_antialias; /* 'antialias' */
|
||||
#ifdef FEAT_ANTIALIAS
|
||||
EXTERN int p_antialias; /* 'antialias' */
|
||||
#endif
|
||||
EXTERN int p_ar; /* 'autoread' */
|
||||
EXTERN int p_aw; /* 'autowrite' */
|
||||
@@ -470,6 +470,13 @@ EXTERN int p_fs; /* 'fsync' */
|
||||
#endif
|
||||
#ifdef FEAT_FULLSCREEN
|
||||
EXTERN int p_fullscreen;
|
||||
EXTERN char_u *p_fuoptions;
|
||||
EXTERN unsigned fuoptions_flags;
|
||||
#ifdef IN_OPTION_C
|
||||
static char *(p_fuoptions_values[]) = {"maxvert", "maxhorz", NULL};
|
||||
#endif
|
||||
#define FUOPT_MAXVERT 0x001
|
||||
#define FUOPT_MAXHORZ 0x002
|
||||
#endif
|
||||
EXTERN int p_gd; /* 'gdefault' */
|
||||
#ifdef FEAT_PRINTER
|
||||
|
||||
+3
-2
@@ -269,8 +269,9 @@ static struct signalinfo
|
||||
#ifdef SIGVTALRM
|
||||
{SIGVTALRM, "VTALRM", TRUE},
|
||||
#endif
|
||||
#if defined(SIGPROF) && !defined(FEAT_MZSCHEME)
|
||||
/* MzScheme uses SIGPROF for its own needs */
|
||||
#if defined(SIGPROF) && !defined(FEAT_MZSCHEME) && !defined(WE_ARE_PROFILING)
|
||||
/* MzScheme uses SIGPROF for its own needs; On Linux with profiling
|
||||
* this makes Vim exit. WE_ARE_PROFILING is defined in Makefile. */
|
||||
{SIGPROF, "PROF", TRUE},
|
||||
#endif
|
||||
#ifdef SIGXCPU
|
||||
|
||||
+25
-6
@@ -2856,7 +2856,7 @@ handler_routine(
|
||||
windgoto((int)Rows - 1, 0);
|
||||
g_fForceExit = TRUE;
|
||||
|
||||
sprintf((char *)IObuff, _("Vim: Caught %s event\n"),
|
||||
vim_snprintf((char *)IObuff, IOSIZE, _("Vim: Caught %s event\n"),
|
||||
(dwCtrlType == CTRL_CLOSE_EVENT
|
||||
? _("close")
|
||||
: dwCtrlType == CTRL_LOGOFF_EVENT
|
||||
@@ -3282,12 +3282,13 @@ mch_call_shell(
|
||||
{
|
||||
/* we use "command" or "cmd" to start the shell; slow but easy */
|
||||
char_u *newcmd;
|
||||
|
||||
newcmd = lalloc((long_u) (
|
||||
long_u cmdlen = (
|
||||
#ifdef FEAT_GUI_W32
|
||||
STRLEN(vimrun_path) +
|
||||
#endif
|
||||
STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10), TRUE);
|
||||
STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10);
|
||||
|
||||
newcmd = lalloc(cmdlen, TRUE);
|
||||
if (newcmd != NULL)
|
||||
{
|
||||
char_u *cmdbase = (*cmd == '"' ? cmd + 1 : cmd);
|
||||
@@ -3373,14 +3374,15 @@ mch_call_shell(
|
||||
if (!s_dont_use_vimrun)
|
||||
/* Use vimrun to execute the command. It opens a console
|
||||
* window, which can be closed without killing Vim. */
|
||||
sprintf((char *)newcmd, "%s%s%s %s %s",
|
||||
vim_snprintf((char *)newcmd, cmdlen, "%s%s%s %s %s",
|
||||
vimrun_path,
|
||||
(msg_silent != 0 || (options & SHELL_DOOUT))
|
||||
? "-s " : "",
|
||||
p_sh, p_shcf, cmd);
|
||||
else
|
||||
#endif
|
||||
sprintf((char *)newcmd, "%s %s %s", p_sh, p_shcf, cmd);
|
||||
vim_snprintf((char *)newcmd, cmdlen, "%s %s %s",
|
||||
p_sh, p_shcf, cmd);
|
||||
x = mch_system((char *)newcmd, options);
|
||||
}
|
||||
vim_free(newcmd);
|
||||
@@ -4664,12 +4666,29 @@ mch_fopen(char *name, char *mode)
|
||||
# endif
|
||||
)
|
||||
{
|
||||
# if defined(DEBUG) && _MSC_VER > 1200
|
||||
/* Work around an annoying assertion in the Microsoft debug CRT
|
||||
* when mode's text/binary setting doesn't match _get_fmode(). */
|
||||
char newMode = mode[strlen(mode) - 1];
|
||||
int oldMode = 0;
|
||||
|
||||
_get_fmode(&oldMode);
|
||||
if (newMode == 't')
|
||||
_set_fmode(_O_TEXT);
|
||||
else if (newMode == 'b')
|
||||
_set_fmode(_O_BINARY);
|
||||
# endif
|
||||
wn = enc_to_ucs2(name, NULL);
|
||||
wm = enc_to_ucs2(mode, NULL);
|
||||
if (wn != NULL && wm != NULL)
|
||||
f = _wfopen(wn, wm);
|
||||
vim_free(wn);
|
||||
vim_free(wm);
|
||||
|
||||
# if defined(DEBUG) && _MSC_VER > 1200
|
||||
_set_fmode(oldMode);
|
||||
# endif
|
||||
|
||||
if (f != NULL)
|
||||
return f;
|
||||
/* Retry with non-wide function (for Windows 98). Can't use
|
||||
|
||||
+1
-1
@@ -337,7 +337,7 @@ pum_redraw()
|
||||
|
||||
if (rt != NULL)
|
||||
{
|
||||
len = STRLEN(rt);
|
||||
len = (int)STRLEN(rt);
|
||||
if (len > pum_width)
|
||||
{
|
||||
for (j = pum_width; j < len; ++j)
|
||||
|
||||
@@ -190,13 +190,15 @@ int serverPeekReply(int port, char_u **str);
|
||||
int serverReadReply(int port, char_u **str);
|
||||
int serverSendReply(char_u *serverid, char_u *str);
|
||||
|
||||
void gui_mch_enter_fullscreen(void);
|
||||
void gui_mch_enter_fullscreen(int fuoptions_flags);
|
||||
void gui_mch_leave_fullscreen(void);
|
||||
|
||||
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);
|
||||
void odb_end(void);
|
||||
|
||||
char_u *get_macaction_name(expand_T *xp, int idx);
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ int do_join __ARGS((int insert_space));
|
||||
void op_format __ARGS((oparg_T *oap, int keep_cursor));
|
||||
void op_formatexpr __ARGS((oparg_T *oap));
|
||||
int fex_format __ARGS((linenr_T lnum, long count, int c));
|
||||
void format_lines __ARGS((linenr_T line_count));
|
||||
void format_lines __ARGS((linenr_T line_count, int avoid_fex));
|
||||
int paragraph_start __ARGS((linenr_T lnum));
|
||||
int do_addsub __ARGS((int command, linenr_T Prenum1));
|
||||
int read_viminfo_register __ARGS((vir_T *virp, int force));
|
||||
|
||||
@@ -106,7 +106,9 @@ struct efm_S
|
||||
|
||||
static int qf_init_ext __ARGS((qf_info_T *qi, char_u *efile, buf_T *buf, typval_T *tv, char_u *errorformat, int newlist, linenr_T lnumfirst, linenr_T lnumlast));
|
||||
static void qf_new_list __ARGS((qf_info_T *qi));
|
||||
static void ll_free_all __ARGS((qf_info_T **pqi));
|
||||
static int qf_add_entry __ARGS((qf_info_T *qi, qfline_T **prevp, char_u *dir, char_u *fname, int bufnum, char_u *mesg, long lnum, int col, int vis_col, char_u *pattern, int nr, int type, int valid));
|
||||
static qf_info_T *ll_new_list __ARGS((void));
|
||||
static void qf_msg __ARGS((qf_info_T *qi));
|
||||
static void qf_free __ARGS((qf_info_T *qi, int idx));
|
||||
static char_u *qf_types __ARGS((int, int));
|
||||
|
||||
+1
-1
@@ -4527,7 +4527,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
|
||||
#endif
|
||||
col == W_WIDTH(wp) - 1)
|
||||
&& (*ptr != NUL
|
||||
|| (wp->w_p_list && lcs_eol != NUL && p_extra != at_end_str)
|
||||
|| (wp->w_p_list && lcs_eol_one > 0)
|
||||
|| (n_extra && (c_extra != NUL || *p_extra != NUL))))
|
||||
{
|
||||
c = lcs_ext;
|
||||
|
||||
+4
-1
@@ -547,7 +547,10 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
if (options & SEARCH_START)
|
||||
/* When not accepting a match at the start position set "extra_col" to a
|
||||
* non-zero value. Don't do that when starting at MAXCOL, since MAXCOL +
|
||||
* 1 is zero. */
|
||||
if ((options & SEARCH_START) || pos->col == MAXCOL)
|
||||
extra_col = 0;
|
||||
#ifdef FEAT_MBYTE
|
||||
/* Watch out for the "col" being MAXCOL - 2, used in a closed fold. */
|
||||
|
||||
+10
-6
@@ -2268,6 +2268,8 @@ spell_move_to(wp, dir, allwords, curline, attrp)
|
||||
/*
|
||||
* For spell checking: concatenate the start of the following line "line" into
|
||||
* "buf", blanking-out special characters. Copy less then "maxlen" bytes.
|
||||
* Keep the blanks at the start of the next line, this is used in win_line()
|
||||
* to skip those bytes if the word was OK.
|
||||
*/
|
||||
void
|
||||
spell_cat_line(buf, line, maxlen)
|
||||
@@ -2284,12 +2286,14 @@ spell_cat_line(buf, line, maxlen)
|
||||
|
||||
if (*p != NUL)
|
||||
{
|
||||
*buf = ' ';
|
||||
vim_strncpy(buf + 1, line, maxlen - 2);
|
||||
n = (int)(p - line);
|
||||
if (n >= maxlen)
|
||||
n = maxlen - 1;
|
||||
vim_memset(buf + 1, ' ', n);
|
||||
/* Only worth concatenating if there is something else than spaces to
|
||||
* concatenate. */
|
||||
n = (int)(p - line) + 1;
|
||||
if (n < maxlen - 1)
|
||||
{
|
||||
vim_memset(buf, ' ', n);
|
||||
vim_strncpy(buf + n, p, maxlen - 1 - n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -681,6 +681,54 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
291,
|
||||
/**/
|
||||
290,
|
||||
/**/
|
||||
289,
|
||||
/**/
|
||||
288,
|
||||
/**/
|
||||
287,
|
||||
/**/
|
||||
286,
|
||||
/**/
|
||||
285,
|
||||
/**/
|
||||
284,
|
||||
/**/
|
||||
283,
|
||||
/**/
|
||||
282,
|
||||
/**/
|
||||
281,
|
||||
/**/
|
||||
280,
|
||||
/**/
|
||||
279,
|
||||
/**/
|
||||
278,
|
||||
/**/
|
||||
277,
|
||||
/**/
|
||||
276,
|
||||
/**/
|
||||
275,
|
||||
/**/
|
||||
274,
|
||||
/**/
|
||||
273,
|
||||
/**/
|
||||
272,
|
||||
/**/
|
||||
271,
|
||||
/**/
|
||||
270,
|
||||
/**/
|
||||
269,
|
||||
/**/
|
||||
268,
|
||||
/**/
|
||||
267,
|
||||
/**/
|
||||
|
||||
@@ -356,16 +356,19 @@ typedef unsigned int int_u;
|
||||
* On Win64 longs are 32 bit and pointers 64 bit.
|
||||
* For printf() and scanf() we need to take care of long_u specifically. */
|
||||
#ifdef _WIN64
|
||||
typedef unsigned __int64 long_u;
|
||||
typedef __int64 long_i;
|
||||
# define SCANF_HEX_LONG_U "%Ix"
|
||||
# define PRINTF_HEX_LONG_U "0x%Ix"
|
||||
typedef unsigned __int64 long_u;
|
||||
typedef __int64 long_i;
|
||||
# define SCANF_HEX_LONG_U "%Ix"
|
||||
# define SCANF_DECIMAL_LONG_U "%Iu"
|
||||
# define PRINTF_HEX_LONG_U "0x%Ix"
|
||||
#else
|
||||
typedef unsigned long long_u;
|
||||
typedef long long_i;
|
||||
# define SCANF_HEX_LONG_U "%lx"
|
||||
# define PRINTF_HEX_LONG_U "0x%lx"
|
||||
typedef unsigned long long_u;
|
||||
typedef long long_i;
|
||||
# define SCANF_HEX_LONG_U "%lx"
|
||||
# define SCANF_DECIMAL_LONG_U "%lu"
|
||||
# define PRINTF_HEX_LONG_U "0x%lx"
|
||||
#endif
|
||||
#define PRINTF_DECIMAL_LONG_U SCANF_DECIMAL_LONG_U
|
||||
|
||||
/*
|
||||
* The characters and attributes cached for the screen.
|
||||
@@ -462,9 +465,10 @@ typedef unsigned long u8char_T; /* long should be 32 bits or more */
|
||||
/*
|
||||
* Check input method control.
|
||||
*/
|
||||
#if defined(FEAT_XIM) || \
|
||||
(defined(FEAT_GUI) && (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))) \
|
||||
|| defined(FEAT_GUI_MACVIM)
|
||||
#if defined(FEAT_XIM) \
|
||||
|| (defined(FEAT_GUI) && (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))) \
|
||||
|| (defined(FEAT_GUI_MAC) && defined(FEAT_MBYTE)) \
|
||||
|| defined(FEAT_GUI_MACVIM)
|
||||
# define USE_IM_CONTROL
|
||||
#endif
|
||||
|
||||
@@ -689,6 +693,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
|
||||
#define EXPAND_USER_DEFINED 30
|
||||
#define EXPAND_USER_LIST 31
|
||||
#define EXPAND_SHELLCMD 32
|
||||
#define EXPAND_MACACTION 33
|
||||
|
||||
/* Values for exmode_active (0 is no exmode) */
|
||||
#define EXMODE_NORMAL 1
|
||||
@@ -950,6 +955,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
|
||||
#define INSCHAR_FORMAT 1 /* force formatting */
|
||||
#define INSCHAR_DO_COM 2 /* format comments */
|
||||
#define INSCHAR_CTRLV 4 /* char typed just after CTRL-V */
|
||||
#define INSCHAR_NO_FEX 8 /* don't use 'formatexpr' */
|
||||
|
||||
/* flags for open_line() */
|
||||
#define OPENLINE_DELSPACES 1 /* delete spaces after cursor */
|
||||
|
||||
+1
-1
@@ -6303,7 +6303,7 @@ match_add(wp, grp, pat, prio, id)
|
||||
cur = cur->next;
|
||||
}
|
||||
}
|
||||
if ((hlg_id = syn_namen2id(grp, STRLEN(grp))) == 0)
|
||||
if ((hlg_id = syn_namen2id(grp, (int)STRLEN(grp))) == 0)
|
||||
{
|
||||
EMSG2(_(e_nogroup), grp);
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user