|
@@ -6,6 +6,7 @@ class CdbTable extends hide.ui.View<{}> {
|
|
|
var editor : hide.comp.cdb.Editor;
|
|
|
var currentSheet : String;
|
|
|
var tabCache : String;
|
|
|
+ var tabs : hide.comp.Tabs;
|
|
|
var view : cdb.DiffFile.ConfigView;
|
|
|
|
|
|
public function new( ?state ) {
|
|
@@ -23,6 +24,16 @@ class CdbTable extends hide.ui.View<{}> {
|
|
|
view = cast this.config.get("cdb.view");
|
|
|
}
|
|
|
|
|
|
+ public function goto( s : cdb.Sheet, line : Int, column : Int ) {
|
|
|
+ var sheets = [for( s in getSheets() ) s.name];
|
|
|
+ var index = sheets.indexOf(s.name);
|
|
|
+ if( index < 0 ) return;
|
|
|
+ tabs.currentTab = tabContents[index].parent();
|
|
|
+ editor.cursor.setDefault(line, column);
|
|
|
+ editor.focus();
|
|
|
+ haxe.Timer.delay(() -> editor.cursor.update(), 1); // scroll
|
|
|
+ }
|
|
|
+
|
|
|
function syncTabs() {
|
|
|
if( getTabCache() != tabCache || editor.getCurrentSheet() != currentSheet ) {
|
|
|
currentSheet = editor.getCurrentSheet();
|
|
@@ -47,6 +58,7 @@ class CdbTable extends hide.ui.View<{}> {
|
|
|
editor.show(sheets[index],tabContents[index]);
|
|
|
currentSheet = editor.getCurrentSheet();
|
|
|
ide.currentConfig.set("cdb.currentSheet", sheets[index].name);
|
|
|
+ haxe.Timer.delay(editor.focus,1);
|
|
|
}
|
|
|
|
|
|
override function onDisplay() {
|
|
@@ -61,7 +73,7 @@ class CdbTable extends hide.ui.View<{}> {
|
|
|
return;
|
|
|
}
|
|
|
element.addClass("cdb-view");
|
|
|
- var tabs = new hide.comp.Tabs(element, true);
|
|
|
+ tabs = new hide.comp.Tabs(element, true);
|
|
|
tabCache = getTabCache();
|
|
|
tabContents = [];
|
|
|
for( sheet in sheets ) {
|