From ce2c0b3e671fc3bc1f3fe3ee7c0c29265f04bd7d Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Wed, 20 Apr 2005 17:08:15 +0000 Subject: [PATCH] Fixed bug that prevented project scout treeview from redrawing when opening folder without contents. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@102 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/Src/FormattingStrategy/Indentation.cs | 8 +++++--- .../Project/Src/Gui/Components/ExtTreeView/ExtTreeView.cs | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/Indentation.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/Indentation.cs index bbd4b7d1e5..342f9d1228 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/Indentation.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/Indentation.cs @@ -85,7 +85,9 @@ namespace CSharpBinding.FormattingStrategy public void Step(IDocumentAccessor doc, IndentationSettings set) { - string line = doc.Text.TrimStart(); + string line = doc.Text; + if (line.Length == 0) return; // leave empty lines empty + line = line.TrimStart(); StringBuilder indent = new StringBuilder(); if (line.Length == 0) { @@ -273,7 +275,7 @@ namespace CSharpBinding.FormattingStrategy if (startInString) return; if (startInComment && line[0] != '*') return; - if (doc.Text.StartsWith("//\t")) + if (doc.Text.StartsWith("//\t") || doc.Text == "//") return; if (line[0] == '}') { @@ -306,7 +308,7 @@ namespace CSharpBinding.FormattingStrategy if (doc.ReadOnly) { // We can't change the current line, but we should accept the existing - // indentation if possible (so if the current statement is not a multiline + // indentation if possible (=if the current statement is not a multiline // statement). if (!oldBlock.Continuation && !oldBlock.OneLineBlock && oldBlock.StartLine == block.StartLine && diff --git a/src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeView.cs b/src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeView.cs index 3da99e2654..c329b458d3 100644 --- a/src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeView.cs +++ b/src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeView.cs @@ -141,6 +141,11 @@ namespace ICSharpCode.SharpDevelop.Gui ((ExtTreeNode)e.Node).Expanding(); } SortNodes(e.Node); + if (e.Node.Nodes.Count == 0) { + // when the node's subnodes have been removed by Expanding, AfterExpand is not called + inRefresh = false; + EndUpdate(); + } } protected override void OnAfterExpand(TreeViewEventArgs e)