diff --git a/src/webshare-elems.tsx b/src/webshare-elems.tsx index 2b7da130c..a321e4c75 100644 --- a/src/webshare-elems.tsx +++ b/src/webshare-elems.tsx @@ -25,6 +25,8 @@ let foo = LinesView; // TODO scroll screen when new cmds arrive (selection) // TODO archived should delete line // TODO implement linedel +// TODO reshare +// TODO contentheight function makeFullRemoteRef(ownerName : string, remoteRef : string, name : string) : string { if (isBlank(ownerName) && isBlank(name)) { @@ -347,6 +349,9 @@ class TerminalRenderer extends React.Component<{line : T.WebLine, cmd : T.WebCmd if (termWrap != null) { termWrap.giveFocus(); } + mobx.action(() => { + WebShareModel.setSelectedLine(line.linenum); + })(); } render() { @@ -355,8 +360,12 @@ class TerminalRenderer extends React.Component<{line : T.WebLine, cmd : T.WebCmd let usedRows = WebShareModel.getUsedRows(lineutil.getWebRendererContext(line), line, cmd, width); let termHeight = termHeightFromRows(usedRows, WebShareModel.getTermFontSize()); let termLoaded = this.termLoaded.get(); + let isFocused = (WebShareModel.getSelectedLine() == line.linenum); return (
+ +
+
...
diff --git a/src/webshare-model.ts b/src/webshare-model.ts index df335d79a..0ab7449ff 100644 --- a/src/webshare-model.ts +++ b/src/webshare-model.ts @@ -58,6 +58,13 @@ class WebShareModelClass { return 0; } + setSelectedLine(lineNum : number) : void { + let fullScreen = this.screen.get(); + if (fullScreen != null) { + return fullScreen.screen.selectedline = lineNum; + } + } + setAnchorFields(anchorLine : number, anchorOffset : number, reason : string) : void { this.anchor.anchorLine = anchorLine; this.anchor.anchorOffset = anchorOffset;