diff --git a/src/main.tsx b/src/main.tsx index 241ffbf8..45b6f9c8 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -389,6 +389,17 @@ class LineCmd extends React.Component<{sw : ScreenWindow, line : LineType, width let {line} = this.props; GlobalCommandRunner.swSelectLine(String(line.linenum), "cmd"); } + + @boundMethod + clickStar() { + let {line} = this.props; + if (!line.star || line.star == 0) { + GlobalCommandRunner.lineStar(line.lineid, 1); + } + else { + GlobalCommandRunner.lineStar(line.lineid, 0); + } + } render() { let {sw, line, width, staticRender, visible} = this.props; @@ -446,6 +457,15 @@ class LineCmd extends React.Component<{sw : ScreenWindow, line : LineType, width {this.renderCmdText(cmd, remote)} +
+
0})} onClick={this.clickStar}> + + + + 0}> + + +
diff --git a/src/model.ts b/src/model.ts index 3203ab4e..efffe932 100644 --- a/src/model.ts +++ b/src/model.ts @@ -2299,6 +2299,10 @@ class CommandRunner { swSetFocus(focusVal : string) : void { GlobalModel.submitCommand("sw", "set", null, {"focus": focusVal, "nohist": "1"}, true); } + + lineStar(lineId : string, starVal : number) { + GlobalModel.submitCommand("line", "star", [lineId, String(starVal)], {"nohist": "1"}, true); + } }; function cmdPacketString(pk : FeCmdPacketType) : string { diff --git a/src/sh2.less b/src/sh2.less index 84298b91..31cb1f25 100644 --- a/src/sh2.less +++ b/src/sh2.less @@ -407,6 +407,22 @@ html, body, #main { } } + .line-star { + display: none; + cursor: pointer; + padding: 3px; + font-size: 1.5rem; + } + + .line-star.active { + display: block; + color: @term-bright-yellow; + } + + &:hover .line-star { + display: block; + } + &.has-rtnstate .terminal-wrapper { padding-bottom: 0; margin-bottom: -5px; @@ -1420,3 +1436,7 @@ input[type=checkbox] { font-size: 12px; margin-left: -3px; } + +.flex-spacer { + flex-grow: 1; +} diff --git a/src/types.ts b/src/types.ts index d3af31cd..d759e3bd 100644 --- a/src/types.ts +++ b/src/types.ts @@ -27,6 +27,7 @@ type LineType = { text : string, cmdid : string, contentheight : number, + star : number, ephemeral? : boolean, remove? : boolean, };