mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Compare commits
54 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4494783964 | |||
| 6f45b7a83c | |||
| 9352553da0 | |||
| 78330ec132 | |||
| 5c9e4f17bc | |||
| 86d7c475d6 | |||
| 9bd435daa1 | |||
| 21d545e55d | |||
| e4f9c806e5 | |||
| 07c2bd2d5e | |||
| f9905d3944 | |||
| aa5e59d5eb | |||
| c60da0b7b6 | |||
| 31f660b37a | |||
| 116d179fc0 | |||
| 1c7b224c37 | |||
| fc698b39fe | |||
| 5f81e8ad27 | |||
| 34d334c013 | |||
| 04820b04d6 | |||
| dae5f35607 | |||
| 10244aa84b | |||
| 313941f77d | |||
| 435935bf0b | |||
| 4888e4d704 | |||
| 0aef550233 | |||
| 01100ceedc | |||
| fb48afe434 | |||
| 1ebdd8968f | |||
| 2da8cec3c2 | |||
| e9f75c50c1 | |||
| b4d507b9d0 | |||
| ded90a7def | |||
| 44b0f3bc30 | |||
| c8a0b8cdfb | |||
| 99eb5f2c9c | |||
| b5688c3ef3 | |||
| 3ed1ee17eb | |||
| f9d04339ee | |||
| bc6c0f325c | |||
| 7092cfd2f8 | |||
| dbf3bcd840 | |||
| 4367811170 | |||
| a4f7e934f5 | |||
| bf9f50247f | |||
| 8d96449a24 | |||
| a6ce4014c4 | |||
| 1178591d1f | |||
| 073ba3f0e8 | |||
| 26f1599979 | |||
| 2dc63d8e16 | |||
| 5d7d4f9684 | |||
| 40c88bce6f | |||
| a409aa7c89 |
@@ -3802,7 +3802,8 @@ map({expr}, {string}) *map()*
|
||||
Replace each item in {expr} with the result of evaluating
|
||||
{string}.
|
||||
Inside {string} |v:val| has the value of the current item.
|
||||
For a |Dictionary| |v:key| has the key of the current item.
|
||||
For a |Dictionary| |v:key| has the key of the current item
|
||||
and for a |List| |v:key| has the index of the current item.
|
||||
Example: >
|
||||
:call map(mylist, '"> " . v:val . " <"')
|
||||
< This puts "> " before and " <" after each item in "mylist".
|
||||
@@ -5872,6 +5873,7 @@ showcmd Compiled with 'showcmd' support.
|
||||
signs Compiled with |:sign| support.
|
||||
smartindent Compiled with 'smartindent' support.
|
||||
sniff Compiled with SNiFF interface support.
|
||||
startuptime Compiled with |--startuptime| support.
|
||||
statusline Compiled with support for 'statusline', 'rulerformat'
|
||||
and special formats of 'titlestring' and 'iconstring'.
|
||||
sun_workshop Compiled with support for Sun |workshop|.
|
||||
|
||||
@@ -144,6 +144,14 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
|
||||
-u NORC no yes
|
||||
--noplugin yes no
|
||||
|
||||
--startuptime {fname} *--startuptime*
|
||||
During startup write timing messages to the file {fname}.
|
||||
This can be used to find out where time is spent while loading
|
||||
your .vimrc, plugins and opening the first file.
|
||||
When {fname} already exists new messages are appended.
|
||||
(Only available when compiled with the |+startuptime|
|
||||
feature).
|
||||
|
||||
*--literal*
|
||||
--literal Take file names literally, don't expand wildcards. Not needed
|
||||
for Unix, because Vim always takes file names literally (the
|
||||
@@ -471,6 +479,7 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
|
||||
window title and copy/paste using the X clipboard. This
|
||||
avoids a long startup time when running Vim in a terminal
|
||||
emulator and the connection to the X server is slow.
|
||||
See |--startuptime| to find out if affects you.
|
||||
Only makes a difference on Unix or VMS, when compiled with the
|
||||
|+X11| feature. Otherwise it's ignored.
|
||||
To disable the connection only for specific terminals, see the
|
||||
|
||||
@@ -376,6 +376,7 @@ N *+scrollbind* |'scrollbind'|
|
||||
B *+signs* |:sign|
|
||||
N *+smartindent* |'smartindent'|
|
||||
m *+sniff* SniFF interface |sniff|
|
||||
N *+startuptime* |--startuptime| argument
|
||||
N *+statusline* Options 'statusline', 'rulerformat' and special
|
||||
formats of 'titlestring' and 'iconstring'
|
||||
m *+sun_workshop* |workshop|
|
||||
|
||||
+50
-120
@@ -1,120 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBClasses</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>ACTIONS</key>
|
||||
<dict>
|
||||
<key>fileOpen</key>
|
||||
<string>id</string>
|
||||
<key>fontSizeDown</key>
|
||||
<string>id</string>
|
||||
<key>fontSizeUp</key>
|
||||
<string>id</string>
|
||||
<key>forceNewWindow</key>
|
||||
<string>id</string>
|
||||
<key>newWindow</key>
|
||||
<string>id</string>
|
||||
<key>newWindowAndActivate</key>
|
||||
<string>id</string>
|
||||
<key>openWebsite</key>
|
||||
<string>id</string>
|
||||
<key>orderFrontPreferencePanel</key>
|
||||
<string>id</string>
|
||||
<key>selectNextWindow</key>
|
||||
<string>id</string>
|
||||
<key>selectPreviousWindow</key>
|
||||
<string>id</string>
|
||||
<key>showHelp</key>
|
||||
<string>id</string>
|
||||
<key>showVimHelp</key>
|
||||
<string>id</string>
|
||||
<key>zoomAll</key>
|
||||
<string>id</string>
|
||||
</dict>
|
||||
<key>CLASS</key>
|
||||
<string>MMAppController</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSObject</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>RBSplitView</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>OUTLETS</key>
|
||||
<dict>
|
||||
<key>delegate</key>
|
||||
<string>id</string>
|
||||
</dict>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>RBSplitSubview</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>RBSplitSubview</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSView</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>NSMenu</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSObject</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>ACTIONS</key>
|
||||
<dict>
|
||||
<key>_cycleWindows</key>
|
||||
<string>id</string>
|
||||
<key>_cycleWindowsBackwards</key>
|
||||
<string>id</string>
|
||||
<key>addNewTab</key>
|
||||
<string>id</string>
|
||||
</dict>
|
||||
<key>CLASS</key>
|
||||
<string>FirstResponder</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSObject</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>ACTIONS</key>
|
||||
<dict>
|
||||
<key>didAdjustSubviews</key>
|
||||
<string>RBSplitView</string>
|
||||
<key>willAdjustSubviews</key>
|
||||
<string>RBSplitView</string>
|
||||
</dict>
|
||||
<key>CLASS</key>
|
||||
<string>NSObject</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>ACTIONS</key>
|
||||
<dict>
|
||||
<key>checkForUpdates</key>
|
||||
<string>id</string>
|
||||
</dict>
|
||||
<key>CLASS</key>
|
||||
<string>SUUpdater</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSObject</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>IBVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
{
|
||||
IBClasses = (
|
||||
{
|
||||
ACTIONS = {"_cycleWindows" = id; "_cycleWindowsBackwards" = id; addNewTab = id; };
|
||||
CLASS = FirstResponder;
|
||||
LANGUAGE = ObjC;
|
||||
SUPERCLASS = NSObject;
|
||||
},
|
||||
{
|
||||
ACTIONS = {
|
||||
fileOpen = id;
|
||||
fontSizeDown = id;
|
||||
fontSizeUp = id;
|
||||
forceNewWindow = id;
|
||||
newWindow = id;
|
||||
newWindowAndActivate = id;
|
||||
openWebsite = id;
|
||||
orderFrontPreferencePanel = id;
|
||||
selectNextWindow = id;
|
||||
selectPreviousWindow = id;
|
||||
showHelp = id;
|
||||
showVimHelp = id;
|
||||
zoomAll = id;
|
||||
};
|
||||
CLASS = MMAppController;
|
||||
LANGUAGE = ObjC;
|
||||
SUPERCLASS = NSObject;
|
||||
},
|
||||
{CLASS = NSMenu; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
|
||||
{
|
||||
ACTIONS = {didAdjustSubviews = RBSplitView; willAdjustSubviews = RBSplitView; };
|
||||
CLASS = NSObject;
|
||||
LANGUAGE = ObjC;
|
||||
},
|
||||
{CLASS = RBSplitSubview; LANGUAGE = ObjC; SUPERCLASS = NSView; },
|
||||
{
|
||||
CLASS = RBSplitView;
|
||||
LANGUAGE = ObjC;
|
||||
OUTLETS = {delegate = id; };
|
||||
SUPERCLASS = RBSplitSubview;
|
||||
},
|
||||
{
|
||||
ACTIONS = {checkForUpdates = id; };
|
||||
CLASS = SUUpdater;
|
||||
LANGUAGE = ObjC;
|
||||
SUPERCLASS = NSObject;
|
||||
}
|
||||
);
|
||||
IBVersion = 1;
|
||||
}
|
||||
+13
-4
@@ -1,17 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>84 130 356 240 0 0 1024 746 </string>
|
||||
<key>IBEditorPositions</key>
|
||||
<dict>
|
||||
<key>29</key>
|
||||
<string>84 375 281 44 0 0 1024 746 </string>
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>629</string>
|
||||
<string>489.0</string>
|
||||
<key>IBLastKnownRelativeProjectPath</key>
|
||||
<string>../../MacVim.xcodeproj</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array/>
|
||||
<array>
|
||||
<integer>29</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9E17</string>
|
||||
<string>8S165</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
|
||||
Binary file not shown.
-116
@@ -1,116 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBClasses</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>ACTIONS</key>
|
||||
<dict>
|
||||
<key>changePreloadCacheSize</key>
|
||||
<string>id</string>
|
||||
<key>installOdb</key>
|
||||
<string>id</string>
|
||||
<key>openInCurrentWindowSelectionChanged</key>
|
||||
<string>id</string>
|
||||
<key>uninstallOdb</key>
|
||||
<string>id</string>
|
||||
</dict>
|
||||
<key>CLASS</key>
|
||||
<string>MMPreferenceController</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>OUTLETS</key>
|
||||
<dict>
|
||||
<key>advancedPreferences</key>
|
||||
<string>NSView</string>
|
||||
<key>editors</key>
|
||||
<string>NSPopUpButton</string>
|
||||
<key>generalPreferences</key>
|
||||
<string>NSView</string>
|
||||
<key>installOdbButton</key>
|
||||
<string>NSButton</string>
|
||||
<key>integrationPreferences</key>
|
||||
<string>NSView</string>
|
||||
<key>layoutPopUpButton</key>
|
||||
<string>NSPopUpButton</string>
|
||||
<key>obdBundleVersionLabel</key>
|
||||
<string>NSTextField</string>
|
||||
<key>uninstallOdbButton</key>
|
||||
<string>NSButton</string>
|
||||
</dict>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>DBPrefsWindowController</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>RBSplitView</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>OUTLETS</key>
|
||||
<dict>
|
||||
<key>delegate</key>
|
||||
<string>id</string>
|
||||
</dict>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>RBSplitSubview</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>RBSplitSubview</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSView</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>NSMenu</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSObject</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>ACTIONS</key>
|
||||
<dict>
|
||||
<key>atsuiButtonClicked</key>
|
||||
<string>id</string>
|
||||
<key>loginShellButtonClicked</key>
|
||||
<string>id</string>
|
||||
<key>quickstartButtonClicked</key>
|
||||
<string>id</string>
|
||||
</dict>
|
||||
<key>CLASS</key>
|
||||
<string>FirstResponder</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSObject</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>ACTIONS</key>
|
||||
<dict>
|
||||
<key>didAdjustSubviews</key>
|
||||
<string>RBSplitView</string>
|
||||
<key>willAdjustSubviews</key>
|
||||
<string>RBSplitView</string>
|
||||
</dict>
|
||||
<key>CLASS</key>
|
||||
<string>NSObject</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>DBPrefsWindowController</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSWindowController</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>IBVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
+2573
File diff suppressed because it is too large
Load Diff
-20
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>629</string>
|
||||
<key>IBLastKnownRelativeProjectPath</key>
|
||||
<string>../../MacVim.xcodeproj</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>115</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9E17</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
@@ -1202,7 +1202,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>50</string>
|
||||
<string>51</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
||||
@@ -139,6 +139,7 @@ typedef struct
|
||||
- (void)reapChildProcesses:(id)sender;
|
||||
- (void)processInputQueues:(id)sender;
|
||||
- (void)addVimController:(MMVimController *)vc;
|
||||
- (NSScreen *)screenContainingPoint:(NSPoint)pt;
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
- (void)removePlugInMenu;
|
||||
@@ -180,6 +181,13 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
CFPreferencesSetAppValue(CFSTR("NSQuotedKeystrokeBinding"),
|
||||
CFSTR(""),
|
||||
kCFPreferencesCurrentApplication);
|
||||
|
||||
// Also disable NSRepeatCountBinding -- it is not enabled by default, but
|
||||
// it does not make much sense to support it since Vim has its own way of
|
||||
// dealing with repeat counts.
|
||||
CFPreferencesSetAppValue(CFSTR("NSRepeatCountBinding"),
|
||||
CFSTR(""),
|
||||
kCFPreferencesCurrentApplication);
|
||||
|
||||
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithBool:NO], MMNoWindowKey,
|
||||
@@ -198,7 +206,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
[NSNumber numberWithInt:0], MMOpenInCurrentWindowKey,
|
||||
[NSNumber numberWithBool:NO], MMNoFontSubstitutionKey,
|
||||
[NSNumber numberWithBool:YES], MMLoginShellKey,
|
||||
[NSNumber numberWithBool:NO], MMAtsuiRendererKey,
|
||||
[NSNumber numberWithInt:0], MMRendererKey,
|
||||
[NSNumber numberWithInt:MMUntitledWindowAlways],
|
||||
MMUntitledWindowKey,
|
||||
[NSNumber numberWithBool:NO], MMTexturedWindowKey,
|
||||
@@ -751,6 +759,12 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
}
|
||||
|
||||
if (!NSEqualPoints(topLeft, NSZeroPoint)) {
|
||||
// Try to tile from the correct screen in case the user has multiple
|
||||
// monitors ([win screen] always seems to return the "main" screen).
|
||||
NSScreen *screen = [self screenContainingPoint:topLeft];
|
||||
if (!screen)
|
||||
screen = [win screen];
|
||||
|
||||
if (topWin) {
|
||||
// Do manual cascading instead of using
|
||||
// -[MMWindow cascadeTopLeftFromPoint:] since it is rather
|
||||
@@ -759,7 +773,6 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
topLeft.y -= MMCascadeVerticalOffset;
|
||||
}
|
||||
|
||||
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
|
||||
@@ -1166,6 +1179,27 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
- (IBAction)atsuiButtonClicked:(id)sender
|
||||
{
|
||||
ASLogDebug(@"Toggle ATSUI renderer");
|
||||
NSInteger renderer = MMRendererDefault;
|
||||
BOOL enable = ([sender state] == NSOnState);
|
||||
|
||||
if (enable) {
|
||||
#if MM_ENABLE_ATSUI
|
||||
renderer = MMRendererATSUI;
|
||||
#else
|
||||
renderer = MMRendererCoreText;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Update the user default MMRenderer and synchronize the change so that
|
||||
// any new Vim process will pick up on the changed setting.
|
||||
CFPreferencesSetAppValue(
|
||||
(CFStringRef)MMRendererKey,
|
||||
(CFPropertyListRef)[NSNumber numberWithInt:renderer],
|
||||
kCFPreferencesCurrentApplication);
|
||||
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
|
||||
|
||||
ASLogInfo(@"Use renderer=%d", renderer);
|
||||
|
||||
// This action is called when the user clicks the "use ATSUI renderer"
|
||||
// button in the advanced preferences pane.
|
||||
[self rebuildPreloadCache];
|
||||
@@ -2351,4 +2385,18 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
}
|
||||
}
|
||||
|
||||
- (NSScreen *)screenContainingPoint:(NSPoint)pt
|
||||
{
|
||||
NSArray *screens = [NSScreen screens];
|
||||
NSUInteger i, count = [screens count];
|
||||
for (i = 0; i < count; ++i) {
|
||||
NSScreen *screen = [screens objectAtIndex:i];
|
||||
NSRect frame = [screen frame];
|
||||
if (NSPointInRect(pt, frame))
|
||||
return screen;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end // MMAppController (Private)
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#define DRAW_UNDERC 0x08 /* draw undercurl text */
|
||||
#define DRAW_ITALIC 0x10 /* draw italic text */
|
||||
#define DRAW_CURSOR 0x20
|
||||
#define DRAW_WIDE 0x40 /* draw wide text */
|
||||
|
||||
#define kUnderlineOffset (-2)
|
||||
#define kUnderlineHeight 1
|
||||
@@ -149,7 +150,7 @@ defaultLineHeightForFont(NSFont *font)
|
||||
[defaultForegroundColor release]; defaultForegroundColor = nil;
|
||||
|
||||
[helper setTextView:nil];
|
||||
[helper dealloc]; helper = nil;
|
||||
[helper release]; helper = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -73,8 +73,8 @@
|
||||
toRow:(int)row2 column:(int)col2;
|
||||
- (void)deleteLinesFromRow:(int)row count:(int)count
|
||||
scrollBottom:(int)bottom left:(int)left right:(int)right;
|
||||
- (void)drawString:(char*)s length:(int)len row:(int)row column:(int)col
|
||||
cells:(int)cells flags:(int)flags;
|
||||
- (void)drawString:(char_u*)s length:(int)len row:(int)row
|
||||
column:(int)col cells:(int)cells flags:(int)flags;
|
||||
- (void)insertLinesFromRow:(int)row count:(int)count
|
||||
scrollBottom:(int)bottom left:(int)left right:(int)right;
|
||||
- (void)drawCursorAtRow:(int)row column:(int)col shape:(int)shape
|
||||
|
||||
@@ -487,10 +487,10 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
[self didChangeWholeLine];
|
||||
}
|
||||
|
||||
- (void)drawString:(char*)s length:(int)len row:(int)row column:(int)col
|
||||
cells:(int)cells flags:(int)flags
|
||||
- (void)drawString:(char_u*)s length:(int)len row:(int)row
|
||||
column:(int)col cells:(int)cells flags:(int)flags
|
||||
{
|
||||
if (len <= 0 || cells <= 0) return;
|
||||
if (len <= 0) return;
|
||||
|
||||
int type = DrawStringDrawType;
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
/* vi:set ts=8 sts=4 sw=4 ft=objc:
|
||||
*
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
* MacVim GUI port by Bjorn Winckler
|
||||
*
|
||||
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
||||
@class MMTextViewHelper;
|
||||
|
||||
|
||||
@interface MMCoreTextView : NSView <NSTextInput> {
|
||||
// From MMTextStorage
|
||||
int maxRows, maxColumns;
|
||||
NSColor *defaultBackgroundColor;
|
||||
NSColor *defaultForegroundColor;
|
||||
NSSize cellSize;
|
||||
NSFont *font;
|
||||
float linespace;
|
||||
|
||||
// From NSTextView
|
||||
NSSize insetSize;
|
||||
|
||||
float fontDescent;
|
||||
BOOL antialias;
|
||||
NSMutableArray *drawData;
|
||||
|
||||
MMTextViewHelper *helper;
|
||||
|
||||
unsigned maxlen;
|
||||
CGGlyph *glyphs;
|
||||
CGSize *advances;
|
||||
|
||||
NSRect lastClearRect;
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(NSRect)frame;
|
||||
|
||||
//
|
||||
// MMTextStorage methods
|
||||
//
|
||||
- (int)maxRows;
|
||||
- (int)maxColumns;
|
||||
- (void)getMaxRows:(int*)rows columns:(int*)cols;
|
||||
- (void)setMaxRows:(int)rows columns:(int)cols;
|
||||
- (void)setDefaultColorsBackground:(NSColor *)bgColor
|
||||
foreground:(NSColor *)fgColor;
|
||||
- (NSColor *)defaultBackgroundColor;
|
||||
- (NSColor *)defaultForegroundColor;
|
||||
- (NSRect)rectForRowsInRange:(NSRange)range;
|
||||
- (NSRect)rectForColumnsInRange:(NSRange)range;
|
||||
|
||||
- (void)setFont:(NSFont *)newFont;
|
||||
- (void)setWideFont:(NSFont *)newFont;
|
||||
- (NSFont *)font;
|
||||
- (NSFont *)fontWide;
|
||||
- (NSSize)cellSize;
|
||||
- (void)setLinespace:(float)newLinespace;
|
||||
|
||||
//
|
||||
// MMTextView methods
|
||||
//
|
||||
- (void)setShouldDrawInsertionPoint:(BOOL)on;
|
||||
- (void)setPreEditRow:(int)row column:(int)col;
|
||||
- (void)setMouseShape:(int)shape;
|
||||
- (void)setAntialias:(BOOL)state;
|
||||
- (void)setImControl:(BOOL)enable;
|
||||
- (void)activateIm:(BOOL)enable;
|
||||
- (BOOL)convertPoint:(NSPoint)point toRow:(int *)row column:(int *)column;
|
||||
|
||||
//
|
||||
// NSTextView methods
|
||||
//
|
||||
- (void)keyDown:(NSEvent *)event;
|
||||
- (void)insertText:(id)string;
|
||||
- (void)doCommandBySelector:(SEL)selector;
|
||||
- (BOOL)performKeyEquivalent:(NSEvent *)event;
|
||||
|
||||
//
|
||||
// NSTextContainer methods
|
||||
//
|
||||
- (void)setTextContainerInset:(NSSize)inset;
|
||||
|
||||
//
|
||||
// MMCoreTextView methods
|
||||
//
|
||||
- (void)performBatchDrawWithData:(NSData *)data;
|
||||
- (NSSize)desiredSize;
|
||||
- (NSSize)minSize;
|
||||
- (NSSize)constrainRows:(int *)rows columns:(int *)cols toSize:(NSSize)size;
|
||||
|
||||
@end
|
||||
File diff suppressed because it is too large
Load Diff
@@ -308,9 +308,13 @@
|
||||
- (void)centerView
|
||||
{
|
||||
NSRect outer = [self frame], inner = [view frame];
|
||||
|
||||
NSPoint origin = NSMakePoint((outer.size.width - inner.size.width)/2,
|
||||
(outer.size.height - inner.size.height)/2);
|
||||
|
||||
// NOTE! Make sure the origin coordinates are integral or very strange
|
||||
// rendering issues may arise (screen looks blurry, each redraw clears the
|
||||
// entire window, etc.).
|
||||
NSPoint origin = { floor((outer.size.width - inner.size.width)/2),
|
||||
floor((outer.size.height - inner.size.height)/2) };
|
||||
|
||||
[view setFrameOrigin:origin];
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#define DRAW_UNDERC 0x08 /* draw undercurl text */
|
||||
#define DRAW_ITALIC 0x10 /* draw italic text */
|
||||
#define DRAW_CURSOR 0x20
|
||||
#define DRAW_WIDE 0x40 /* draw wide text */
|
||||
|
||||
|
||||
static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
}
|
||||
|
||||
[helper setTextView:nil];
|
||||
[helper dealloc]; helper = nil;
|
||||
[helper release]; helper = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
+21
-8
@@ -18,7 +18,11 @@
|
||||
* the view is filled by the text view.
|
||||
*/
|
||||
|
||||
#import "MMAtsuiTextView.h"
|
||||
#if MM_ENABLE_ATSUI
|
||||
# import "MMAtsuiTextView.h"
|
||||
#else
|
||||
# import "MMCoreTextView.h"
|
||||
#endif
|
||||
#import "MMTextView.h"
|
||||
#import "MMVimController.h"
|
||||
#import "MMVimView.h"
|
||||
@@ -89,16 +93,20 @@ enum {
|
||||
[self setAutoresizesSubviews:YES];
|
||||
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
#if ENABLE_ATSUI
|
||||
if ([ud boolForKey:MMAtsuiRendererKey]) {
|
||||
// Use ATSUI for text rendering.
|
||||
//
|
||||
NSInteger renderer = [ud integerForKey:MMRendererKey];
|
||||
ASLogInfo(@"Use renderer=%d", renderer);
|
||||
|
||||
if (MMRendererCoreText == renderer) {
|
||||
// HACK! 'textView' has type MMTextView, but MMCoreTextView is not
|
||||
// derived from MMTextView.
|
||||
textView = [[MMCoreTextView alloc] initWithFrame:frame];
|
||||
#if MM_ENABLE_ATSUI
|
||||
} else if (MMRendererATSUI == renderer) {
|
||||
// HACK! 'textView' has type MMTextView, but MMAtsuiTextView is not
|
||||
// derived from MMTextView.
|
||||
textView = [[MMAtsuiTextView alloc] initWithFrame:frame];
|
||||
} else
|
||||
#endif // ENABLE_ATSUI
|
||||
{
|
||||
#endif
|
||||
} else {
|
||||
// Use Cocoa text system for text rendering.
|
||||
textView = [[MMTextView alloc] initWithFrame:frame];
|
||||
}
|
||||
@@ -172,6 +180,11 @@ enum {
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (BOOL)isOpaque
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)drawRect:(NSRect)rect
|
||||
{
|
||||
// On Leopard, we want to have a textured window background for nice
|
||||
|
||||
@@ -430,6 +430,7 @@
|
||||
if (shouldResizeVimView) {
|
||||
shouldResizeVimView = NO;
|
||||
|
||||
NSSize originalSize = [vimView frame].size;
|
||||
NSSize contentSize = [vimView desiredSize];
|
||||
contentSize = [self constrainContentSizeToScreenSize:contentSize];
|
||||
contentSize = [vimView constrainRows:NULL columns:NULL
|
||||
@@ -437,8 +438,15 @@
|
||||
[vimView setFrameSize:contentSize];
|
||||
|
||||
if (fullscreenEnabled) {
|
||||
[[fullscreenWindow contentView] setNeedsDisplay:YES];
|
||||
[fullscreenWindow centerView];
|
||||
// NOTE! Don't mark the fullscreen content view as needing an
|
||||
// update unless absolutely necessary since when it is updated the
|
||||
// entire screen is cleared. This may cause some parts of the Vim
|
||||
// view to be cleared but not redrawn since Vim does not realize
|
||||
// that we've erased part of the view.
|
||||
if (!NSEqualSizes(originalSize, contentSize)) {
|
||||
[[fullscreenWindow contentView] setNeedsDisplay:YES];
|
||||
[fullscreenWindow centerView];
|
||||
}
|
||||
} else {
|
||||
[self resizeWindowToFitContentSize:contentSize
|
||||
keepOnScreen:keepOnScreen];
|
||||
|
||||
+7
-2
@@ -194,8 +194,6 @@ enum {
|
||||
};
|
||||
|
||||
|
||||
#define DRAW_WIDE 0x40 /* draw wide text */
|
||||
|
||||
enum {
|
||||
ClearAllDrawType = 1,
|
||||
ClearBlockDrawType,
|
||||
@@ -249,6 +247,13 @@ extern NSString *MMNoWindowKey;
|
||||
|
||||
extern NSString *MMAutosaveRowsKey;
|
||||
extern NSString *MMAutosaveColumnsKey;
|
||||
extern NSString *MMRendererKey;
|
||||
|
||||
enum {
|
||||
MMRendererDefault = 0,
|
||||
MMRendererATSUI,
|
||||
MMRendererCoreText
|
||||
};
|
||||
|
||||
|
||||
// Vim pasteboard type (holds motion type + string)
|
||||
|
||||
@@ -108,6 +108,7 @@ NSString *MMNoWindowKey = @"MMNoWindow";
|
||||
|
||||
NSString *MMAutosaveRowsKey = @"MMAutosaveRows";
|
||||
NSString *MMAutosaveColumnsKey = @"MMAutosaveColumns";
|
||||
NSString *MMRendererKey = @"MMRenderer";
|
||||
|
||||
// Vim pasteboard type (holds motion type + string)
|
||||
NSString *VimPBoardType = @"VimPBoardType";
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
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 */; };
|
||||
@@ -37,7 +36,6 @@
|
||||
1D80FBD40CBBD3B700102A1C /* MMFullscreenWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D80FBD00CBBD3B700102A1C /* MMFullscreenWindow.m */; };
|
||||
1D80FBD60CBBD3B700102A1C /* MMVimView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D80FBD20CBBD3B700102A1C /* MMVimView.m */; };
|
||||
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 */; };
|
||||
@@ -70,6 +68,7 @@
|
||||
1DE3F8E70D50F80500052B9E /* Preferences.nib in Resources */ = {isa = PBXBuildFile; fileRef = 1DE3F8E50D50F80500052B9E /* Preferences.nib */; };
|
||||
1DE3F8EB0D50F84600052B9E /* MMPreferenceController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DE3F8E90D50F84600052B9E /* MMPreferenceController.m */; };
|
||||
1DE608B40C587FDA0055263D /* runtime in Copy Vim Runtime Files */ = {isa = PBXBuildFile; fileRef = 1DE602470C587FD10055263D /* runtime */; };
|
||||
1DE63FFB0E71820F00959BDB /* MMCoreTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DE63FFA0E71820F00959BDB /* MMCoreTextView.m */; };
|
||||
1DE8CC620C5E2AAD003F56E3 /* Actions.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1DE8CC610C5E2AAD003F56E3 /* Actions.plist */; };
|
||||
1DE9B9500D341AB8008FEDD4 /* MMWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DE9B94E0D341AB8008FEDD4 /* MMWindow.m */; };
|
||||
1DED78600C6DE43D0079945F /* vimrc in Copy Vim Runtime Files */ = {isa = PBXBuildFile; fileRef = 1DED785F0C6DE43D0079945F /* vimrc */; };
|
||||
@@ -148,7 +147,6 @@
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
1D22121E104B04530086DFF1 /* Sparkle.framework in Copy Frameworks */,
|
||||
1D493DBA0C52534300AB718C /* PSMTabBarControl.framework in Copy Frameworks */,
|
||||
);
|
||||
name = "Copy Frameworks";
|
||||
@@ -216,7 +214,6 @@
|
||||
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>"; };
|
||||
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>"; };
|
||||
@@ -251,6 +248,8 @@
|
||||
1DE3F8E80D50F84600052B9E /* MMPreferenceController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MMPreferenceController.h; sourceTree = "<group>"; };
|
||||
1DE3F8E90D50F84600052B9E /* MMPreferenceController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MMPreferenceController.m; sourceTree = "<group>"; };
|
||||
1DE602470C587FD10055263D /* runtime */ = {isa = PBXFileReference; lastKnownFileType = folder; name = runtime; path = ../../runtime; sourceTree = SOURCE_ROOT; };
|
||||
1DE63FF90E71820F00959BDB /* MMCoreTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMCoreTextView.h; sourceTree = "<group>"; };
|
||||
1DE63FFA0E71820F00959BDB /* MMCoreTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMCoreTextView.m; sourceTree = "<group>"; };
|
||||
1DE8CC610C5E2AAD003F56E3 /* Actions.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Actions.plist; sourceTree = "<group>"; };
|
||||
1DE9B94D0D341AB8008FEDD4 /* MMWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MMWindow.h; sourceTree = "<group>"; };
|
||||
1DE9B94E0D341AB8008FEDD4 /* MMWindow.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MMWindow.m; sourceTree = "<group>"; };
|
||||
@@ -288,7 +287,6 @@
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
|
||||
0395A9C30D75D04D00881434 /* Security.framework in Frameworks */,
|
||||
1D8B5A53104AF9FF002E59D5 /* Carbon.framework in Frameworks */,
|
||||
1D8B5A89104AFF2A002E59D5 /* Sparkle.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -317,6 +315,8 @@
|
||||
children = (
|
||||
1D6008890E96A0B2003763F0 /* MMFindReplaceController.h */,
|
||||
1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */,
|
||||
1DE63FF90E71820F00959BDB /* MMCoreTextView.h */,
|
||||
1DE63FFA0E71820F00959BDB /* MMCoreTextView.m */,
|
||||
1D145C7D0E5227CE00691AA0 /* MMTextViewHelper.h */,
|
||||
1D145C7E0E5227CE00691AA0 /* MMTextViewHelper.m */,
|
||||
1D8059220E118663001699D1 /* Miscellaneous.h */,
|
||||
@@ -502,7 +502,6 @@
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1D8B5A88104AFF2A002E59D5 /* Sparkle.framework */,
|
||||
1D8B5A52104AF9FF002E59D5 /* Carbon.framework */,
|
||||
0395AA980D76E86200881434 /* Edit in ODBEditor */,
|
||||
0395A9C20D75D04D00881434 /* Security.framework */,
|
||||
@@ -690,6 +689,7 @@
|
||||
BD9DF0FB0DB48C860025C97C /* CTGradient.m in Sources */,
|
||||
1D145C7F0E5227CE00691AA0 /* MMTextViewHelper.m in Sources */,
|
||||
1D60088B0E96A0B2003763F0 /* MMFindReplaceController.m in Sources */,
|
||||
1DE63FFB0E71820F00959BDB /* MMCoreTextView.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -749,7 +749,7 @@
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 50;
|
||||
CURRENT_PROJECT_VERSION = 51;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
|
||||
@@ -779,7 +779,7 @@
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
CURRENT_PROJECT_VERSION = 50;
|
||||
CURRENT_PROJECT_VERSION = 51;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
|
||||
|
||||
@@ -16,10 +16,9 @@
|
||||
// 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)
|
||||
// Use Core Text instead of ATSUI when compiling on 10.5+.
|
||||
// Note: Core Text was introduced with 10.5, ATSUI was deprecated on 10.6.
|
||||
#define MM_ENABLE_ATSUI (MAC_OS_X_VERSION_MIN_REQUIRED<MAC_OS_X_VERSION_10_5)
|
||||
|
||||
|
||||
// NSUserDefaults keys
|
||||
@@ -39,7 +38,6 @@ extern NSString *MMTopLeftPointKey;
|
||||
extern NSString *MMOpenInCurrentWindowKey;
|
||||
extern NSString *MMNoFontSubstitutionKey;
|
||||
extern NSString *MMLoginShellKey;
|
||||
extern NSString *MMAtsuiRendererKey;
|
||||
extern NSString *MMUntitledWindowKey;
|
||||
extern NSString *MMTexturedWindowKey;
|
||||
extern NSString *MMZoomBothKey;
|
||||
|
||||
@@ -30,7 +30,6 @@ NSString *MMTopLeftPointKey = @"MMTopLeftPoint";
|
||||
NSString *MMOpenInCurrentWindowKey = @"MMOpenInCurrentWindow";
|
||||
NSString *MMNoFontSubstitutionKey = @"MMNoFontSubstitution";
|
||||
NSString *MMLoginShellKey = @"MMLoginShell";
|
||||
NSString *MMAtsuiRendererKey = @"MMAtsuiRenderer";
|
||||
NSString *MMUntitledWindowKey = @"MMUntitledWindow";
|
||||
NSString *MMTexturedWindowKey = @"MMTexturedWindow";
|
||||
NSString *MMZoomBothKey = @"MMZoomBoth";
|
||||
|
||||
@@ -12,9 +12,6 @@ overview of the MacVim source code.
|
||||
: files from the Vim FTP included
|
||||
`stable`
|
||||
: Used to build the Stable binary distribution
|
||||
`feat/core-text`
|
||||
: Core Text renderer (fast with improved Unicode rendering, but has some
|
||||
: display issues)
|
||||
|
||||
_Note:_ Branches starting with `feat/` are experimental and will be rebased
|
||||
against master occasionally (other branches will not be rebased).
|
||||
|
||||
+52
-29
@@ -19,6 +19,9 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
// HACK! Used in gui.c to determine which string drawing code to use.
|
||||
int use_gui_macvim_draw_string = 1;
|
||||
|
||||
|
||||
// NOTE: The default font is bundled with the application.
|
||||
static NSString *MMDefaultFontName = @"DejaVu Sans Mono";
|
||||
@@ -110,6 +113,46 @@ gui_mch_prepare(int *argc, char **argv)
|
||||
}
|
||||
|
||||
|
||||
/* Called directly after forking (even if we didn't fork). */
|
||||
void
|
||||
gui_macvim_after_fork_init()
|
||||
{
|
||||
ASLInit();
|
||||
ASLogDebug(@"");
|
||||
|
||||
// Restore autosaved rows & columns
|
||||
CFIndex rows, cols;
|
||||
Boolean rowsValid, colsValid;
|
||||
rows = CFPreferencesGetAppIntegerValue((CFStringRef)MMAutosaveRowsKey,
|
||||
kCFPreferencesCurrentApplication,
|
||||
&rowsValid);
|
||||
cols = CFPreferencesGetAppIntegerValue((CFStringRef)MMAutosaveColumnsKey,
|
||||
kCFPreferencesCurrentApplication,
|
||||
&colsValid);
|
||||
if (rowsValid && colsValid
|
||||
&& (rows > 4 && rows < 1000 && cols > 29 && cols < 4000)) {
|
||||
gui.num_rows = rows;
|
||||
gui.num_cols = cols;
|
||||
} else {
|
||||
// Use the defaults (typically 80x24), if there are no autosaved rows &
|
||||
// columns.
|
||||
gui.num_rows = Rows;
|
||||
gui.num_cols = Columns;
|
||||
}
|
||||
|
||||
// Check which code path to take for string drawing.
|
||||
CFIndex val;
|
||||
Boolean keyValid;
|
||||
val = CFPreferencesGetAppIntegerValue((CFStringRef)MMRendererKey,
|
||||
kCFPreferencesCurrentApplication,
|
||||
&keyValid);
|
||||
if (keyValid) {
|
||||
ASLogInfo(@"Use renderer=%d", val);
|
||||
use_gui_macvim_draw_string = (val != MMRendererCoreText);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check if the GUI can be started. Called before gvimrc is sourced.
|
||||
* Return OK or FAIL.
|
||||
@@ -117,29 +160,6 @@ 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;
|
||||
}
|
||||
|
||||
@@ -359,7 +379,7 @@ gui_mch_delete_lines(int row, int num_lines)
|
||||
|
||||
|
||||
void
|
||||
gui_mch_draw_string(int row, int col, char_u *s, int len, int flags)
|
||||
gui_mch_draw_string(int row, int col, char_u *s, int len, int cells, int flags)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
char_u *conv_str = NULL;
|
||||
@@ -370,9 +390,12 @@ gui_mch_draw_string(int row, int col, char_u *s, int len, int flags)
|
||||
}
|
||||
#endif
|
||||
|
||||
[[MMBackend sharedInstance] drawString:(char*)s length:len row:row
|
||||
column:col cells:len flags:flags];
|
||||
|
||||
[[MMBackend sharedInstance] drawString:s
|
||||
length:len
|
||||
row:row
|
||||
column:col
|
||||
cells:cells
|
||||
flags:flags];
|
||||
#ifdef FEAT_MBYTE
|
||||
if (conv_str)
|
||||
vim_free(conv_str);
|
||||
@@ -411,7 +434,7 @@ gui_macvim_draw_string(int row, int col, char_u *s, int len, int flags)
|
||||
if (!utf_iscomposing(c)) {
|
||||
if ((cn > 1 && !wide) || (cn <= 1 && wide)) {
|
||||
// Changed from normal to wide or vice versa.
|
||||
[backend drawString:(char*)(s+start) length:i-start
|
||||
[backend drawString:(s+start) length:i-start
|
||||
row:row column:startcol
|
||||
cells:endcol-startcol
|
||||
flags:(wide ? flags|DRAW_WIDE : flags)];
|
||||
@@ -426,7 +449,7 @@ gui_macvim_draw_string(int row, int col, char_u *s, int len, int flags)
|
||||
}
|
||||
|
||||
// Output remaining characters.
|
||||
[backend drawString:(char*)(s+start) length:len-start
|
||||
[backend drawString:(s+start) length:len-start
|
||||
row:row column:startcol cells:endcol-startcol
|
||||
flags:(wide ? flags|DRAW_WIDE : flags)];
|
||||
|
||||
|
||||
Vendored
+54
-6
@@ -5761,6 +5761,7 @@ echo "${ECHO_T}$rubyhdrdir" >&6; }
|
||||
rubylibdir=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG["libdir"])'`
|
||||
if test -d "/System/Library/Frameworks/Ruby.framework"; then
|
||||
RUBY_LIBS="-framework Ruby"
|
||||
RUBY_CFLAGS=
|
||||
librubyarg=
|
||||
elif test -f "$rubylibdir/$librubyarg"; then
|
||||
librubyarg="$rubylibdir/$librubyarg"
|
||||
@@ -5785,11 +5786,6 @@ echo "${ECHO_T}$rubyhdrdir" >&6; }
|
||||
RUBY_OBJ="objects/if_ruby.o"
|
||||
RUBY_PRO="if_ruby.pro"
|
||||
|
||||
if test -n "$MACSDK"; then
|
||||
RUBY_CFLAGS=
|
||||
RUBY_LIBS="-framework Ruby"
|
||||
fi
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define FEAT_RUBY 1
|
||||
_ACEOF
|
||||
@@ -13563,11 +13559,12 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for ac_func in bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \
|
||||
getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
|
||||
memset nanosleep opendir putenv qsort readlink select setenv \
|
||||
memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
|
||||
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
|
||||
sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
||||
strnicmp strpbrk strtol tgetent towlower towupper iswupper \
|
||||
@@ -14656,6 +14653,57 @@ else
|
||||
echo "${ECHO_T}yes" >&6; }
|
||||
fi
|
||||
|
||||
{ echo "$as_me:$LINENO: checking for FD_CLOEXEC" >&5
|
||||
echo $ECHO_N "checking for FD_CLOEXEC... $ECHO_C" >&6; }
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
#if HAVE_FCNTL_H
|
||||
# include <fcntl.h>
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int flag = FD_CLOEXEC;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext
|
||||
if { (ac_try="$ac_compile"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_compile") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_c_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest.$ac_objext; then
|
||||
{ echo "$as_me:$LINENO: result: yes" >&5
|
||||
echo "${ECHO_T}yes" >&6; }; cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_FD_CLOEXEC 1
|
||||
_ACEOF
|
||||
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
{ echo "$as_me:$LINENO: result: not usable" >&5
|
||||
echo "${ECHO_T}not usable" >&6; }
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
{ echo "$as_me:$LINENO: checking for rename" >&5
|
||||
echo $ECHO_N "checking for rename... $ECHO_C" >&6; }
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
|
||||
+6
-1
@@ -187,9 +187,14 @@ buf_init_chartab(buf, global)
|
||||
if (VIM_ISDIGIT(*p))
|
||||
c2 = getdigits(&p);
|
||||
else
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
c2 = mb_ptr2char_adv(&p);
|
||||
else
|
||||
#endif
|
||||
c2 = *p++;
|
||||
}
|
||||
if (c <= 0 || (c2 < c && c2 != -1) || c2 >= 256
|
||||
if (c <= 0 || c >= 256 || (c2 < c && c2 != -1) || c2 >= 256
|
||||
|| !(*p == NUL || *p == ','))
|
||||
return FAIL;
|
||||
|
||||
|
||||
@@ -157,6 +157,7 @@
|
||||
#undef HAVE_LSTAT
|
||||
#undef HAVE_MEMCMP
|
||||
#undef HAVE_MEMSET
|
||||
#undef HAVE_MKDTEMP
|
||||
#undef HAVE_NANOSLEEP
|
||||
#undef HAVE_OPENDIR
|
||||
#undef HAVE_FLOAT_FUNCS
|
||||
@@ -387,3 +388,6 @@
|
||||
|
||||
/* Define if you want XSMP interaction as well as vanilla swapfile safety */
|
||||
#undef USE_XSMP_INTERACT
|
||||
|
||||
/* Define if fcntl()'s F_SETFD command knows about FD_CLOEXEC */
|
||||
#undef HAVE_FD_CLOEXEC
|
||||
|
||||
Vendored
+2
-6
@@ -5761,6 +5761,7 @@ echo "${ECHO_T}$rubyhdrdir" >&6; }
|
||||
rubylibdir=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG["libdir"])'`
|
||||
if test -d "/System/Library/Frameworks/Ruby.framework"; then
|
||||
RUBY_LIBS="-framework Ruby"
|
||||
RUBY_CFLAGS=
|
||||
librubyarg=
|
||||
elif test -f "$rubylibdir/$librubyarg"; then
|
||||
librubyarg="$rubylibdir/$librubyarg"
|
||||
@@ -5785,11 +5786,6 @@ echo "${ECHO_T}$rubyhdrdir" >&6; }
|
||||
RUBY_OBJ="objects/if_ruby.o"
|
||||
RUBY_PRO="if_ruby.pro"
|
||||
|
||||
if test -n "$MACSDK"; then
|
||||
RUBY_CFLAGS=
|
||||
RUBY_LIBS="-framework Ruby"
|
||||
fi
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define FEAT_RUBY 1
|
||||
_ACEOF
|
||||
@@ -16552,7 +16548,7 @@ echo "${ECHO_T}no" >&6; }
|
||||
{ echo "$as_me:$LINENO: checking whether we need -D_FORTIFY_SOURCE=1" >&5
|
||||
echo $ECHO_N "checking whether we need -D_FORTIFY_SOURCE=1... $ECHO_C" >&6; }
|
||||
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'`
|
||||
{ echo "$as_me:$LINENO: result: yes" >&5
|
||||
echo "${ECHO_T}yes" >&6; }
|
||||
else
|
||||
|
||||
+13
-9
@@ -1000,6 +1000,8 @@ if test "$enable_rubyinterp" = "yes"; 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"
|
||||
dnl Don't include the -I flag when -framework is set
|
||||
RUBY_CFLAGS=
|
||||
librubyarg=
|
||||
elif test -f "$rubylibdir/$librubyarg"; then
|
||||
librubyarg="$rubylibdir/$librubyarg"
|
||||
@@ -1028,14 +1030,6 @@ if test "$enable_rubyinterp" = "yes"; then
|
||||
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)
|
||||
@@ -2706,7 +2700,7 @@ fi
|
||||
dnl Check for functions in one big call, to reduce the size of configure
|
||||
AC_CHECK_FUNCS(bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \
|
||||
getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
|
||||
memset nanosleep opendir putenv qsort readlink select setenv \
|
||||
memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
|
||||
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
|
||||
sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
||||
strnicmp strpbrk strtol tgetent towlower towupper iswupper \
|
||||
@@ -2926,6 +2920,16 @@ else
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
|
||||
dnl make sure the FD_CLOEXEC flag for fcntl()'s F_SETFD command is known
|
||||
AC_MSG_CHECKING(for FD_CLOEXEC)
|
||||
AC_TRY_COMPILE(
|
||||
[#if HAVE_FCNTL_H
|
||||
# include <fcntl.h>
|
||||
#endif],
|
||||
[ int flag = FD_CLOEXEC;],
|
||||
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FD_CLOEXEC),
|
||||
AC_MSG_RESULT(not usable))
|
||||
|
||||
dnl rename needs to be checked separately to work on Nextstep with cc
|
||||
AC_MSG_CHECKING(for rename)
|
||||
AC_TRY_LINK([#include <stdio.h>], [rename("this", "that")],
|
||||
|
||||
+77
-33
@@ -181,7 +181,7 @@ static void ins_redraw __ARGS((int ready));
|
||||
static void ins_ctrl_v __ARGS((void));
|
||||
static void undisplay_dollar __ARGS((void));
|
||||
static void insert_special __ARGS((int, int, int));
|
||||
static void internal_format __ARGS((int textwidth, int second_indent, int flags, int format_only));
|
||||
static void internal_format __ARGS((int textwidth, int second_indent, int flags, int format_only, int c));
|
||||
static void check_auto_format __ARGS((int));
|
||||
static void redo_literal __ARGS((int c));
|
||||
static void start_arrow __ARGS((pos_T *end_insert_pos));
|
||||
@@ -2164,7 +2164,7 @@ ins_compl_add_infercase(str, len, icase, fname, dir, flags)
|
||||
int i, c;
|
||||
int actual_len; /* Take multi-byte characters */
|
||||
int actual_compl_length; /* into account. */
|
||||
int *wca; /* Wide character array. */
|
||||
int *wca; /* Wide character array. */
|
||||
int has_lower = FALSE;
|
||||
int was_letter = FALSE;
|
||||
|
||||
@@ -5558,7 +5558,7 @@ insertchar(c, flags, second_indent)
|
||||
}
|
||||
if (do_internal)
|
||||
#endif
|
||||
internal_format(textwidth, second_indent, flags, c == NUL);
|
||||
internal_format(textwidth, second_indent, flags, c == NUL, c);
|
||||
}
|
||||
|
||||
if (c == NUL) /* only formatting was wanted */
|
||||
@@ -5738,11 +5738,12 @@ insertchar(c, flags, second_indent)
|
||||
* Format text at the current insert position.
|
||||
*/
|
||||
static void
|
||||
internal_format(textwidth, second_indent, flags, format_only)
|
||||
internal_format(textwidth, second_indent, flags, format_only, c)
|
||||
int textwidth;
|
||||
int second_indent;
|
||||
int flags;
|
||||
int format_only;
|
||||
int c; /* character to be inserted (can be NUL) */
|
||||
{
|
||||
int cc;
|
||||
int save_char = NUL;
|
||||
@@ -5763,7 +5764,11 @@ internal_format(textwidth, second_indent, flags, format_only)
|
||||
* When 'ai' is off we don't want a space under the cursor to be
|
||||
* deleted. Replace it with an 'x' temporarily.
|
||||
*/
|
||||
if (!curbuf->b_p_ai)
|
||||
if (!curbuf->b_p_ai
|
||||
#ifdef FEAT_VREPLACE
|
||||
&& !(State & VREPLACE_FLAG)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
cc = gchar_cursor();
|
||||
if (vim_iswhite(cc))
|
||||
@@ -5789,9 +5794,11 @@ internal_format(textwidth, second_indent, flags, format_only)
|
||||
char_u *saved_text = NULL;
|
||||
#endif
|
||||
colnr_T col;
|
||||
colnr_T end_col;
|
||||
|
||||
virtcol = get_nolist_virtcol();
|
||||
if (virtcol < (colnr_T)textwidth)
|
||||
virtcol = get_nolist_virtcol()
|
||||
+ char2cells(c != NUL ? c : gchar_cursor());
|
||||
if (virtcol <= (colnr_T)textwidth)
|
||||
break;
|
||||
|
||||
#ifdef FEAT_COMMENTS
|
||||
@@ -5831,12 +5838,7 @@ internal_format(textwidth, second_indent, flags, format_only)
|
||||
coladvance((colnr_T)textwidth);
|
||||
wantcol = curwin->w_cursor.col;
|
||||
|
||||
curwin->w_cursor.col = startcol - 1;
|
||||
#ifdef FEAT_MBYTE
|
||||
/* Correct cursor for multi-byte character. */
|
||||
if (has_mbyte)
|
||||
mb_adjust_cursor();
|
||||
#endif
|
||||
curwin->w_cursor.col = startcol;
|
||||
foundcol = 0;
|
||||
|
||||
/*
|
||||
@@ -5847,11 +5849,14 @@ internal_format(textwidth, second_indent, flags, format_only)
|
||||
|| curwin->w_cursor.lnum != Insstart.lnum
|
||||
|| curwin->w_cursor.col >= Insstart.col)
|
||||
{
|
||||
cc = gchar_cursor();
|
||||
if (curwin->w_cursor.col == startcol && c != NUL)
|
||||
cc = c;
|
||||
else
|
||||
cc = gchar_cursor();
|
||||
if (WHITECHAR(cc))
|
||||
{
|
||||
/* remember position of blank just before text */
|
||||
end_foundcol = curwin->w_cursor.col;
|
||||
end_col = curwin->w_cursor.col;
|
||||
|
||||
/* find start of sequence of blanks */
|
||||
while (curwin->w_cursor.col > 0 && WHITECHAR(cc))
|
||||
@@ -5871,7 +5876,11 @@ internal_format(textwidth, second_indent, flags, format_only)
|
||||
/* do not break after one-letter words */
|
||||
if (curwin->w_cursor.col == 0)
|
||||
break; /* one-letter word at begin */
|
||||
|
||||
#ifdef FEAT_COMMENTS
|
||||
/* do not break "#a b" when 'tw' is 2 */
|
||||
if (curwin->w_cursor.col <= leader_len)
|
||||
break;
|
||||
#endif
|
||||
col = curwin->w_cursor.col;
|
||||
dec_cursor();
|
||||
cc = gchar_cursor();
|
||||
@@ -5880,26 +5889,60 @@ internal_format(textwidth, second_indent, flags, format_only)
|
||||
continue; /* one-letter, continue */
|
||||
curwin->w_cursor.col = col;
|
||||
}
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
foundcol = curwin->w_cursor.col
|
||||
+ (*mb_ptr2len)(ml_get_cursor());
|
||||
else
|
||||
#endif
|
||||
foundcol = curwin->w_cursor.col + 1;
|
||||
if (curwin->w_cursor.col < (colnr_T)wantcol)
|
||||
|
||||
inc_cursor();
|
||||
|
||||
end_foundcol = end_col + 1;
|
||||
foundcol = curwin->w_cursor.col;
|
||||
if (curwin->w_cursor.col <= (colnr_T)wantcol)
|
||||
break;
|
||||
}
|
||||
#ifdef FEAT_MBYTE
|
||||
else if (cc >= 0x100 && fo_multibyte
|
||||
&& curwin->w_cursor.col <= (colnr_T)wantcol)
|
||||
else if (cc >= 0x100 && fo_multibyte)
|
||||
{
|
||||
/* Break after or before a multi-byte character. */
|
||||
if (curwin->w_cursor.col != startcol)
|
||||
{
|
||||
#ifdef FEAT_COMMENTS
|
||||
/* Don't break until after the comment leader */
|
||||
if (curwin->w_cursor.col < leader_len)
|
||||
break;
|
||||
#endif
|
||||
col = curwin->w_cursor.col;
|
||||
inc_cursor();
|
||||
/* Don't change end_foundcol if already set. */
|
||||
if (foundcol != curwin->w_cursor.col)
|
||||
{
|
||||
foundcol = curwin->w_cursor.col;
|
||||
end_foundcol = foundcol;
|
||||
if (curwin->w_cursor.col <= (colnr_T)wantcol)
|
||||
break;
|
||||
}
|
||||
curwin->w_cursor.col = col;
|
||||
}
|
||||
|
||||
if (curwin->w_cursor.col == 0)
|
||||
break;
|
||||
|
||||
col = curwin->w_cursor.col;
|
||||
|
||||
dec_cursor();
|
||||
cc = gchar_cursor();
|
||||
|
||||
if (WHITECHAR(cc))
|
||||
continue; /* break with space */
|
||||
#ifdef FEAT_COMMENTS
|
||||
/* Don't break until after the comment leader */
|
||||
if (curwin->w_cursor.col < leader_len)
|
||||
break;
|
||||
#endif
|
||||
|
||||
curwin->w_cursor.col = col;
|
||||
|
||||
foundcol = curwin->w_cursor.col;
|
||||
if (curwin->w_cursor.col < (colnr_T)wantcol)
|
||||
foundcol += (*mb_char2len)(cc);
|
||||
end_foundcol = foundcol;
|
||||
break;
|
||||
if (curwin->w_cursor.col <= (colnr_T)wantcol)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
if (curwin->w_cursor.col == 0)
|
||||
@@ -5926,14 +5969,15 @@ internal_format(textwidth, second_indent, flags, format_only)
|
||||
orig_col = startcol; /* Will start backspacing from here */
|
||||
else
|
||||
#endif
|
||||
replace_offset = startcol - end_foundcol - 1;
|
||||
replace_offset = startcol - end_foundcol;
|
||||
|
||||
/*
|
||||
* adjust startcol for spaces that will be deleted and
|
||||
* characters that will remain on top line
|
||||
*/
|
||||
curwin->w_cursor.col = foundcol;
|
||||
while (cc = gchar_cursor(), WHITECHAR(cc))
|
||||
while ((cc = gchar_cursor(), WHITECHAR(cc))
|
||||
&& (!fo_white_par || curwin->w_cursor.col < startcol))
|
||||
inc_cursor();
|
||||
startcol -= curwin->w_cursor.col;
|
||||
if (startcol < 0)
|
||||
@@ -8509,7 +8553,7 @@ ins_bs(c, mode, inserted_space_p)
|
||||
if (mode == BACKSPACE_LINE
|
||||
&& (curbuf->b_p_ai
|
||||
#ifdef FEAT_CINDENT
|
||||
|| cindent_on()
|
||||
|| cindent_on()
|
||||
#endif
|
||||
)
|
||||
#ifdef FEAT_RIGHTLEFT
|
||||
@@ -8519,7 +8563,7 @@ ins_bs(c, mode, inserted_space_p)
|
||||
{
|
||||
save_col = curwin->w_cursor.col;
|
||||
beginline(BL_WHITE);
|
||||
if (curwin->w_cursor.col < (colnr_T)temp)
|
||||
if (curwin->w_cursor.col < save_col)
|
||||
mincol = curwin->w_cursor.col;
|
||||
curwin->w_cursor.col = save_col;
|
||||
}
|
||||
|
||||
+26
-11
@@ -988,13 +988,14 @@ var_redir_start(name, append)
|
||||
int err;
|
||||
typval_T tv;
|
||||
|
||||
/* Make sure a valid variable name is specified */
|
||||
/* Catch a bad name early. */
|
||||
if (!eval_isnamec1(*name))
|
||||
{
|
||||
EMSG(_(e_invarg));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
/* Make a copy of the name, it is used in redir_lval until redir ends. */
|
||||
redir_varname = vim_strsave(name);
|
||||
if (redir_varname == NULL)
|
||||
return FAIL;
|
||||
@@ -1019,6 +1020,7 @@ var_redir_start(name, append)
|
||||
EMSG(_(e_trailing));
|
||||
else
|
||||
EMSG(_(e_invarg));
|
||||
redir_endp = NULL; /* don't store a value, only cleanup */
|
||||
var_redir_stop();
|
||||
return FAIL;
|
||||
}
|
||||
@@ -1037,6 +1039,7 @@ var_redir_start(name, append)
|
||||
did_emsg |= save_emsg;
|
||||
if (err)
|
||||
{
|
||||
redir_endp = NULL; /* don't store a value, only cleanup */
|
||||
var_redir_stop();
|
||||
return FAIL;
|
||||
}
|
||||
@@ -1085,6 +1088,7 @@ var_redir_str(value, value_len)
|
||||
|
||||
/*
|
||||
* Stop redirecting command output to a variable.
|
||||
* Frees the allocated memory.
|
||||
*/
|
||||
void
|
||||
var_redir_stop()
|
||||
@@ -1093,14 +1097,18 @@ var_redir_stop()
|
||||
|
||||
if (redir_lval != NULL)
|
||||
{
|
||||
/* Append the trailing NUL. */
|
||||
ga_append(&redir_ga, NUL);
|
||||
/* If there was no error: assign the text to the variable. */
|
||||
if (redir_endp != NULL)
|
||||
{
|
||||
ga_append(&redir_ga, NUL); /* Append the trailing NUL. */
|
||||
tv.v_type = VAR_STRING;
|
||||
tv.vval.v_string = redir_ga.ga_data;
|
||||
set_var_lval(redir_lval, redir_endp, &tv, FALSE, (char_u *)".");
|
||||
}
|
||||
|
||||
/* Assign the text to the variable. */
|
||||
tv.v_type = VAR_STRING;
|
||||
tv.vval.v_string = redir_ga.ga_data;
|
||||
set_var_lval(redir_lval, redir_endp, &tv, FALSE, (char_u *)".");
|
||||
vim_free(tv.vval.v_string);
|
||||
/* free the collected output */
|
||||
vim_free(redir_ga.ga_data);
|
||||
redir_ga.ga_data = NULL;
|
||||
|
||||
clear_lval(redir_lval);
|
||||
vim_free(redir_lval);
|
||||
@@ -9921,6 +9929,7 @@ filter_map(argvars, rettv, map)
|
||||
int todo;
|
||||
char_u *ermsg = map ? (char_u *)"map()" : (char_u *)"filter()";
|
||||
int save_did_emsg;
|
||||
int index = 0;
|
||||
|
||||
if (argvars[0].v_type == VAR_LIST)
|
||||
{
|
||||
@@ -9954,9 +9963,9 @@ filter_map(argvars, rettv, map)
|
||||
save_did_emsg = did_emsg;
|
||||
did_emsg = FALSE;
|
||||
|
||||
prepare_vimvar(VV_KEY, &save_key);
|
||||
if (argvars[0].v_type == VAR_DICT)
|
||||
{
|
||||
prepare_vimvar(VV_KEY, &save_key);
|
||||
vimvars[VV_KEY].vv_type = VAR_STRING;
|
||||
|
||||
ht = &d->dv_hashtab;
|
||||
@@ -9980,24 +9989,27 @@ filter_map(argvars, rettv, map)
|
||||
}
|
||||
}
|
||||
hash_unlock(ht);
|
||||
|
||||
restore_vimvar(VV_KEY, &save_key);
|
||||
}
|
||||
else
|
||||
{
|
||||
vimvars[VV_KEY].vv_type = VAR_NUMBER;
|
||||
|
||||
for (li = l->lv_first; li != NULL; li = nli)
|
||||
{
|
||||
if (tv_check_lock(li->li_tv.v_lock, ermsg))
|
||||
break;
|
||||
nli = li->li_next;
|
||||
vimvars[VV_KEY].vv_nr = index;
|
||||
if (filter_map_one(&li->li_tv, expr, map, &rem) == FAIL
|
||||
|| did_emsg)
|
||||
break;
|
||||
if (!map && rem)
|
||||
listitem_remove(l, li);
|
||||
++index;
|
||||
}
|
||||
}
|
||||
|
||||
restore_vimvar(VV_KEY, &save_key);
|
||||
restore_vimvar(VV_VAL, &save_val);
|
||||
|
||||
did_emsg |= save_did_emsg;
|
||||
@@ -11735,6 +11747,9 @@ f_has(argvars, rettv)
|
||||
#ifdef FEAT_SNIFF
|
||||
"sniff",
|
||||
#endif
|
||||
#ifdef STARTUPTIME
|
||||
"startuptime",
|
||||
#endif
|
||||
#ifdef FEAT_STL_OPT
|
||||
"statusline",
|
||||
#endif
|
||||
|
||||
+4
-4
@@ -8378,6 +8378,7 @@ ex_at(eap)
|
||||
exarg_T *eap;
|
||||
{
|
||||
int c;
|
||||
int prev_len = typebuf.tb_len;
|
||||
|
||||
curwin->w_cursor.lnum = eap->line2;
|
||||
|
||||
@@ -8403,11 +8404,10 @@ ex_at(eap)
|
||||
|
||||
/*
|
||||
* Execute from the typeahead buffer.
|
||||
* Originally this didn't check for the typeahead buffer to be empty,
|
||||
* thus could read more Ex commands from stdin. It's not clear why,
|
||||
* it is certainly unexpected.
|
||||
* Continue until the stuff buffer is empty and all added characters
|
||||
* have been consumed.
|
||||
*/
|
||||
while ((!stuff_empty() || typebuf.tb_len > 0) && vpeekc() == ':')
|
||||
while (!stuff_empty() || typebuf.tb_len > prev_len)
|
||||
(void)do_cmdline(NULL, getexline, NULL, DOCMD_NOWAIT|DOCMD_VERBOSE);
|
||||
|
||||
exec_from_reg = save_efr;
|
||||
|
||||
+7
-3
@@ -852,10 +852,14 @@
|
||||
/* #define DEBUG */
|
||||
|
||||
/*
|
||||
* STARTUPTIME Time the startup process. Writes a "vimstartup" file
|
||||
* with timestamps.
|
||||
* STARTUPTIME Time the startup process. Writes a file with
|
||||
* timestamps.
|
||||
*/
|
||||
/* #define STARTUPTIME "vimstartup" */
|
||||
#if defined(FEAT_NORMAL) \
|
||||
&& ((defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)) \
|
||||
|| defined(WIN3264))
|
||||
# define STARTUPTIME 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* MEM_PROFILE Debugging of memory allocation and freeing.
|
||||
|
||||
+67
-33
@@ -146,6 +146,9 @@ static int get_mac_fio_flags __ARGS((char_u *ptr));
|
||||
# endif
|
||||
#endif
|
||||
static int move_lines __ARGS((buf_T *frombuf, buf_T *tobuf));
|
||||
#ifdef TEMPDIRNAMES
|
||||
static void vim_settempdir __ARGS((char_u *tempdir));
|
||||
#endif
|
||||
#ifdef FEAT_AUTOCMD
|
||||
static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer name");
|
||||
#endif
|
||||
@@ -2253,6 +2256,14 @@ failed:
|
||||
|
||||
if (!read_buffer && !read_stdin)
|
||||
close(fd); /* errors are ignored */
|
||||
#ifdef HAVE_FD_CLOEXEC
|
||||
else
|
||||
{
|
||||
int fdflags = fcntl(fd, F_GETFD);
|
||||
if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0)
|
||||
fcntl(fd, F_SETFD, fdflags | FD_CLOEXEC);
|
||||
}
|
||||
#endif
|
||||
vim_free(buffer);
|
||||
|
||||
#ifdef HAVE_DUP
|
||||
@@ -7024,6 +7035,35 @@ vim_deltempdir()
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TEMPDIRNAMES
|
||||
/*
|
||||
* Directory "tempdir" was created. Expand this name to a full path and put
|
||||
* it in "vim_tempdir". This avoids that using ":cd" would confuse us.
|
||||
* "tempdir" must be no longer than MAXPATHL.
|
||||
*/
|
||||
static void
|
||||
vim_settempdir(tempdir)
|
||||
char_u *tempdir;
|
||||
{
|
||||
char_u *buf;
|
||||
|
||||
buf = alloc((unsigned)MAXPATHL + 2);
|
||||
if (buf != NULL)
|
||||
{
|
||||
if (vim_FullName(tempdir, buf, MAXPATHL, FALSE) == FAIL)
|
||||
STRCPY(buf, tempdir);
|
||||
# ifdef __EMX__
|
||||
if (vim_strchr(buf, '/') != NULL)
|
||||
STRCAT(buf, "/");
|
||||
else
|
||||
# endif
|
||||
add_pathsep(buf);
|
||||
vim_tempdir = vim_strsave(buf);
|
||||
vim_free(buf);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* vim_tempname(): Return a unique name that can be used for a temp file.
|
||||
*
|
||||
@@ -7045,8 +7085,6 @@ vim_tempname(extra_char)
|
||||
#ifdef TEMPDIRNAMES
|
||||
static char *(tempdirs[]) = {TEMPDIRNAMES};
|
||||
int i;
|
||||
long nr;
|
||||
long off;
|
||||
# ifndef EEXIST
|
||||
struct stat st;
|
||||
# endif
|
||||
@@ -7065,6 +7103,12 @@ vim_tempname(extra_char)
|
||||
*/
|
||||
for (i = 0; i < (int)(sizeof(tempdirs) / sizeof(char *)); ++i)
|
||||
{
|
||||
size_t itmplen;
|
||||
# ifndef HAVE_MKDTEMP
|
||||
long nr;
|
||||
long off;
|
||||
# endif
|
||||
|
||||
/* expand $TMP, leave room for "/v1100000/999999999" */
|
||||
expand_env((char_u *)tempdirs[i], itmp, TEMPNAMELEN - 20);
|
||||
if (mch_isdir(itmp)) /* directory exists */
|
||||
@@ -7078,7 +7122,14 @@ vim_tempname(extra_char)
|
||||
else
|
||||
# endif
|
||||
add_pathsep(itmp);
|
||||
itmplen = STRLEN(itmp);
|
||||
|
||||
# ifdef HAVE_MKDTEMP
|
||||
/* Leave room for filename */
|
||||
STRCAT(itmp, "vXXXXXX");
|
||||
if (mkdtemp((char *)itmp) != NULL)
|
||||
vim_settempdir(itmp);
|
||||
# else
|
||||
/* Get an arbitrary number of up to 6 digits. When it's
|
||||
* unlikely that it already exists it will be faster,
|
||||
* otherwise it doesn't matter. The use of mkdir() avoids any
|
||||
@@ -7090,59 +7141,41 @@ vim_tempname(extra_char)
|
||||
for (off = 0; off < 10000L; ++off)
|
||||
{
|
||||
int r;
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
# if defined(UNIX) || defined(VMS)
|
||||
mode_t umask_save;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
sprintf((char *)itmp + STRLEN(itmp), "v%ld", nr + off);
|
||||
# ifndef EEXIST
|
||||
sprintf((char *)itmp + itmplen, "v%ld", nr + off);
|
||||
# ifndef EEXIST
|
||||
/* If mkdir() does not set errno to EEXIST, check for
|
||||
* existing file here. There is a race condition then,
|
||||
* although it's fail-safe. */
|
||||
if (mch_stat((char *)itmp, &st) >= 0)
|
||||
continue;
|
||||
# endif
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
# endif
|
||||
# if defined(UNIX) || defined(VMS)
|
||||
/* Make sure the umask doesn't remove the executable bit.
|
||||
* "repl" has been reported to use "177". */
|
||||
umask_save = umask(077);
|
||||
#endif
|
||||
# endif
|
||||
r = vim_mkdir(itmp, 0700);
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
# if defined(UNIX) || defined(VMS)
|
||||
(void)umask(umask_save);
|
||||
#endif
|
||||
# endif
|
||||
if (r == 0)
|
||||
{
|
||||
char_u *buf;
|
||||
|
||||
/* Directory was created, use this name.
|
||||
* Expand to full path; When using the current
|
||||
* directory a ":cd" would confuse us. */
|
||||
buf = alloc((unsigned)MAXPATHL + 1);
|
||||
if (buf != NULL)
|
||||
{
|
||||
if (vim_FullName(itmp, buf, MAXPATHL, FALSE)
|
||||
== FAIL)
|
||||
STRCPY(buf, itmp);
|
||||
# ifdef __EMX__
|
||||
if (vim_strchr(buf, '/') != NULL)
|
||||
STRCAT(buf, "/");
|
||||
else
|
||||
# endif
|
||||
add_pathsep(buf);
|
||||
vim_tempdir = vim_strsave(buf);
|
||||
vim_free(buf);
|
||||
}
|
||||
vim_settempdir(itmp);
|
||||
break;
|
||||
}
|
||||
# ifdef EEXIST
|
||||
# ifdef EEXIST
|
||||
/* If the mkdir() didn't fail because the file/dir exists,
|
||||
* we probably can't create any dir here, try another
|
||||
* place. */
|
||||
if (errno != EEXIST)
|
||||
# endif
|
||||
# endif
|
||||
break;
|
||||
}
|
||||
# endif /* HAVE_MKDTEMP */
|
||||
if (vim_tempdir != NULL)
|
||||
break;
|
||||
}
|
||||
@@ -8614,6 +8647,7 @@ aucmd_restbuf(aco)
|
||||
curwin = firstwin;
|
||||
# ifdef FEAT_EVAL
|
||||
vars_clear(&aucmd_win->w_vars.dv_hashtab); /* free all w: variables */
|
||||
hash_init(&aucmd_win->w_vars.dv_hashtab); /* re-use the hashtab */
|
||||
# endif
|
||||
#else
|
||||
curwin = aco->save_curwin;
|
||||
|
||||
+39
-3
@@ -1932,7 +1932,7 @@ get_foldtext(wp, lnum, lnume, foldinfo, buf)
|
||||
#ifdef FEAT_EVAL
|
||||
if (*wp->w_p_fdt != NUL)
|
||||
{
|
||||
char_u dashes[51];
|
||||
char_u dashes[MAX_LEVEL + 2];
|
||||
win_T *save_curwin;
|
||||
int level;
|
||||
char_u *p;
|
||||
@@ -1944,8 +1944,8 @@ get_foldtext(wp, lnum, lnume, foldinfo, buf)
|
||||
/* Set "v:folddashes" to a string of "level" dashes. */
|
||||
/* Set "v:foldlevel" to "level". */
|
||||
level = foldinfo->fi_level;
|
||||
if (level > 50)
|
||||
level = 50;
|
||||
if (level > (int)sizeof(dashes) - 1)
|
||||
level = (int)sizeof(dashes) - 1;
|
||||
vim_memset(dashes, '-', (size_t)level);
|
||||
dashes[level] = NUL;
|
||||
set_vim_var_string(VV_FOLDDASHES, dashes, -1);
|
||||
@@ -2256,6 +2256,40 @@ foldUpdateIEMS(wp, top, bot)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If folding is defined by the syntax, it is possible that a change in
|
||||
* one line will cause all sub-folds of the current fold to change (e.g.,
|
||||
* closing a C-style comment can cause folds in the subsequent lines to
|
||||
* appear). To take that into account we should adjust the value of "bot"
|
||||
* to point to the end of the current fold:
|
||||
*/
|
||||
if (foldlevelSyntax == getlevel)
|
||||
{
|
||||
garray_T *gap = &wp->w_folds;
|
||||
fold_T *fp = NULL;
|
||||
int current_fdl = 0;
|
||||
linenr_T fold_start_lnum = 0;
|
||||
linenr_T lnum_rel = fline.lnum;
|
||||
|
||||
while (current_fdl < fline.lvl)
|
||||
{
|
||||
if (!foldFind(gap, lnum_rel, &fp))
|
||||
break;
|
||||
++current_fdl;
|
||||
|
||||
fold_start_lnum += fp->fd_top;
|
||||
gap = &fp->fd_nested;
|
||||
lnum_rel -= fp->fd_top;
|
||||
}
|
||||
if (fp != NULL && current_fdl == fline.lvl)
|
||||
{
|
||||
linenr_T fold_end_lnum = fold_start_lnum + fp->fd_len;
|
||||
|
||||
if (fold_end_lnum > bot)
|
||||
bot = fold_end_lnum;
|
||||
}
|
||||
}
|
||||
|
||||
start = fline.lnum;
|
||||
end = bot;
|
||||
/* Do at least one line. */
|
||||
@@ -2817,6 +2851,8 @@ foldSplit(gap, i, top, bot)
|
||||
fp[1].fd_top = bot + 1;
|
||||
fp[1].fd_len = fp->fd_len - (fp[1].fd_top - fp->fd_top);
|
||||
fp[1].fd_flags = fp->fd_flags;
|
||||
fp[1].fd_small = MAYBE;
|
||||
fp->fd_small = MAYBE;
|
||||
|
||||
/* Move nested folds below bot to new fold. There can't be
|
||||
* any between top and bot, they have been removed by the caller. */
|
||||
|
||||
+5
-5
@@ -22,7 +22,7 @@
|
||||
* These buffers are used for storing:
|
||||
* - stuffed characters: A command that is translated into another command.
|
||||
* - redo characters: will redo the last change.
|
||||
* - recorded chracters: for the "q" command.
|
||||
* - recorded characters: for the "q" command.
|
||||
*
|
||||
* The bytes are stored like in the typeahead buffer:
|
||||
* - K_SPECIAL introduces a special key (two more bytes follow). A literal
|
||||
@@ -1283,7 +1283,7 @@ free_typebuf()
|
||||
EMSG2(_(e_intern2), "Free typebuf 1");
|
||||
else
|
||||
vim_free(typebuf.tb_buf);
|
||||
if (typebuf.tb_buf == noremapbuf_init)
|
||||
if (typebuf.tb_noremap == noremapbuf_init)
|
||||
EMSG2(_(e_intern2), "Free typebuf 2");
|
||||
else
|
||||
vim_free(typebuf.tb_noremap);
|
||||
@@ -1516,7 +1516,7 @@ updatescript(c)
|
||||
* wanted.
|
||||
* This translates escaped K_SPECIAL and CSI bytes to a K_SPECIAL or CSI byte.
|
||||
* Collects the bytes of a multibyte character into the whole character.
|
||||
* Returns the modifers in the global "mod_mask".
|
||||
* Returns the modifiers in the global "mod_mask".
|
||||
*/
|
||||
int
|
||||
vgetc()
|
||||
@@ -3320,7 +3320,7 @@ do_map(maptype, arg, mode, abbrev)
|
||||
retval = 1;
|
||||
goto theend;
|
||||
}
|
||||
/* An abbrevation cannot contain white space. */
|
||||
/* An abbreviation cannot contain white space. */
|
||||
for (n = 0; n < len; ++n)
|
||||
if (vim_iswhite(keys[n]))
|
||||
{
|
||||
@@ -4272,7 +4272,7 @@ check_abbr(c, ptr, col, mincol)
|
||||
|
||||
/*
|
||||
* Check for word before the cursor: If it ends in a keyword char all
|
||||
* chars before it must be al keyword chars or non-keyword chars, but not
|
||||
* chars before it must be keyword chars or non-keyword chars, but not
|
||||
* white space. If it ends in a non-keyword char we accept any characters
|
||||
* before it except white space.
|
||||
*/
|
||||
|
||||
@@ -1569,6 +1569,10 @@ EXTERN int xsmp_icefd INIT(= -1); /* The actual connection */
|
||||
/* For undo we need to know the lowest time possible. */
|
||||
EXTERN time_t starttime;
|
||||
|
||||
#ifdef STARTUPTIME
|
||||
EXTERN FILE *time_fd INIT(= NULL); /* where to write startup timing */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Some compilers warn for not using a return value, but in some situations we
|
||||
* can't do anything useful with the value. Assign to this variable to avoid
|
||||
|
||||
@@ -2237,11 +2237,16 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
|
||||
#ifdef HAVE_GTK2
|
||||
/* The value returned is the length in display cells */
|
||||
len = gui_gtk2_draw_string(gui.row, col, s, len, draw_flags);
|
||||
#elif defined(FEAT_GUI_MACVIM) && defined(FEAT_MBYTE)
|
||||
/* The value returned is the length in display cells */
|
||||
len = gui_macvim_draw_string(gui.row, col, s, len, draw_flags);
|
||||
#else
|
||||
# ifdef FEAT_MBYTE
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
if (use_gui_macvim_draw_string)
|
||||
{
|
||||
/* The value returned is the length in display cells */
|
||||
len = gui_macvim_draw_string(gui.row, col, s, len, draw_flags);
|
||||
}
|
||||
else
|
||||
# endif
|
||||
if (enc_utf8)
|
||||
{
|
||||
int start; /* index of bytes to be drawn */
|
||||
@@ -2263,14 +2268,6 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
|
||||
{
|
||||
c = utf_ptr2char(s + i);
|
||||
cn = utf_char2cells(c);
|
||||
if (cn > 1
|
||||
# ifdef FEAT_XFONTSET
|
||||
&& fontset == NOFONTSET
|
||||
# endif
|
||||
&& gui.wide_font != NOFONT)
|
||||
dowide = TRUE;
|
||||
else
|
||||
dowide = FALSE;
|
||||
comping = utf_iscomposing(c);
|
||||
if (!comping) /* count cells from non-composing chars */
|
||||
cells += cn;
|
||||
@@ -2278,6 +2275,19 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
|
||||
if (cl == 0) /* hit end of string */
|
||||
len = i + cl; /* len must be wrong "cannot happen" */
|
||||
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
dowide = (cn > 1);
|
||||
# else
|
||||
if (cn > 1
|
||||
# ifdef FEAT_XFONTSET
|
||||
&& fontset == NOFONTSET
|
||||
# endif
|
||||
&& gui.wide_font != NOFONT)
|
||||
dowide = TRUE;
|
||||
else
|
||||
dowide = FALSE;
|
||||
# endif
|
||||
|
||||
/* print the string so far if it's the last character or there is
|
||||
* a composing character. */
|
||||
if (i + cl >= len || (comping && i > start) || dowide
|
||||
@@ -2299,7 +2309,10 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
|
||||
if (thislen > 0)
|
||||
{
|
||||
gui_mch_draw_string(gui.row, scol, s + start, thislen,
|
||||
draw_flags);
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
cells,
|
||||
# endif
|
||||
draw_flags);
|
||||
start += thislen;
|
||||
}
|
||||
scol += cells;
|
||||
@@ -2307,8 +2320,11 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
|
||||
if (dowide)
|
||||
{
|
||||
gui_mch_set_font(gui.wide_font);
|
||||
gui_mch_draw_string(gui.row, scol - cn,
|
||||
s + start, cl, draw_flags);
|
||||
gui_mch_draw_string(gui.row, scol - cn, s + start, cl,
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
cn,
|
||||
# endif
|
||||
draw_flags | DRAW_WIDE);
|
||||
gui_mch_set_font(font);
|
||||
start += cl;
|
||||
}
|
||||
@@ -2328,13 +2344,17 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
|
||||
/* Draw a composing char on top of the previous char. */
|
||||
if (comping)
|
||||
{
|
||||
# if (defined(__APPLE_CC__) || defined(__MRC__)) && TARGET_API_MAC_CARBON
|
||||
# if !defined(FEAT_GUI_MACVIM) && \
|
||||
(defined(__APPLE_CC__) || defined(__MRC__)) && TARGET_API_MAC_CARBON
|
||||
/* Carbon ATSUI autodraws composing char over previous char */
|
||||
gui_mch_draw_string(gui.row, scol, s + i, cl,
|
||||
draw_flags | DRAW_TRANSP);
|
||||
# else
|
||||
gui_mch_draw_string(gui.row, scol - cn, s + i, cl,
|
||||
draw_flags | DRAW_TRANSP);
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
0,
|
||||
# endif
|
||||
draw_flags | DRAW_TRANSP | DRAW_COMP);
|
||||
# endif
|
||||
start = i + cl;
|
||||
}
|
||||
@@ -2345,7 +2365,11 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
|
||||
else
|
||||
# endif
|
||||
{
|
||||
gui_mch_draw_string(gui.row, col, s, len, draw_flags);
|
||||
gui_mch_draw_string(gui.row, col, s, len,
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
len,
|
||||
# endif
|
||||
draw_flags);
|
||||
# ifdef FEAT_MBYTE
|
||||
if (enc_dbcs == DBCS_JPNU)
|
||||
{
|
||||
|
||||
@@ -156,6 +156,8 @@
|
||||
# define DRAW_ITALIC 0x10 /* draw italic text */
|
||||
#endif
|
||||
#define DRAW_CURSOR 0x20 /* drawing block cursor (win32) */
|
||||
#define DRAW_WIDE 0x40 /* drawing wide char (MacVim) */
|
||||
#define DRAW_COMP 0x80 /* drawing composing char (MacVim) */
|
||||
|
||||
/* For our own tearoff menu item */
|
||||
#define TEAR_STRING "-->Detach"
|
||||
|
||||
+18
-2
@@ -5267,8 +5267,24 @@ gui_mch_init_font(char_u *font_name, int fontset UNUSED)
|
||||
# endif
|
||||
#endif /* !HAVE_GTK2 */
|
||||
|
||||
/* Preserve the logical dimensions of the screen. */
|
||||
update_window_manager_hints(0, 0);
|
||||
#ifdef HAVE_GTK2
|
||||
if (gui_mch_maximized())
|
||||
{
|
||||
int w, h;
|
||||
|
||||
/* Update lines and columns in accordance with the new font, keep the
|
||||
* window maximized. */
|
||||
gtk_window_get_size(GTK_WINDOW(gui.mainwin), &w, &h);
|
||||
w -= get_menu_tool_width();
|
||||
h -= get_menu_tool_height();
|
||||
gui_resize_shell(w, h);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Preserve the logical dimensions of the screen. */
|
||||
update_window_manager_hints(0, 0);
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
+5
-2
@@ -10,7 +10,7 @@
|
||||
/*
|
||||
* (C) 2001,2005 by Marcin Dalecki <martin@dalecki.de>
|
||||
*
|
||||
* Implementation of dialogue functions for the Motif GUI variant.
|
||||
* Implementation of dialog functions for the Motif GUI variant.
|
||||
*
|
||||
* Note about Lesstif: Apparently lesstif doesn't get the widget layout right,
|
||||
* when using a dynamic scrollbar policy.
|
||||
@@ -633,16 +633,19 @@ do_choice(Widget w,
|
||||
data->sel[which] = XtNewString(sel);
|
||||
else
|
||||
{
|
||||
XtFree(data->sel[which]);
|
||||
if (!strcmp(data->sel[which], sel))
|
||||
{
|
||||
/* unselecting current selection */
|
||||
XtFree(data->sel[which]);
|
||||
data->sel[which] = NULL;
|
||||
if (w)
|
||||
XmListDeselectItem(w, call_data->item);
|
||||
}
|
||||
else
|
||||
{
|
||||
XtFree(data->sel[which]);
|
||||
data->sel[which] = XtNewString(sel);
|
||||
}
|
||||
}
|
||||
XtFree(sel);
|
||||
|
||||
|
||||
+2
-1
@@ -720,8 +720,9 @@ ex_perl(eap)
|
||||
#ifdef HAVE_SANDBOX
|
||||
if (sandbox)
|
||||
{
|
||||
safe = perl_get_sv( "VIM::safe", FALSE );
|
||||
# ifndef MAKE_TEST /* avoid a warning for unreachable code */
|
||||
if ((safe = perl_get_sv( "VIM::safe", FALSE )) == NULL || !SvTRUE(safe))
|
||||
if (safe == NULL || !SvTRUE(safe))
|
||||
EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
|
||||
else
|
||||
# endif
|
||||
|
||||
+14
-1
@@ -37,6 +37,12 @@
|
||||
#ifdef HAVE_STDARG_H
|
||||
# undef HAVE_STDARG_H /* Python's config.h defines it as well. */
|
||||
#endif
|
||||
#ifdef _POSIX_C_SOURCE
|
||||
# undef _POSIX_C_SOURCE /* pyconfig.h defines it as well. */
|
||||
#endif
|
||||
#ifdef _XOPEN_SOURCE
|
||||
# undef _XOPEN_SOURCE /* pyconfig.h defines it as well. */
|
||||
#endif
|
||||
|
||||
#define PY_SSIZE_T_CLEAN
|
||||
|
||||
@@ -2063,6 +2069,7 @@ WindowSetattr(PyObject *self, char *name, PyObject *val)
|
||||
{
|
||||
long lnum;
|
||||
long col;
|
||||
long len;
|
||||
|
||||
if (!PyArg_Parse(val, "(ll)", &lnum, &col))
|
||||
return -1;
|
||||
@@ -2077,10 +2084,16 @@ WindowSetattr(PyObject *self, char *name, PyObject *val)
|
||||
if (VimErrorCheck())
|
||||
return -1;
|
||||
|
||||
/* NO CHECK ON COLUMN - SEEMS NOT TO MATTER */
|
||||
/* When column is out of range silently correct it. */
|
||||
len = STRLEN(ml_get_buf(this->win->w_buffer, lnum, FALSE));
|
||||
if (col > len)
|
||||
col = len;
|
||||
|
||||
this->win->w_cursor.lnum = lnum;
|
||||
this->win->w_cursor.col = col;
|
||||
#ifdef FEAT_VIRTUALEDIT
|
||||
this->win->w_cursor.coladd = 0;
|
||||
#endif
|
||||
update_screen(VALID);
|
||||
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
# include <Ruby/Ruby.h>
|
||||
# include <Ruby/ruby.h>
|
||||
#else
|
||||
# include <ruby.h>
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -243,7 +243,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef STARTUPTIME
|
||||
# define TIME_MSG(s) time_msg(s, NULL)
|
||||
# define TIME_MSG(s) { if (time_fd != NULL) time_msg(s, NULL); }
|
||||
#else
|
||||
# define TIME_MSG(s)
|
||||
#endif
|
||||
|
||||
+62
-29
@@ -134,10 +134,6 @@ static char_u *serverMakeName __ARGS((char_u *arg, char *cmd));
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef STARTUPTIME
|
||||
static FILE *time_fd = NULL;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Different types of error messages.
|
||||
*/
|
||||
@@ -177,6 +173,9 @@ main
|
||||
char_u *fname = NULL; /* file name from command line */
|
||||
mparm_T params; /* various parameters passed between
|
||||
* main() and other functions. */
|
||||
#ifdef STARTUPTIME
|
||||
int i;
|
||||
#endif
|
||||
|
||||
#if FEAT_GUI_MACVIM
|
||||
// Cocoa needs an NSAutoreleasePool in place or it will leak memory.
|
||||
@@ -216,8 +215,15 @@ main
|
||||
#endif
|
||||
|
||||
#ifdef STARTUPTIME
|
||||
time_fd = mch_fopen(STARTUPTIME, "a");
|
||||
TIME_MSG("--- VIM STARTING ---");
|
||||
for (i = 1; i < argc; ++i)
|
||||
{
|
||||
if (STRICMP(argv[i], "--startuptime") == 0 && i + 1 < argc)
|
||||
{
|
||||
time_fd = mch_fopen(argv[i + 1], "a");
|
||||
TIME_MSG("--- VIM STARTING ---");
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
starttime = time(NULL);
|
||||
|
||||
@@ -363,6 +369,9 @@ main
|
||||
#ifdef MACOS_X
|
||||
if (gui.starting && gui.dofork)
|
||||
macosx_fork(); /* Never returns */
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
gui_macvim_after_fork_init();
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -452,7 +461,8 @@ main
|
||||
* For GTK we can't be sure, but when started from the desktop it doesn't
|
||||
* make sense to try using a terminal.
|
||||
*/
|
||||
#if defined(ALWAYS_USE_GUI) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
|
||||
#if defined(ALWAYS_USE_GUI) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) \
|
||||
|| defined(FEAT_GUI_MACVIM)
|
||||
if (gui.starting
|
||||
# ifdef FEAT_GUI_GTK
|
||||
&& !isatty(2)
|
||||
@@ -461,7 +471,7 @@ main
|
||||
params.want_full_screen = FALSE;
|
||||
#endif
|
||||
|
||||
#if (defined(FEAT_GUI_MAC) || defined(FEAT_GUI_MACVIM)) && defined(MACOS_X_UNIX)
|
||||
#if defined(FEAT_GUI_MAC) && defined(MACOS_X_UNIX)
|
||||
/* When the GUI is started from Finder, need to display messages in a
|
||||
* message box. isatty(2) returns TRUE anyway, thus we need to check the
|
||||
* name to know we're not started from a terminal. */
|
||||
@@ -469,7 +479,6 @@ main
|
||||
{
|
||||
params.want_full_screen = FALSE;
|
||||
|
||||
# ifndef FEAT_GUI_MACVIM
|
||||
/* Avoid always using "/" as the current directory. Note that when
|
||||
* started from Finder the arglist will be filled later in
|
||||
* HandleODocAE() and "fname" will be NULL. */
|
||||
@@ -484,7 +493,6 @@ main
|
||||
vim_chdir(NameBuff);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1225,6 +1233,18 @@ main_loop(cmdwin, noexmode)
|
||||
cursor_on();
|
||||
|
||||
do_redraw = FALSE;
|
||||
|
||||
#ifdef STARTUPTIME
|
||||
/* Now that we have drawn the first screen all the startup stuff
|
||||
* has been done, close any file for startup messages. */
|
||||
if (time_fd != NULL)
|
||||
{
|
||||
TIME_MSG("first screen update");
|
||||
TIME_MSG("--- VIM STARTED ---");
|
||||
fclose(time_fd);
|
||||
time_fd = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#ifdef FEAT_GUI
|
||||
if (need_mouse_correct)
|
||||
@@ -1793,6 +1813,11 @@ command_line_scan(parmp)
|
||||
want_argument = TRUE;
|
||||
argv_idx += 3;
|
||||
}
|
||||
else if (STRNICMP(argv[0] + argv_idx, "startuptime", 11) == 0)
|
||||
{
|
||||
want_argument = TRUE;
|
||||
argv_idx += 11;
|
||||
}
|
||||
#ifdef FEAT_CLIENTSERVER
|
||||
else if (STRNICMP(argv[0] + argv_idx, "serverlist", 10) == 0)
|
||||
; /* already processed -- no arg */
|
||||
@@ -2124,7 +2149,7 @@ command_line_scan(parmp)
|
||||
mainerr(ME_GARBAGE, (char_u *)argv[0]);
|
||||
|
||||
--argc;
|
||||
if (argc < 1 && c != 'S')
|
||||
if (argc < 1 && c != 'S') /* -S has an optional argument */
|
||||
mainerr_arg_missing((char_u *)argv[0]);
|
||||
++argv;
|
||||
argv_idx = -1;
|
||||
@@ -2165,11 +2190,16 @@ command_line_scan(parmp)
|
||||
(char_u *)argv[0];
|
||||
break;
|
||||
|
||||
case '-': /* "--cmd {command}" execute command */
|
||||
if (parmp->n_pre_commands >= MAX_ARG_CMDS)
|
||||
mainerr(ME_EXTRA_CMD, NULL);
|
||||
parmp->pre_commands[parmp->n_pre_commands++] =
|
||||
case '-':
|
||||
if (argv[-1][2] == 'c')
|
||||
{
|
||||
/* "--cmd {command}" execute command */
|
||||
if (parmp->n_pre_commands >= MAX_ARG_CMDS)
|
||||
mainerr(ME_EXTRA_CMD, NULL);
|
||||
parmp->pre_commands[parmp->n_pre_commands++] =
|
||||
(char_u *)argv[0];
|
||||
}
|
||||
/* "--startuptime <file>" already handled */
|
||||
break;
|
||||
|
||||
/* case 'd': -d {device} is handled in mch_check_win() for the
|
||||
@@ -3207,6 +3237,9 @@ usage()
|
||||
main_msg(_("--serverlist\t\tList available Vim server names and exit"));
|
||||
main_msg(_("--servername <name>\tSend to/become the Vim server <name>"));
|
||||
#endif
|
||||
#ifdef STARTUPTIME
|
||||
main_msg(_("--startuptime <file>\tWrite startup timing messages to <file>"));
|
||||
#endif
|
||||
#ifdef FEAT_VIMINFO
|
||||
main_msg(_("-i <viminfo>\t\tUse <viminfo> instead of .viminfo"));
|
||||
#endif
|
||||
@@ -3296,6 +3329,20 @@ static void time_diff __ARGS((struct timeval *then, struct timeval *now));
|
||||
|
||||
static struct timeval prev_timeval;
|
||||
|
||||
# ifdef WIN3264
|
||||
/*
|
||||
* Windows doesn't have gettimeofday(), although it does have struct timeval.
|
||||
*/
|
||||
static int
|
||||
gettimeofday(struct timeval *tv, char *dummy)
|
||||
{
|
||||
long t = clock();
|
||||
tv->tv_sec = t / CLOCKS_PER_SEC;
|
||||
tv->tv_usec = (t - tv->tv_sec * CLOCKS_PER_SEC) * 1000000 / CLOCKS_PER_SEC;
|
||||
return 0;
|
||||
}
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Save the previous time before doing something that could nest.
|
||||
* set "*tv_rel" to the time elapsed so far.
|
||||
@@ -3384,20 +3431,6 @@ time_msg(msg, tv_start)
|
||||
}
|
||||
}
|
||||
|
||||
# ifdef WIN3264
|
||||
/*
|
||||
* Windows doesn't have gettimeofday(), although it does have struct timeval.
|
||||
*/
|
||||
int
|
||||
gettimeofday(struct timeval *tv, char *dummy)
|
||||
{
|
||||
long t = clock();
|
||||
tv->tv_sec = t / CLOCKS_PER_SEC;
|
||||
tv->tv_usec = (t - tv->tv_sec * CLOCKS_PER_SEC) * 1000000 / CLOCKS_PER_SEC;
|
||||
return 0;
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_CLIENTSERVER) || defined(PROTO)
|
||||
|
||||
@@ -1343,6 +1343,11 @@ mf_do_open(mfp, fname, flags)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_FD_CLOEXEC
|
||||
int fdflags = fcntl(mfp->mf_fd, F_GETFD);
|
||||
if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0)
|
||||
fcntl(mfp->mf_fd, F_SETFD, fdflags | FD_CLOEXEC);
|
||||
#endif
|
||||
#ifdef HAVE_SELINUX
|
||||
mch_copy_sec(fname, mfp->mf_fname);
|
||||
#endif
|
||||
|
||||
+22
-12
@@ -382,7 +382,7 @@ ml_open(buf)
|
||||
dp->db_index[0] = --dp->db_txt_start; /* at end of block */
|
||||
dp->db_free -= 1 + INDEX_SIZE;
|
||||
dp->db_line_count = 1;
|
||||
*((char_u *)dp + dp->db_txt_start) = NUL; /* emtpy line */
|
||||
*((char_u *)dp + dp->db_txt_start) = NUL; /* empty line */
|
||||
|
||||
return OK;
|
||||
|
||||
@@ -490,6 +490,13 @@ ml_setname(buf)
|
||||
EMSG(_("E301: Oops, lost the swap file!!!"));
|
||||
return;
|
||||
}
|
||||
#ifdef HAVE_FD_CLOEXEC
|
||||
{
|
||||
int fdflags = fcntl(mfp->mf_fd, F_GETFD);
|
||||
if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0)
|
||||
fcntl(mfp->mf_fd, F_SETFD, fdflags | FD_CLOEXEC);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (!success)
|
||||
EMSG(_("E302: Could not rename swap file"));
|
||||
@@ -864,21 +871,24 @@ ml_recover()
|
||||
recoverymode = TRUE;
|
||||
called_from_main = (curbuf->b_ml.ml_mfp == NULL);
|
||||
attr = hl_attr(HLF_E);
|
||||
/*
|
||||
* If the file name ends in ".sw?" we use it directly.
|
||||
* Otherwise a search is done to find the swap file(s).
|
||||
*/
|
||||
|
||||
/*
|
||||
* If the file name ends in ".s[uvw][a-z]" we assume this is the swap file.
|
||||
* Otherwise a search is done to find the swap file(s).
|
||||
*/
|
||||
fname = curbuf->b_fname;
|
||||
if (fname == NULL) /* When there is no file name */
|
||||
fname = (char_u *)"";
|
||||
len = (int)STRLEN(fname);
|
||||
if (len >= 4 &&
|
||||
#if defined(VMS) || defined(RISCOS)
|
||||
STRNICMP(fname + len - 4, "_sw" , 3)
|
||||
STRNICMP(fname + len - 4, "_s" , 2)
|
||||
#else
|
||||
STRNICMP(fname + len - 4, ".sw" , 3)
|
||||
STRNICMP(fname + len - 4, ".s" , 2)
|
||||
#endif
|
||||
== 0)
|
||||
== 0
|
||||
&& vim_strchr((char_u *)"UVWuvw", fname[len - 2]) != NULL
|
||||
&& ASCII_ISALPHA(fname[len - 1]))
|
||||
{
|
||||
directly = TRUE;
|
||||
fname = vim_strsave(fname); /* make a copy for mf_open() */
|
||||
@@ -1282,7 +1292,7 @@ ml_recover()
|
||||
for (i = 0; i < dp->db_line_count; ++i)
|
||||
{
|
||||
txt_start = (dp->db_index[i] & DB_INDEX_MASK);
|
||||
if (txt_start <= HEADER_SIZE
|
||||
if (txt_start <= (int)HEADER_SIZE
|
||||
|| txt_start >= (int)dp->db_txt_end)
|
||||
{
|
||||
p = (char_u *)"???";
|
||||
@@ -1293,7 +1303,8 @@ ml_recover()
|
||||
ml_append(lnum++, p, (colnr_T)0, TRUE);
|
||||
}
|
||||
if (has_error)
|
||||
ml_append(lnum++, (char_u *)_("???END"), (colnr_T)0, TRUE);
|
||||
ml_append(lnum++, (char_u *)_("???END"),
|
||||
(colnr_T)0, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3573,11 +3584,10 @@ resolve_symlink(fname, buf)
|
||||
* Make swap file name out of the file name and a directory name.
|
||||
* Returns pointer to allocated memory or NULL.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
char_u *
|
||||
makeswapname(fname, ffname, buf, dir_name)
|
||||
char_u *fname;
|
||||
char_u *ffname;
|
||||
char_u *ffname UNUSED;
|
||||
buf_T *buf;
|
||||
char_u *dir_name;
|
||||
{
|
||||
|
||||
+12
-3
@@ -1026,12 +1026,14 @@ open_line(dir, flags, old_indent)
|
||||
int c = 0;
|
||||
int off = 0;
|
||||
|
||||
for (p = lead_flags; *p && *p != ':'; ++p)
|
||||
for (p = lead_flags; *p != NUL && *p != ':'; )
|
||||
{
|
||||
if (*p == COM_RIGHT || *p == COM_LEFT)
|
||||
c = *p;
|
||||
c = *p++;
|
||||
else if (VIM_ISDIGIT(*p) || *p == '-')
|
||||
off = getdigits(&p);
|
||||
else
|
||||
++p;
|
||||
}
|
||||
if (c == COM_RIGHT) /* right adjusted leader */
|
||||
{
|
||||
@@ -1119,7 +1121,7 @@ open_line(dir, flags, old_indent)
|
||||
if (i != lead_repl_len)
|
||||
{
|
||||
mch_memmove(p + lead_repl_len, p + i,
|
||||
(size_t)(lead_len - i - (leader - p)));
|
||||
(size_t)(lead_len - i - (p - leader)));
|
||||
lead_len += lead_repl_len - i;
|
||||
}
|
||||
}
|
||||
@@ -2886,6 +2888,13 @@ changed_common(lnum, col, lnume, xtra)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef FEAT_FOLDING
|
||||
/* Take care of side effects for setting w_topline when folds have
|
||||
* changed. Esp. when the buffer was changed in another window. */
|
||||
if (hasAnyFolding(wp))
|
||||
set_topline(wp, wp->w_topline);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+14
-9
@@ -156,7 +156,7 @@ coladvance2(pos, addspaces, finetune, wcol)
|
||||
|| ((ve_flags & VE_ONEMORE) && wcol < MAXCOL)
|
||||
#endif
|
||||
;
|
||||
line = ml_get_curline();
|
||||
line = ml_get_buf(curbuf, pos->lnum, FALSE);
|
||||
|
||||
if (wcol >= MAXCOL)
|
||||
{
|
||||
@@ -332,9 +332,9 @@ coladvance2(pos, addspaces, finetune, wcol)
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
/* prevent cursor from moving on the trail byte */
|
||||
/* prevent from moving onto a trail byte */
|
||||
if (has_mbyte)
|
||||
mb_adjust_cursor();
|
||||
mb_adjustpos(pos);
|
||||
#endif
|
||||
|
||||
if (col < wcol)
|
||||
@@ -1005,9 +1005,14 @@ free_all_mem()
|
||||
# ifdef FEAT_MENU
|
||||
/* Clear menus. */
|
||||
do_cmdline_cmd((char_u *)"aunmenu *");
|
||||
# ifdef FEAT_MULTI_LANG
|
||||
do_cmdline_cmd((char_u *)"menutranslate clear");
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* Clear mappings, abbreviations, breakpoints. */
|
||||
do_cmdline_cmd((char_u *)"lmapclear");
|
||||
do_cmdline_cmd((char_u *)"xmapclear");
|
||||
do_cmdline_cmd((char_u *)"mapclear");
|
||||
do_cmdline_cmd((char_u *)"mapclear!");
|
||||
do_cmdline_cmd((char_u *)"abclear");
|
||||
@@ -1282,7 +1287,7 @@ csh_like_shell()
|
||||
|
||||
/*
|
||||
* Escape "string" for use as a shell argument with system().
|
||||
* This uses single quotes, except when we know we need to use double qoutes
|
||||
* This uses single quotes, except when we know we need to use double quotes
|
||||
* (MS-DOS and MS-Windows without 'shellslash' set).
|
||||
* Escape a newline, depending on the 'shell' option.
|
||||
* When "do_special" is TRUE also replace "!", "%", "#" and things starting
|
||||
@@ -1537,7 +1542,7 @@ copy_spaces(ptr, count)
|
||||
#if defined(FEAT_VISUALEXTRA) || defined(PROTO)
|
||||
/*
|
||||
* Copy a character a number of times.
|
||||
* Does not work for multi-byte charactes!
|
||||
* Does not work for multi-byte characters!
|
||||
*/
|
||||
void
|
||||
copy_chars(ptr, count, c)
|
||||
@@ -4260,7 +4265,7 @@ vim_findfile_init(path, filename, stopdirs, level, free_visited, find_what,
|
||||
* or '**76' is transposed to '**N'( 'N' is ASCII value 76).
|
||||
* For EBCDIC you get different character values.
|
||||
* If no restrict is given after '**' the default is used.
|
||||
* Due to this technic the path looks awful if you print it as a
|
||||
* Due to this technique the path looks awful if you print it as a
|
||||
* string.
|
||||
*/
|
||||
len = 0;
|
||||
@@ -4649,7 +4654,7 @@ vim_findfile(search_ctx_arg)
|
||||
&& !mch_isdir(stackp->ffs_filearray[i]))
|
||||
continue; /* not a directory */
|
||||
|
||||
/* prepare the filename to be checked for existance
|
||||
/* prepare the filename to be checked for existence
|
||||
* below */
|
||||
STRCPY(file_path, stackp->ffs_filearray[i]);
|
||||
add_pathsep(file_path);
|
||||
@@ -5438,7 +5443,7 @@ find_file_in_path_option(ptr, len, options, first, path_option, find_what, rel_f
|
||||
#if defined(MSWIN) || defined(MSDOS) || defined(OS2)
|
||||
/* handle "\tmp" as absolute path */
|
||||
|| vim_ispathsep(ff_file_to_find[0])
|
||||
/* handle "c:name" as absulute path */
|
||||
/* handle "c:name" as absolute path */
|
||||
|| (ff_file_to_find[0] != NUL && ff_file_to_find[1] == ':')
|
||||
#endif
|
||||
#ifdef AMIGA
|
||||
@@ -5681,7 +5686,7 @@ qsort(base, elm_count, elm_size, cmp)
|
||||
p2 = (char_u *)base + (j + gap) * elm_size;
|
||||
if ((*cmp)((void *)p1, (void *)p2) <= 0)
|
||||
break;
|
||||
/* Exchange the elemets. */
|
||||
/* Exchange the elements. */
|
||||
mch_memmove(buf, p1, elm_size);
|
||||
mch_memmove(p1, p2, elm_size);
|
||||
mch_memmove(p2, buf, elm_size);
|
||||
|
||||
+2
-4
@@ -183,9 +183,6 @@ update_topline()
|
||||
if (curwin->w_topline != 1)
|
||||
redraw_later(NOT_VALID);
|
||||
curwin->w_topline = 1;
|
||||
#ifdef FEAT_DIFF
|
||||
curwin->w_topfill = 0;
|
||||
#endif
|
||||
curwin->w_botline = 2;
|
||||
curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
|
||||
#ifdef FEAT_SCROLLBIND
|
||||
@@ -1257,7 +1254,8 @@ scrolldown(line_count, byfold)
|
||||
while (line_count-- > 0)
|
||||
{
|
||||
#ifdef FEAT_DIFF
|
||||
if (curwin->w_topfill < diff_check(curwin, curwin->w_topline))
|
||||
if (curwin->w_topfill < diff_check(curwin, curwin->w_topline)
|
||||
&& curwin->w_topfill < curwin->w_height - 1)
|
||||
{
|
||||
++curwin->w_topfill;
|
||||
++done;
|
||||
|
||||
@@ -422,8 +422,9 @@ shift_block(oap, amount)
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
bd.textstart += (*mb_ptr2len)(bd.textstart);
|
||||
else
|
||||
#endif
|
||||
++bd.textstart;
|
||||
++bd.textstart;
|
||||
}
|
||||
for ( ; vim_iswhite(*bd.textstart); )
|
||||
{
|
||||
@@ -2020,6 +2021,7 @@ op_replace(oap, c)
|
||||
bd.is_MAX = (curwin->w_curswant == MAXCOL);
|
||||
for ( ; curwin->w_cursor.lnum <= oap->end.lnum; ++curwin->w_cursor.lnum)
|
||||
{
|
||||
curwin->w_cursor.col = 0; /* make sure cursor position is valid */
|
||||
block_prep(oap, &bd, curwin->w_cursor.lnum, TRUE);
|
||||
if (bd.textlen == 0 && (!virtual_op || bd.is_MAX))
|
||||
continue; /* nothing to replace */
|
||||
@@ -2035,6 +2037,7 @@ op_replace(oap, c)
|
||||
{
|
||||
pos_T vpos;
|
||||
|
||||
vpos.lnum = curwin->w_cursor.lnum;
|
||||
getvpos(&vpos, oap->start_vcol);
|
||||
bd.startspaces += vpos.coladd;
|
||||
n = bd.startspaces;
|
||||
@@ -2693,11 +2696,8 @@ op_change(oap)
|
||||
* initial coladd offset as part of "startspaces" */
|
||||
if (bd.is_short)
|
||||
{
|
||||
linenr_T lnum = curwin->w_cursor.lnum;
|
||||
|
||||
curwin->w_cursor.lnum = linenr;
|
||||
vpos.lnum = linenr;
|
||||
(void)getvpos(&vpos, oap->start_vcol);
|
||||
curwin->w_cursor.lnum = lnum;
|
||||
}
|
||||
else
|
||||
vpos.coladd = 0;
|
||||
@@ -3991,6 +3991,14 @@ ex_display(eap)
|
||||
}
|
||||
else
|
||||
yb = &(y_regs[i]);
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
if (name == MB_TOLOWER(redir_reg)
|
||||
|| (redir_reg == '"' && yb == y_previous))
|
||||
continue; /* do not list register being written to, the
|
||||
* pointer can be freed */
|
||||
#endif
|
||||
|
||||
if (yb->y_array != NULL)
|
||||
{
|
||||
msg_putchar('\n');
|
||||
@@ -6090,7 +6098,7 @@ str_to_reg(y_ptr, type, str, len, blocklen)
|
||||
long maxlen;
|
||||
#endif
|
||||
|
||||
if (y_ptr->y_array == NULL) /* NULL means emtpy register */
|
||||
if (y_ptr->y_array == NULL) /* NULL means empty register */
|
||||
y_ptr->y_size = 0;
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
extern int use_gui_macvim_draw_string;
|
||||
|
||||
void
|
||||
macvim_early_init();
|
||||
void
|
||||
gui_mch_prepare(int *argc, char **argv);
|
||||
void
|
||||
gui_macvim_after_fork_init();
|
||||
int
|
||||
gui_mch_init_check(void);
|
||||
int
|
||||
@@ -28,7 +31,7 @@ gui_mch_clear_block(int row1, int col1, int row2, int col2);
|
||||
void
|
||||
gui_mch_delete_lines(int row, int num_lines);
|
||||
void
|
||||
gui_mch_draw_string(int row, int col, char_u *s, int len, int flags);
|
||||
gui_mch_draw_string(int row, int col, char_u *s, int len, int cells, int flags);
|
||||
int
|
||||
gui_macvim_draw_string(int row, int col, char_u *s, int len, int flags);
|
||||
void
|
||||
|
||||
+64
-23
@@ -132,7 +132,7 @@ static void screen_line __ARGS((int row, int coloff, int endcol, int clear_width
|
||||
static void draw_vsep_win __ARGS((win_T *wp, int row));
|
||||
#endif
|
||||
#ifdef FEAT_STL_OPT
|
||||
static void redraw_custum_statusline __ARGS((win_T *wp));
|
||||
static void redraw_custom_statusline __ARGS((win_T *wp));
|
||||
#endif
|
||||
#ifdef FEAT_SEARCH_EXTRA
|
||||
#define SEARCH_HL_PRIORITY 0
|
||||
@@ -3008,11 +3008,33 @@ win_line(wp, lnum, startrow, endrow, nochange)
|
||||
mb_ptr_adv(ptr);
|
||||
}
|
||||
|
||||
#ifdef FEAT_VIRTUALEDIT
|
||||
/* When 'virtualedit' is set the end of the line may be before the
|
||||
* start of the displayed part. */
|
||||
if (vcol < v && *ptr == NUL && virtual_active())
|
||||
#if defined(FEAT_SYN_HL) || defined(FEAT_VIRTUALEDIT) || defined(FEAT_VISUAL)
|
||||
/* When:
|
||||
* - 'cuc' is set, or
|
||||
* - 'virtualedit' is set, or
|
||||
* - the visual mode is active,
|
||||
* the end of the line may be before the start of the displayed part.
|
||||
*/
|
||||
if (vcol < v && (
|
||||
# ifdef FEAT_SYN_HL
|
||||
wp->w_p_cuc
|
||||
# if defined(FEAT_VIRTUALEDIT) || defined(FEAT_VISUAL)
|
||||
||
|
||||
# endif
|
||||
# endif
|
||||
# ifdef FEAT_VIRTUALEDIT
|
||||
virtual_active()
|
||||
# ifdef FEAT_VISUAL
|
||||
||
|
||||
# endif
|
||||
# endif
|
||||
# ifdef FEAT_VISUAL
|
||||
(VIsual_active && wp->w_buffer == curwin->w_buffer)
|
||||
# endif
|
||||
))
|
||||
{
|
||||
vcol = v;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Handle a character that's not completely on the screen: Put ptr at
|
||||
@@ -5775,7 +5797,7 @@ win_redr_status(wp)
|
||||
else if (*p_stl != NUL || *wp->w_p_stl != NUL)
|
||||
{
|
||||
/* redraw custom status line */
|
||||
redraw_custum_statusline(wp);
|
||||
redraw_custom_statusline(wp);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
@@ -5900,18 +5922,31 @@ win_redr_status(wp)
|
||||
* errors encountered.
|
||||
*/
|
||||
static void
|
||||
redraw_custum_statusline(wp)
|
||||
redraw_custom_statusline(wp)
|
||||
win_T *wp;
|
||||
{
|
||||
int save_called_emsg = called_emsg;
|
||||
static int entered = FALSE;
|
||||
int save_called_emsg = called_emsg;
|
||||
|
||||
/* When called recursively return. This can happen when the statusline
|
||||
* contains an expression that triggers a redraw. */
|
||||
if (entered)
|
||||
return;
|
||||
entered = TRUE;
|
||||
|
||||
called_emsg = FALSE;
|
||||
win_redr_custom(wp, FALSE);
|
||||
if (called_emsg)
|
||||
{
|
||||
/* When there is an error disable the statusline, otherwise the
|
||||
* display is messed up with errors and a redraw triggers the problem
|
||||
* again and again. */
|
||||
set_string_option_direct((char_u *)"statusline", -1,
|
||||
(char_u *)"", OPT_FREE | (*wp->w_p_stl != NUL
|
||||
? OPT_LOCAL : OPT_GLOBAL), SID_ERROR);
|
||||
}
|
||||
called_emsg |= save_called_emsg;
|
||||
entered = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -6019,6 +6054,7 @@ win_redr_custom(wp, draw_ruler)
|
||||
int len;
|
||||
int fillchar;
|
||||
char_u buf[MAXPATHL];
|
||||
char_u *stl;
|
||||
char_u *p;
|
||||
struct stl_hlrec hltab[STL_MAX_ITEM];
|
||||
struct stl_hlrec tabtab[STL_MAX_ITEM];
|
||||
@@ -6028,7 +6064,7 @@ win_redr_custom(wp, draw_ruler)
|
||||
if (wp == NULL)
|
||||
{
|
||||
/* Use 'tabline'. Always at the first line of the screen. */
|
||||
p = p_tal;
|
||||
stl = p_tal;
|
||||
row = 0;
|
||||
fillchar = ' ';
|
||||
attr = hl_attr(HLF_TPF);
|
||||
@@ -6045,17 +6081,17 @@ win_redr_custom(wp, draw_ruler)
|
||||
|
||||
if (draw_ruler)
|
||||
{
|
||||
p = p_ruf;
|
||||
stl = p_ruf;
|
||||
/* advance past any leading group spec - implicit in ru_col */
|
||||
if (*p == '%')
|
||||
if (*stl == '%')
|
||||
{
|
||||
if (*++p == '-')
|
||||
p++;
|
||||
if (atoi((char *) p))
|
||||
while (VIM_ISDIGIT(*p))
|
||||
p++;
|
||||
if (*p++ != '(')
|
||||
p = p_ruf;
|
||||
if (*++stl == '-')
|
||||
stl++;
|
||||
if (atoi((char *)stl))
|
||||
while (VIM_ISDIGIT(*stl))
|
||||
stl++;
|
||||
if (*stl++ != '(')
|
||||
stl = p_ruf;
|
||||
}
|
||||
#ifdef FEAT_VERTSPLIT
|
||||
col = ru_col - (Columns - W_WIDTH(wp));
|
||||
@@ -6084,9 +6120,9 @@ win_redr_custom(wp, draw_ruler)
|
||||
else
|
||||
{
|
||||
if (*wp->w_p_stl != NUL)
|
||||
p = wp->w_p_stl;
|
||||
stl = wp->w_p_stl;
|
||||
else
|
||||
p = p_stl;
|
||||
stl = p_stl;
|
||||
# ifdef FEAT_EVAL
|
||||
use_sandbox = was_set_insecurely((char_u *)"statusline",
|
||||
*wp->w_p_stl == NUL ? 0 : OPT_LOCAL);
|
||||
@@ -6101,10 +6137,14 @@ win_redr_custom(wp, draw_ruler)
|
||||
if (maxwidth <= 0)
|
||||
return;
|
||||
|
||||
/* Make a copy, because the statusline may include a function call that
|
||||
* might change the option value and free the memory. */
|
||||
stl = vim_strsave(stl);
|
||||
width = build_stl_str_hl(wp == NULL ? curwin : wp,
|
||||
buf, sizeof(buf),
|
||||
p, use_sandbox,
|
||||
stl, use_sandbox,
|
||||
fillchar, maxwidth, hltab, tabtab);
|
||||
vim_free(stl);
|
||||
len = (int)STRLEN(buf);
|
||||
|
||||
while (width < maxwidth && len < (int)sizeof(buf) - 1)
|
||||
@@ -6376,7 +6416,8 @@ screen_puts_len(text, len, row, col, attr)
|
||||
}
|
||||
else
|
||||
{
|
||||
nc = utfc_ptr2char(ptr + mbyte_blen, pcc);
|
||||
nc = utfc_ptr2char_len(ptr + mbyte_blen, pcc,
|
||||
(int)((text + len) - ptr - mbyte_blen));
|
||||
nc1 = pcc[0];
|
||||
}
|
||||
pc = prev_c;
|
||||
@@ -9469,7 +9510,7 @@ showruler(always)
|
||||
#if defined(FEAT_STL_OPT) && defined(FEAT_WINDOWS)
|
||||
if ((*p_stl != NUL || *curwin->w_p_stl != NUL) && curwin->w_status_height)
|
||||
{
|
||||
redraw_custum_statusline(curwin);
|
||||
redraw_custom_statusline(curwin);
|
||||
}
|
||||
else
|
||||
#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 test67.out
|
||||
test66.out test67.out test68.out test69.out
|
||||
|
||||
.SUFFIXES: .in .out
|
||||
|
||||
@@ -113,3 +113,5 @@ test64.out: test64.in
|
||||
test65.out: test65.in
|
||||
test66.out: test66.in
|
||||
test67.out: test67.in
|
||||
test68.out: test68.in
|
||||
test69.out: test69.in
|
||||
|
||||
@@ -26,7 +26,8 @@ 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 test67.out
|
||||
test42.out test52.out test65.out test66.out test67.out \
|
||||
test68.out test69.out
|
||||
|
||||
SCRIPTS32 = test50.out
|
||||
|
||||
|
||||
@@ -45,7 +45,8 @@ 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 test67.out
|
||||
test42.out test52.out test65.out test66.out test67.out \
|
||||
test68.out test69.out
|
||||
|
||||
SCRIPTS32 = test50.out
|
||||
|
||||
|
||||
@@ -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 test67.out
|
||||
test66.out test67.out test68.out test69.out
|
||||
|
||||
.SUFFIXES: .in .out
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
|
||||
test48.out test51.out test53.out test54.out test55.out \
|
||||
test56.out test57.out test60.out \
|
||||
test61.out test62.out test63.out test64.out test65.out \
|
||||
test66.out test67.out
|
||||
test66.out test67.out test68.out test69.out
|
||||
|
||||
.IFDEF WANT_GUI
|
||||
SCRIPT_GUI = test16.out
|
||||
|
||||
@@ -22,7 +22,8 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
|
||||
test48.out test49.out test51.out test52.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 test67.out
|
||||
test64.out test65.out test66.out test67.out test68.out \
|
||||
test69.out
|
||||
|
||||
SCRIPTS_GUI = test16.out
|
||||
|
||||
|
||||
@@ -28,9 +28,14 @@ i jI :call append("$", "indent " . foldlevel("."))
|
||||
k:call append("$", foldlevel("."))
|
||||
:" test syntax folding
|
||||
:set fdm=syntax fdl=0
|
||||
:syn region Hup start="dd" end="hh" fold
|
||||
:syn region Hup start="dd" end="ii" fold contains=Fd1,Fd2,Fd3
|
||||
:syn region Fd1 start="ee" end="ff" fold contained
|
||||
:syn region Fd2 start="gg" end="hh" fold contained
|
||||
:syn region Fd3 start="commentstart" end="commentend" fold contained
|
||||
Gzk:call append("$", "folding " . getline("."))
|
||||
k:call append("$", getline("."))
|
||||
jAcommentstart Acommentend:set fdl=1
|
||||
3j:call append("$", getline("."))
|
||||
:" test expression folding
|
||||
:fun Flvl()
|
||||
let l = getline(v:lnum)
|
||||
|
||||
@@ -8,8 +8,9 @@ marker 2
|
||||
0
|
||||
indent 2
|
||||
1
|
||||
folding 8 hh
|
||||
folding 9 ii
|
||||
3 cc
|
||||
7 gg
|
||||
expr 2
|
||||
1
|
||||
2
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
Test for text formatting.
|
||||
|
||||
Results of test68:
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
/^{/+1
|
||||
:set noai tw=2 fo=t
|
||||
gRa b
|
||||
ENDTEST
|
||||
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
STARTTEST
|
||||
/^{/+1
|
||||
:set ai tw=2 fo=tw
|
||||
gqgqjjllab
|
||||
ENDTEST
|
||||
|
||||
{
|
||||
a b
|
||||
|
||||
a
|
||||
}
|
||||
|
||||
STARTTEST
|
||||
/^{/+1
|
||||
:set tw=3 fo=t
|
||||
gqgqo
|
||||
a
|
||||
ENDTEST
|
||||
|
||||
{
|
||||
a
|
||||
}
|
||||
|
||||
STARTTEST
|
||||
/^{/+1
|
||||
:set tw=2 fo=tcq1 comments=:#
|
||||
gqgqjgqgqo
|
||||
a b
|
||||
#a b
|
||||
ENDTEST
|
||||
|
||||
{
|
||||
a b
|
||||
#a b
|
||||
}
|
||||
|
||||
STARTTEST
|
||||
:g/^STARTTEST/.,/^ENDTEST/d
|
||||
:1;/^Results/,$wq! test.out
|
||||
ENDTEST
|
||||
@@ -0,0 +1,35 @@
|
||||
Results of test68:
|
||||
|
||||
|
||||
{
|
||||
a
|
||||
b
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
a
|
||||
b
|
||||
|
||||
a
|
||||
b
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
a
|
||||
|
||||
|
||||
a
|
||||
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
a b
|
||||
#a b
|
||||
|
||||
a b
|
||||
#a b
|
||||
}
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
Test for multi-byte text formatting.
|
||||
|
||||
STARTTEST
|
||||
:so mbyte.vim
|
||||
:set encoding=utf-8
|
||||
ENDTEST
|
||||
|
||||
Results of test69:
|
||||
|
||||
STARTTEST
|
||||
/^{/+1
|
||||
:set tw=2 fo=t
|
||||
gqgqjgqgqo
|
||||
XYZ
|
||||
abc XYZ
|
||||
ENDTEST
|
||||
|
||||
{
|
||||
XYZ
|
||||
abc XYZ
|
||||
}
|
||||
|
||||
STARTTEST
|
||||
/^{/+1
|
||||
:set tw=1 fo=tm
|
||||
gqgqjgqgqjgqgqjgqgqjgqgqo
|
||||
X
|
||||
Xa
|
||||
X a
|
||||
XY
|
||||
X Y
|
||||
ENDTEST
|
||||
|
||||
{
|
||||
X
|
||||
Xa
|
||||
X a
|
||||
XY
|
||||
X Y
|
||||
}
|
||||
|
||||
STARTTEST
|
||||
/^{/+1
|
||||
:set tw=2 fo=tm
|
||||
gqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqo
|
||||
X
|
||||
Xa
|
||||
X a
|
||||
XY
|
||||
X Y
|
||||
aX
|
||||
abX
|
||||
abcX
|
||||
abX c
|
||||
abXY
|
||||
ENDTEST
|
||||
|
||||
{
|
||||
X
|
||||
Xa
|
||||
X a
|
||||
XY
|
||||
X Y
|
||||
aX
|
||||
abX
|
||||
abcX
|
||||
abX c
|
||||
abXY
|
||||
}
|
||||
|
||||
STARTTEST
|
||||
/^{/+1
|
||||
:set ai tw=2 fo=tm
|
||||
gqgqjgqgqo
|
||||
X
|
||||
Xa
|
||||
ENDTEST
|
||||
|
||||
{
|
||||
X
|
||||
Xa
|
||||
}
|
||||
|
||||
STARTTEST
|
||||
/^{/+1
|
||||
:set noai tw=2 fo=tm
|
||||
gqgqjgqgqo
|
||||
X
|
||||
Xa
|
||||
ENDTEST
|
||||
|
||||
{
|
||||
X
|
||||
Xa
|
||||
}
|
||||
|
||||
STARTTEST
|
||||
/^{/+1
|
||||
:set tw=2 fo=cqm comments=n:X
|
||||
gqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqo
|
||||
X
|
||||
Xa
|
||||
XaY
|
||||
XY
|
||||
XYZ
|
||||
X Y
|
||||
X YZ
|
||||
XX
|
||||
XXa
|
||||
XXY
|
||||
ENDTEST
|
||||
|
||||
{
|
||||
X
|
||||
Xa
|
||||
XaY
|
||||
XY
|
||||
XYZ
|
||||
X Y
|
||||
X YZ
|
||||
XX
|
||||
XXa
|
||||
XXY
|
||||
}
|
||||
|
||||
STARTTEST
|
||||
/^{/+1
|
||||
:set tw=2 fo=tm
|
||||
RXa
|
||||
ENDTEST
|
||||
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
STARTTEST
|
||||
:g/^STARTTEST/.,/^ENDTEST/d
|
||||
:1;/^Results/,$wq! test.out
|
||||
ENDTEST
|
||||
@@ -0,0 +1,142 @@
|
||||
Results of test69:
|
||||
|
||||
|
||||
{
|
||||
XYZ
|
||||
abc
|
||||
XYZ
|
||||
|
||||
XYZ
|
||||
abc
|
||||
XYZ
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
X
|
||||
X
|
||||
a
|
||||
X
|
||||
a
|
||||
X
|
||||
Y
|
||||
X
|
||||
Y
|
||||
|
||||
X
|
||||
X
|
||||
a
|
||||
X
|
||||
a
|
||||
X
|
||||
Y
|
||||
X
|
||||
Y
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
X
|
||||
X
|
||||
a
|
||||
X
|
||||
a
|
||||
X
|
||||
Y
|
||||
X
|
||||
Y
|
||||
a
|
||||
X
|
||||
ab
|
||||
X
|
||||
abc
|
||||
X
|
||||
ab
|
||||
X
|
||||
c
|
||||
ab
|
||||
X
|
||||
Y
|
||||
|
||||
X
|
||||
X
|
||||
a
|
||||
X
|
||||
a
|
||||
X
|
||||
Y
|
||||
X
|
||||
Y
|
||||
a
|
||||
X
|
||||
ab
|
||||
X
|
||||
abc
|
||||
X
|
||||
ab
|
||||
X
|
||||
c
|
||||
ab
|
||||
X
|
||||
Y
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
X
|
||||
X
|
||||
a
|
||||
|
||||
X
|
||||
X
|
||||
a
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
X
|
||||
X
|
||||
a
|
||||
|
||||
X
|
||||
X
|
||||
a
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
X
|
||||
Xa
|
||||
Xa
|
||||
XY
|
||||
XY
|
||||
XY
|
||||
XZ
|
||||
X Y
|
||||
X Y
|
||||
X Z
|
||||
XX
|
||||
XXa
|
||||
XXY
|
||||
|
||||
X
|
||||
Xa
|
||||
Xa
|
||||
XY
|
||||
XY
|
||||
XY
|
||||
XZ
|
||||
X Y
|
||||
X Y
|
||||
X Z
|
||||
XX
|
||||
XXa
|
||||
XXY
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
X
|
||||
a
|
||||
}
|
||||
|
||||
@@ -308,7 +308,13 @@ ui_get_shellsize()
|
||||
int retval;
|
||||
|
||||
#ifdef FEAT_GUI
|
||||
if (gui.in_use)
|
||||
if (gui.in_use
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
/* Avoid using terminal dimensions for GUI window. MacVim
|
||||
* autosaves the dimensions of the first window. */
|
||||
|| gui.starting
|
||||
# endif
|
||||
)
|
||||
retval = gui_get_shellsize();
|
||||
else
|
||||
#endif
|
||||
|
||||
@@ -504,6 +504,11 @@ static char *(features[]) =
|
||||
#else
|
||||
"-sniff",
|
||||
#endif
|
||||
#ifdef STARTUPTIME
|
||||
"+startuptime",
|
||||
#else
|
||||
"-startuptime",
|
||||
#endif
|
||||
#ifdef FEAT_STL_OPT
|
||||
"+statusline",
|
||||
#else
|
||||
@@ -691,6 +696,78 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
303,
|
||||
/**/
|
||||
302,
|
||||
/**/
|
||||
301,
|
||||
/**/
|
||||
300,
|
||||
/**/
|
||||
299,
|
||||
/**/
|
||||
298,
|
||||
/**/
|
||||
297,
|
||||
/**/
|
||||
296,
|
||||
/**/
|
||||
295,
|
||||
/**/
|
||||
294,
|
||||
/**/
|
||||
293,
|
||||
/**/
|
||||
292,
|
||||
/**/
|
||||
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,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user