From ab5668e940f7c7a6bc67535fd3db3c4706a26a0f Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 8 Jun 2016 14:59:34 +0800 Subject: [PATCH] src/Builder4/WindowRooView.bjs src/Builder4/WindowRooView.vala --- src/Builder4/WindowRooView.bjs | 2 +- src/Builder4/WindowRooView.vala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Builder4/WindowRooView.bjs b/src/Builder4/WindowRooView.bjs index a6d6da75f..491106320 100644 --- a/src/Builder4/WindowRooView.bjs +++ b/src/Builder4/WindowRooView.bjs @@ -158,7 +158,7 @@ { "listeners" : { "button_release_event" : "() => {\n\tthis.onCursorChanged();\n\n\treturn false;\n}", - "key_press_event" : "() => {\n\tthis.onCursorChanged();\n\treturn false;\n}" + "key_press_event" : "() => {\n\tthis.onCursorChanged();\n\treturn false; \n}" }, "gboolean show_line_marks" : true, "| void onCursorChanged" : "(/*ParamSpec ps*/) {\n\t if (this.loading) {\n return;\n }\n // if (ps.name != \"cursor-position\") {\n // return;\n // }\n\n var buf = this.el.get_buffer();\n print(\"cursor changed : %d\\n\", buf.cursor_position);\n Gtk.TextIter cpos;\n buf.get_iter_at_offset(out cpos, buf.cursor_position);\n \n var ln = cpos.get_line();\n\t\tprint(\"cursor changed line : %d\\n\", ln);\n var node = _this.file.lineToNode(ln+1);\n \n if (node == null) {\n print(\"can not find node\\n\");\n return;\n }\n var prop = node.lineToProp(ln+1);\n print(\"prop : %s\", prop == null ? \"???\" : prop);\n \n \n \n \n // ---------- this selects the tree's node...\n \n var ltree = _this.main_window.windowstate.left_tree;\n var tp = ltree.model.treePathFromNode(node);\n print(\"got tree path %s\\n\", tp);\n if (tp != \"\") {\n\t this.allow_node_scroll = false; /// block node scrolling..\n\t \n\t \n\t //print(\"changing cursor on tree..\\n\");\n\t \n \n \n // let's try allowing editing on the methods.\n // a little klunky at present..\n this.prop_selected = \"\";\n if (prop != null) {\n \t\t//see if we can find it..\n \t\tvar kv = prop.split(\":\");\n \t\tif (kv[0] == \"p\") {\n \t\t\n\t \t\t//var k = prop.get_key(kv[1]);\n\t \t\t// fixme -- need to determine if it's an editable property...\n\t \t\tthis.prop_selected = prop;\n\t \t\t\n \t\t} else if (kv[0] == \"l\") {\n \t\t\t this.prop_selected = prop;\n \t\t\t\n \t\t}\n }\n ltree.view.setCursor(tp, \"editor\");\n // ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false); \n this.nodeSelected(node,false);\n \n // scrolling is disabled... as node selection calls scroll 10ms after it changes.\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {\n\t this.allow_node_scroll = true;\n\t return false;\n });\n }\n \n // highlight the node..\n}\n ", diff --git a/src/Builder4/WindowRooView.vala b/src/Builder4/WindowRooView.vala index f2d1908c5..305c04383 100644 --- a/src/Builder4/WindowRooView.vala +++ b/src/Builder4/WindowRooView.vala @@ -1033,7 +1033,7 @@ public class Xcls_WindowRooView : Object }); this.el.key_press_event.connect( () => { this.onCursorChanged(); - return false; + return false; }); } -- 2.39.2