Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs21
1 files changed, 11 insertions, 10 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs
index cd1ab5e91b..0d1fd091d4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs
@@ -22,10 +22,10 @@
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System.IO;
-using System.Linq;
+// THE SOFTWARE.
+
+using System.IO;
+using System.Linq;
using MonoDevelop.Projects;
using MonoDevelop.Ide.Gui;
using System.Text;
@@ -80,8 +80,9 @@ namespace MonoDevelop.Ide.FindInFiles
if (buffer != null)
return buffer.ToString ();
var doc = SearchDocument ();
- if (doc != null)
+ if (doc != null && doc.Editor != null) {
return doc.Editor.Text;
+ }
try {
if (!File.Exists (FileName))
return null;
@@ -92,11 +93,11 @@ namespace MonoDevelop.Ide.FindInFiles
}
}
- Document SearchDocument ()
- {
- return IdeApp.Workbench.Documents.FirstOrDefault(d => !string.IsNullOrEmpty (d.FileName) && Path.GetFullPath (d.FileName) == Path.GetFullPath (FileName));
- }
-
+ Document SearchDocument ()
+ {
+ return IdeApp.Workbench.Documents.FirstOrDefault(d => !string.IsNullOrEmpty (d.FileName) && Path.GetFullPath (d.FileName) == Path.GetFullPath (FileName));
+ }
+
Document document;
StringBuilder buffer = null;
bool somethingReplaced;