[nemiver] Search from current insert point (Closes: #628886)



commit ef8802bf99e37ee87ded5e915e8b71450801327a
Author: Dodji Seketeli <dodji redhat com>
Date:   Mon Sep 6 16:23:45 2010 +0200

    Search from current insert point (Closes: #628886)
    
    	* src/uicommon/nmv-source-editor.cc (do_search): By default search
    	from the current insertion point, if it exists.

 src/uicommon/nmv-source-editor.cc |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/uicommon/nmv-source-editor.cc b/src/uicommon/nmv-source-editor.cc
index a82c242..d1c3ce7 100644
--- a/src/uicommon/nmv-source-editor.cc
+++ b/src/uicommon/nmv-source-editor.cc
@@ -1017,12 +1017,18 @@ SourceEditor::do_search (const UString &a_str,
     }
 
     SourceIter search_iter, limit;
+    if (source_view ().get_source_buffer ())
+        search_iter =
+            source_view ().get_source_buffer ()->get_insert ()->get_iter ();
+
     if (a_search_backwards) {
-        search_iter = source_buffer->end ();
+        if (!search_iter)
+            search_iter = source_buffer->end ();
         search_iter--;
         limit = source_buffer->begin ();
     } else {
-        search_iter = source_buffer->begin ();
+        if (!search_iter)
+            search_iter = source_buffer->begin ();
         limit = source_buffer->end ();
         limit--;
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]