Patches item #2569381, was opened at 2009-02-05 14:03
Message generated for change (Settings changed) made by voxmea
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=300588&aid=2569381&group_id=588
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: texteditor
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Matthew Gilbert (voxmea)
>Assigned to: Kazutoshi Satoda (k_satoda)
Summary: Adds option to search all open buffers to complete word
Initial Comment:
Adds option to search all open buffers to build the completion list.
My guess was that the TextArea options pane was the most logical place for the option, but I'm open to suggestions.
----------------------------------------------------------------------
Comment By: Matthew Gilbert (voxmea)
Date: 2009-05-26 14:35
Message:
I've been using this change for many months now and have not once noticed a
performance consequence (again with many open buffers). Another request to
have this committed. Thanks! _matt
----------------------------------------------------------------------
Comment By: Matthew Gilbert (voxmea)
Date: 2009-03-13 12:23
Message:
I've been using this patch for a while now with a large number of buffers
open (> 50 frequently) and found no noticeable performance penalty. Any
chance getting this committed? Thanks
----------------------------------------------------------------------
Comment By: Matthew Gilbert (voxmea)
Date: 2009-02-05 17:04
Message:
Sorry about the copy-paste errors. Thanks for fixing. I'll submit another
patch with updated docs.
----------------------------------------------------------------------
Comment By: Kazutoshi Satoda (k_satoda)
Date: 2009-02-05 16:43
Message:
Thank you for quick fix. I'll replace my change with this patch, and
start testing in real work.
Some small issues:
- The explicit fold for getVisibleBuffers() lacks the end.
- The overrided visit(EditPane) can be reduced to just one line.
buffers.add(editPane.getBuffer());
HashSet avoids duplicates by itself.
... and, it'll be perfect if you update the docs. I found the
corresponding section in doc/users-guide/text-edit.xml.
----------------------------------------------------------------------
Comment By: Matthew Gilbert (voxmea)
Date: 2009-02-05 15:59
Message:
Thanks for the suggestions. I believe this fixes everything.
As for performance... the option defaults to off. I could add some
documentation on the option with a warning that this could impact
performance with a large number of buffers open.
File Added: complete_word_2.diff
----------------------------------------------------------------------
Comment By: Kazutoshi Satoda (k_satoda)
Date: 2009-02-05 15:08
Message:
Great. I have had a local change which just replaces the behavior to use
all buffers for almost a year. The reason not having submitted it as a
patch was because I'm not sure about possible performance problem, and
if there really is such problem, it may require a new option, which I
feel difficult to craft.
As for your patch, I have some suggestion.
I hate code duplication, really. Instead of duplicating the code, I
suggest like the following:
Collection<Buffer> sourceBuffers
= jEdit.getBooleanProperty("completeFromAllBuffers")
? Arrays.asList(jEdit.getBuffers())
: getVisibleBuffers();
for (Buffer b: sourceBuffers)
...
The method getVisibleBuffers() is a new private method which returns
Set<Buffer> buffers in the current code.
java.util.Arrays is used without import. I know this has no problems,
but importing it is more convetional.
Added log "visting buffer ..." seems unnecessary.
The "return;" after "if(buffers.contains(b))" is mis-indented. But
these lines will be removed if the first suggestion is applied.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=300588&aid=2569381&group_id=588
|