diff --git a/src/MacVim/MMAtsuiTextView.h b/src/MacVim/MMAtsuiTextView.h index 9f588d89d6..47e6cc2e9d 100644 --- a/src/MacVim/MMAtsuiTextView.h +++ b/src/MacVim/MMAtsuiTextView.h @@ -8,10 +8,11 @@ * See README.txt for an overview of the Vim source code. */ -#if ENABLE_ATSUI #import -#import "MMTextView.h" +#import "Miscellaneous.h" + +#if MM_ENABLE_ATSUI enum { MMMaxCellsPerChar = 2 }; @@ -100,4 +101,4 @@ enum { MMMaxCellsPerChar = 2 }; @end -#endif // ENABLE_ATSUI +#endif // MM_ENABLE_ATSUI diff --git a/src/MacVim/MMAtsuiTextView.m b/src/MacVim/MMAtsuiTextView.m index da32c57a74..426063078a 100644 --- a/src/MacVim/MMAtsuiTextView.m +++ b/src/MacVim/MMAtsuiTextView.m @@ -25,15 +25,13 @@ * resized. */ -#if ENABLE_ATSUI - #import "MMAppController.h" #import "MMAtsuiTextView.h" #import "MMTextViewHelper.h" #import "MMVimController.h" #import "MMWindowController.h" -#import "Miscellaneous.h" +#if MM_ENABLE_ATSUI // TODO: What does DRAW_TRANSP flag do? If the background isn't drawn when // this flag is set, then sometimes the character after the cursor becomes @@ -1272,4 +1270,4 @@ defaultLineHeightForFont(NSFont *font) @end // MMAtsuiTextView (Drawing) -#endif // ENABLE_ATSUI +#endif // MM_ENABLE_ATSUI diff --git a/src/MacVim/MMCoreTextView.h b/src/MacVim/MMCoreTextView.h index 7a9bb73d97..babbd3b8c1 100644 --- a/src/MacVim/MMCoreTextView.h +++ b/src/MacVim/MMCoreTextView.h @@ -9,7 +9,9 @@ */ #import +#import "Miscellaneous.h" // Defines MM_ENABLE_ATSUI +#if !MM_ENABLE_ATSUI @class MMTextViewHelper; @@ -95,3 +97,5 @@ - (NSSize)constrainRows:(int *)rows columns:(int *)cols toSize:(NSSize)size; @end + +#endif // !MM_ENABLE_ATSUI diff --git a/src/MacVim/MMCoreTextView.m b/src/MacVim/MMCoreTextView.m index e56d1026af..6b5bd8f01c 100644 --- a/src/MacVim/MMCoreTextView.m +++ b/src/MacVim/MMCoreTextView.m @@ -25,12 +25,15 @@ * resized. */ +#import "Miscellaneous.h" // Defines MM_ENABLE_ATSUI + +#if !MM_ENABLE_ATSUI + #import "MMAppController.h" #import "MMCoreTextView.h" #import "MMTextViewHelper.h" #import "MMVimController.h" #import "MMWindowController.h" -#import "Miscellaneous.h" // TODO: What does DRAW_TRANSP flag do? If the background isn't drawn when @@ -1292,3 +1295,5 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGSize *advances, } @end // MMCoreTextView (Drawing) + +#endif // !MM_ENABLE_ATSUI diff --git a/src/MacVim/MMVimView.m b/src/MacVim/MMVimView.m index 429240a5b3..9eb1d89815 100644 --- a/src/MacVim/MMVimView.m +++ b/src/MacVim/MMVimView.m @@ -18,6 +18,8 @@ * the view is filled by the text view. */ +#import "Miscellaneous.h" // Defines MM_ENABLE_ATSUI + #if MM_ENABLE_ATSUI # import "MMAtsuiTextView.h" #else @@ -27,7 +29,6 @@ #import "MMVimController.h" #import "MMVimView.h" #import "MMWindowController.h" -#import "Miscellaneous.h" #import @@ -96,17 +97,20 @@ enum { NSInteger renderer = [ud integerForKey:MMRendererKey]; ASLogInfo(@"Use renderer=%d", renderer); +#if MM_ENABLE_ATSUI + if (MMRendererATSUI == renderer) { + // HACK! 'textView' has type MMTextView, but MMAtsuiTextView is not + // derived from MMTextView. + textView = [[MMAtsuiTextView alloc] initWithFrame:frame]; + } +#else 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]; + } #endif - } else { + else { // Use Cocoa text system for text rendering. textView = [[MMTextView alloc] initWithFrame:frame]; }