Browse Source

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
shortcuts
Daniel Grunwald 21 years ago
parent
commit
ce2c0b3e67
  1. 8
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/Indentation.cs
  2. 5
      src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeView.cs

8
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/Indentation.cs

@ -85,7 +85,9 @@ namespace CSharpBinding.FormattingStrategy @@ -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 @@ -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 @@ -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 &&

5
src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeView.cs

@ -141,6 +141,11 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -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)

Loading…
Cancel
Save