|
From: Thomas M. <tho...@we...> - 2013-03-28 19:27:29
|
Hi,
this commit has a huge performance impact on HyperSearch:
commit c338d320441d359a0cf1101708611ba7a6ddfae3
Author: Matthieu Casanova <kp...@us...>
Date: Mon Feb 28 11:38:01 2011 +0000
A temporary buffer was not settings it's edit mode, breaking the hypersearch request since new feature that search for whole word
diff --git a/org/gjt/sp/jedit/Buffer.java b/org/gjt/sp/jedit/Buffer.java
index 0c5dcbe..6c37629 100644
--- a/org/gjt/sp/jedit/Buffer.java
+++ b/org/gjt/sp/jedit/Buffer.java
@@ -253,7 +253,9 @@ public class Buffer extends JEditBuffer
undoMgr.setLimit(jEdit.getIntegerProperty(
"buffer.undoCount",100));
- if(!getFlag(TEMPORARY))
+ if (getFlag(TEMPORARY))
+ setMode();
+ else
finishLoading();
setLoading(false);
There is also a second commit which add a not so helpful comment:
commit d22adc97813ba7f7fed7a1e5f6a155fa5427bb43
Author: Matthieu Casanova <kp...@us...>
Date: Mon Feb 28 11:49:36 2011 +0000
added comments
diff --git a/org/gjt/sp/jedit/Buffer.java b/org/gjt/sp/jedit/Buffer.java
index 6c37629..ea91471 100644
--- a/org/gjt/sp/jedit/Buffer.java
+++ b/org/gjt/sp/jedit/Buffer.java
@@ -253,6 +253,10 @@ public class Buffer extends JEditBuffer
undoMgr.setLimit(jEdit.getIntegerProperty(
"buffer.undoCount",100));
+ // If the buffer is temporary, we don't need to
+ // call finishLoading() because it sets the FoldHandler
+ // and reload markers. But we always need to set the edit
+ // mode that is necessary for HyperSearch on directories
if (getFlag(TEMPORARY))
setMode();
else
So I guess, the idea was to fix the whole word search. Does anybody have
more infos on this change? Bug id? Patch id?
I usually don't use the whole word feature, but as I said above change
had a huge impact on all other HyperSearches as it loops for every file
in the search list all 180 or so mode files, which doesn't short circuit
for the first hit...
If the loaded mode for the buffer (why?) is really necessary for the
whole word search, then only load the mode file if the whole word search
flag is set, or exclusivity set the mode file in the HyperSearchRequest
for the temporary buffer, or something like that.
The current code feels wrong and is slow.
Ideas, answers and feedback welcome!
with kind regards
thomas
|