Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCXodeMiniMap makes Xcode slower #80

Open
Bluelich opened this issue Mar 16, 2016 · 3 comments
Open

SCXodeMiniMap makes Xcode slower #80

Bluelich opened this issue Mar 16, 2016 · 3 comments

Comments

@Bluelich
Copy link

The plugin list that used by me is below:
{
Alcatraz
ColorSenseRainbow
DBSmartPanels
DerivedData Exterminator
DXXcodeConsoleUnicodePlugin
FuzzyAutocomplete
HOStringSense
JSFormatter
Lin
MCLog
OMQuickHelp
Peckham
RTImageAssets
SCXcodeEditorInset
SCXcodeMinimap
VVDocumenter-Xcode
XAlign
}
When I remove SCXodeMiniMap, Xcode works well.

The version of my mac is 10.11.3, and my Xcode is version of 7.2(7C68).

@stefanceriu
Copy link
Owner

I does indeed make Xcode slower, mainly because of the larger amount of text that it now needs to syntax highlight, but, unfortunately, I haven't found any suitable solution to improve the performance and I had to settle on delaying when the text is invalidated.
If you have any ideas pull requests are more than welcome.

@dzenbot
Copy link

dzenbot commented Mar 23, 2016

What if we MiniMap didn't do any syntax highlight? That could help a lot, isn't it?

@stefanceriu
Copy link
Owner

Absolutely. You can give it a try by replacing the the layoutManager's shouldUseTemporaryAttributes delegate method with something along these lines:

- (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager
   shouldUseTemporaryAttributes:(NSDictionary *)attrs
             forDrawingToScreen:(BOOL)toScreen
               atCharacterIndex:(NSUInteger)charIndex
                 effectiveRange:(NSRangePointer)effectiveRange
{
    SCXcodeMinimapTheme *theme = ([layoutManager isEqualTo:self.textView.layoutManager] ? self.minimapTheme : self.editorTheme);
    return @{NSForegroundColorAttributeName : theme.sourcePlainTextColor};
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants