Skip to content

Commit

Permalink
Merge branch 'remove-whitespace-on-save' of https://github.com/paulcb…
Browse files Browse the repository at this point in the history
…etts/SaveAllTheTime into remove-whitespace-on-save
  • Loading branch information
anaisbetts committed Oct 23, 2013
2 parents f276b35 + 8b11c1b commit 6af0eb0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion SaveAllTheTime/DocumentMonitorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ public void SaveAll()
return;
}

if (!_dte.Solution.Saved) {
_dte.Solution.SaveAs(_dte.Solution.FullName);
}

foreach (Project project in _dte.Solution.Projects.Cast<Project>().Where(proj => !proj.Saved)) {
project.Save();
}

foreach (Document item in _dte.Documents.Cast<Document>().Where(item => !item.Saved)) {
item.Save();
}
Expand Down Expand Up @@ -211,7 +219,7 @@ bool shouldSaveActiveDocument()
return false;
}

if (_sessionDocumentsLookup.Contains(name)) {
if (_sessionDocumentsLookup.Contains(name) || name.EndsWith("sln", StringComparison.InvariantCulture) || name.EndsWith("proj", StringComparison.InvariantCulture)) {
return true;
}

Expand Down

0 comments on commit 6af0eb0

Please sign in to comment.