@@ -33,11 +33,15 @@ public class Jorts.TextView : Granite.HyperTextView {
3333 list_item_start = Application . gsettings. get_string (" list-item-start" );
3434 // Application.gsettings.bind ("list-item-start", this, "list-item-start", GLib.SettingsBindFlags.GET);
3535
36+ Application . gsettings. changed[" list-item-start" ]. connect (
37+ () = > {list_item_start = Application . gsettings. get_string (" list-item-start" );});
38+
3639 keyboard = new Gtk .EventControllerKey ();
3740 add_controller (keyboard);
38-
3941 keyboard. key_pressed. connect (on_key_pressed);
4042 keyboard. key_released. connect (on_key_released);
43+
44+ buffer. notify[" cursor_position" ]. connect (on_cursor_changed);
4145 }
4246
4347 public void paste () {
@@ -181,7 +185,6 @@ public class Jorts.TextView : Granite.HyperTextView {
181185
182186 // User did Enter
183187 if (keyval == Gdk . Key . Return ) {
184-
185188 Gtk . TextIter start, end;
186189 buffer. get_selection_bounds (out start, out end);
187190 start. backward_line ();
@@ -194,7 +197,16 @@ public class Jorts.TextView : Granite.HyperTextView {
194197 buffer. end_user_action ();
195198 }
196199 }
200+ }
197201
202+ private void on_cursor_changed () {
203+ Gtk . TextIter start, end;
204+ buffer. get_selection_bounds (out start, out end);
205+ start. backward_line ();
206+ var line_number = (uint8 )start. get_line ();
198207
208+ if (this . has_prefix (line_number)) {
209+ print (" YES THIS IS LIST" );
210+ }
199211 }
200212}
0 commit comments