X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=src%2FBuilder4%2FEditor.bjs;h=890179bc774c8337de79d2913411d283f1f137ae;hb=c9b0f1bdabe89b2f14ffd18c32fb54ef5899e7b4;hp=365c28082479bfc029c008366db7be52d4d3ebe1;hpb=f7613166206aa8842e68450fa7478e4044a01ef0;p=roobuilder diff --git a/src/Builder4/Editor.bjs b/src/Builder4/Editor.bjs index 365c28082..890179bc7 100644 --- a/src/Builder4/Editor.bjs +++ b/src/Builder4/Editor.bjs @@ -422,7 +422,7 @@ " _this.file.setSource(str);", "\t BuilderApplication.showSpinner(\"appointment soon\",\"document change pending\");", " \t_this.file.getLanguageServer().document_change(_this.file);", - "", + "\t\t_this.file.getLanguageServer().queueDocumentSymbols(_this.file);", " _this.file.setSource(oldcode);", " ", "\t\t ", @@ -1282,7 +1282,21 @@ "\tforeach(var sym in syms) {", "\t\t_this.navliststore.el.append(sym);", "\t}", - "\t", + "\tthis.last_selected_line = -1;", + "\tGLib.Idle.add(() => {", + "", + "\t\tGtk.TextIter iter;", + "\t\t_this.buffer.el.get_iter_at_offset (", + "\t\t\t\tout iter, _this.buffer.el.cursor_position);", + "\t\t", + "\t\tGLib.debug(\"idle update scroll %d, %d\", iter.get_line(),", + "\t\t\t\titer.get_line_offset());", + "\t\tthis.updateSelectedLine(", + "\t\t\t\t(uint)iter.get_line(),", + "\t\t\t\t(uint)iter.get_line_offset()", + "\t\t);", + "\t\treturn false;", + "\t});", "", "}" ], @@ -1522,8 +1536,15 @@ "(JsRender.JsRender file, JsRender.Node? node, JsRender.NodeProp? prop)", "{", " this.reset();", + " if (this.file != null) {", + " \tthis.file.navigation_tree_updated.disconnect(", + " \t\t_this.navigation.show", + " \t);", + " }", " this.file = file; ", - " ", + " this.file.navigation_tree_updated.connect(", + "\t\t_this.navigation.show", + "\t);", " if (file.xtype != \"PlainFile\") {", " \tthis.prop = prop;", " this.node = node;", @@ -1538,12 +1559,13 @@ " ", " } else {", " this.view.load( file.toSource() );", - " this.updateErrorMarks();", + " this.updateErrorMarks();", " this.close_btn.el.hide();", " var ls = file.getLanguageServer();", - " ls.documentSymbols.begin(file, (a,o) => {", - " \t_this.navigation.show(ls.documentSymbols.end(o)); ", - " });", + " ls.queueDocumentSymbols(file);", + " ////ls.documentSymbols.begin(file, (a,o) => {", + " //\t_this.navigation.show(ls.documentSymbols.end(o)); ", + " //});", " //documentSymbols", " ", " }",