diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2014-01-20 19:32:53 +0400 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2014-10-21 18:39:14 +0400 |
commit | f73b2a9990495587d514aa1856919c21170a3940 (patch) | |
tree | 9842411ee8644ead5915a715ee7e53984a601df4 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs | |
parent | a2046b6331a271e8203df7d3d0f14500d33d60fa (diff) |
Initial drop of the new project model
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.cs | 21 |
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; |