nemiver r743 - in trunk: . src/uicommon



Author: jjongsma
Date: Sun Feb 10 04:53:23 2008
New Revision: 743
URL: http://svn.gnome.org/viewvc/nemiver?rev=743&view=rev

Log:
	* src/uicommon/nmv-source-editor.cc: initialize source buffer by placing
	cursor at the beginning of the buffer (see bug #515271).  Also add one to
	the column value so that it's 1-based not 0-based


Modified:
   trunk/ChangeLog
   trunk/src/uicommon/nmv-source-editor.cc

Modified: trunk/src/uicommon/nmv-source-editor.cc
==============================================================================
--- trunk/src/uicommon/nmv-source-editor.cc	(original)
+++ trunk/src/uicommon/nmv-source-editor.cc	Sun Feb 10 04:53:23 2008
@@ -251,7 +251,7 @@
 
     gint get_column_from_iter (const Gtk::TextBuffer::iterator &a_iter)
     {
-        return a_iter.get_line_offset () ;
+        return a_iter.get_line_offset () + 1;
     }
 
     bool get_absolute_resource_path (const UString &a_relative_path,
@@ -293,7 +293,6 @@
 
     void init ()
     {
-        update_line_col_label () ;
         status_box->pack_end (*line_col_label, Gtk::PACK_SHRINK, 6 /* padding */) ;
         init_signals () ;
         source_view->set_editable (false) ;
@@ -302,6 +301,10 @@
         register_breakpoint_marker_type
                                 (BREAKPOINT_DISABLED_CATEGORY,
                                  "icons/breakpoint-disabled-marker.png");
+
+        // move cursor to the beginning of the file
+        Glib::RefPtr<Gtk::TextBuffer> source_buffer = source_view->get_buffer ();
+        source_buffer->place_cursor (source_buffer->begin ());
     }
 
     Priv () :



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