mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-12 18:39:45 +00:00
Fix #948: disable syntax highlighing when file is too big
This commit is contained in:
@@ -118,7 +118,7 @@ namespace QuickLook.Plugin.TextViewer
|
||||
private class TruncateLongLines : VisualLineElementGenerator
|
||||
{
|
||||
const int MAX_LENGTH = 10000;
|
||||
const string ELLIPSIS = "……………";
|
||||
const string ELLIPSIS = "⁞⁞[TRUNCATED]⁞⁞";
|
||||
|
||||
public override int GetFirstInterestedOffset(int startOffset)
|
||||
{
|
||||
@@ -181,7 +181,9 @@ namespace QuickLook.Plugin.TextViewer
|
||||
Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
Encoding = encoding;
|
||||
SyntaxHighlighting = HighlightingManager.Instance.GetDefinitionByExtension(Path.GetExtension(path));
|
||||
SyntaxHighlighting = tooLong
|
||||
? null
|
||||
: HighlightingManager.Instance.GetDefinitionByExtension(Path.GetExtension(path));
|
||||
Document = doc;
|
||||
|
||||
_context.IsBusy = false;
|
||||
|
Reference in New Issue
Block a user