mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-13 19:19:10 +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
|
private class TruncateLongLines : VisualLineElementGenerator
|
||||||
{
|
{
|
||||||
const int MAX_LENGTH = 10000;
|
const int MAX_LENGTH = 10000;
|
||||||
const string ELLIPSIS = "……………";
|
const string ELLIPSIS = "⁞⁞[TRUNCATED]⁞⁞";
|
||||||
|
|
||||||
public override int GetFirstInterestedOffset(int startOffset)
|
public override int GetFirstInterestedOffset(int startOffset)
|
||||||
{
|
{
|
||||||
@@ -181,7 +181,9 @@ namespace QuickLook.Plugin.TextViewer
|
|||||||
Dispatcher.BeginInvoke(new Action(() =>
|
Dispatcher.BeginInvoke(new Action(() =>
|
||||||
{
|
{
|
||||||
Encoding = encoding;
|
Encoding = encoding;
|
||||||
SyntaxHighlighting = HighlightingManager.Instance.GetDefinitionByExtension(Path.GetExtension(path));
|
SyntaxHighlighting = tooLong
|
||||||
|
? null
|
||||||
|
: HighlightingManager.Instance.GetDefinitionByExtension(Path.GetExtension(path));
|
||||||
Document = doc;
|
Document = doc;
|
||||||
|
|
||||||
_context.IsBusy = false;
|
_context.IsBusy = false;
|
||||||
|
Reference in New Issue
Block a user