mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-02-08 00:21:23 +01:00
working on line selection / fg commands
This commit is contained in:
parent
271dde4d1d
commit
ab31aecf90
32
src/model.ts
32
src/model.ts
@ -281,6 +281,15 @@ class ScreenWindow {
|
|||||||
this.setScrollTop_debounced = debounce(1000, this.setScrollTop.bind(this));
|
this.setScrollTop_debounced = debounce(1000, this.setScrollTop.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateSelf(swdata : ScreenWindowType) {
|
||||||
|
mobx.action(() => {
|
||||||
|
this.name.set(swdata.name);
|
||||||
|
this.layout.set(swdata.layout);
|
||||||
|
this.selectedLine.set(swdata.selectedline);
|
||||||
|
// do not set scrolltop!
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
|
||||||
setScrollTop(scrollTop : number) : void {
|
setScrollTop(scrollTop : number) : void {
|
||||||
GlobalCommandRunner.swSetScrollTop(this.sessionId, this.screenId, this.windowId, scrollTop);
|
GlobalCommandRunner.swSetScrollTop(this.sessionId, this.screenId, this.windowId, scrollTop);
|
||||||
}
|
}
|
||||||
@ -1444,11 +1453,11 @@ class Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMetaArrowUp() : void {
|
onMetaArrowUp() : void {
|
||||||
GlobalCommandRunner.swSelectLine("-");
|
GlobalCommandRunner.swSelectLine("-1");
|
||||||
}
|
}
|
||||||
|
|
||||||
onMetaArrowDown() : void {
|
onMetaArrowDown() : void {
|
||||||
GlobalCommandRunner.swSelectLine("+");
|
GlobalCommandRunner.swSelectLine("+1");
|
||||||
}
|
}
|
||||||
|
|
||||||
onMetaArrowUpOld() : void {
|
onMetaArrowUpOld() : void {
|
||||||
@ -1635,6 +1644,9 @@ class Model {
|
|||||||
if ("window" in update) {
|
if ("window" in update) {
|
||||||
this.updateWindow(update.window, false);
|
this.updateWindow(update.window, false);
|
||||||
}
|
}
|
||||||
|
if ("screenwindow" in update) {
|
||||||
|
this.updateSW(update.screenwindow);
|
||||||
|
}
|
||||||
if ("remotes" in update) {
|
if ("remotes" in update) {
|
||||||
if (update.connect) {
|
if (update.connect) {
|
||||||
this.remotes.clear();
|
this.remotes.clear();
|
||||||
@ -1715,6 +1727,14 @@ class Model {
|
|||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateSW(swdata : ScreenWindowType) {
|
||||||
|
let sw = this.getSWByIds(swdata.sessionid, swdata.screenid, swdata.windowid);
|
||||||
|
if (sw == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
sw.updateSelf(swdata);
|
||||||
|
}
|
||||||
|
|
||||||
getScreenById(sessionId : string, screenId : string) : Screen {
|
getScreenById(sessionId : string, screenId : string) : Screen {
|
||||||
let session = this.getSessionById(sessionId);
|
let session = this.getSessionById(sessionId);
|
||||||
if (session == null) {
|
if (session == null) {
|
||||||
@ -1748,6 +1768,14 @@ class Model {
|
|||||||
return screen.getSW(windowId);
|
return screen.getSW(windowId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getSWByIds(sessionId : string, screenId : string, windowId : string) : ScreenWindow {
|
||||||
|
let screen = this.getScreenById(sessionId, screenId);
|
||||||
|
if (screen == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return screen.getSW(windowId);
|
||||||
|
}
|
||||||
|
|
||||||
getActiveScreen() : Screen {
|
getActiveScreen() : Screen {
|
||||||
let session = this.getActiveSession();
|
let session = this.getActiveSession();
|
||||||
if (session == null) {
|
if (session == null) {
|
||||||
|
@ -446,7 +446,7 @@ html, body, #main {
|
|||||||
align-self: flex-start;
|
align-self: flex-start;
|
||||||
|
|
||||||
&.focus {
|
&.focus {
|
||||||
box-shadow: 0 0 3px 3px rgba(255, 255, 255, 0.3);
|
/* box-shadow: 0 0 3px 3px rgba(255, 255, 255, 0.3); */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,6 +261,7 @@ type ModelUpdateType = {
|
|||||||
sessions? : SessionDataType[],
|
sessions? : SessionDataType[],
|
||||||
activesessionid? : string,
|
activesessionid? : string,
|
||||||
window? : WindowDataType,
|
window? : WindowDataType,
|
||||||
|
screenwindow? : ScreenWindowType,
|
||||||
line? : LineType,
|
line? : LineType,
|
||||||
cmd? : CmdDataType,
|
cmd? : CmdDataType,
|
||||||
info? : InfoType,
|
info? : InfoType,
|
||||||
|
Loading…
Reference in New Issue
Block a user