diff --git a/core/org.eclipse.cdt.ui/ChangeLog b/core/org.eclipse.cdt.ui/ChangeLog index 15e40bf5800..63d6fc25bec 100644 --- a/core/org.eclipse.cdt.ui/ChangeLog +++ b/core/org.eclipse.cdt.ui/ChangeLog @@ -1,3 +1,9 @@ +2002-11-20 David Inglis + * src/.../internal/ui/BuildConsoleManager.java + Only flush the console when buffer > 512 instead of every line. + Plus do the console update synchronously as a async update can + cause problems if the update happen faster then the drawing. + 2002-11-18 Alain Magloire * src/.../internal/ui/editor/CEditor.java (createCSourceViewer): diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java index ef22c4a32a3..984ce06f60e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java @@ -70,20 +70,25 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang return fDocument; } - public synchronized void flush() throws IOException { - super.flush(); - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (CPluginPreferencePage.isConsoleOnTop()) - bringConsoleOnTop(); - try { - int len = fDocument.getLength(); - fDocument.replace(len, 0, readBuffer()); + public void flush() throws IOException { + flush(false); + } + + public void flush(boolean force) throws IOException { + if ( force || fBuffer.length() > 512) { + Display.getDefault().syncExec(new Runnable() { + public void run() { + if (CPluginPreferencePage.isConsoleOnTop()) + bringConsoleOnTop(); + try { + int len = fDocument.getLength(); + fDocument.replace(len, 0, readBuffer()); + } + catch (BadLocationException x) { + } } - catch (BadLocationException x) { - } - } - }); + }); + } } void bringConsoleOnTop() { @@ -111,6 +116,11 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang } } } + + public void close() throws IOException { + flush(true); + } + } public BuildConsoleManager() {