mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-21 21:32:13 +01:00
better directory vs file completion
This commit is contained in:
parent
5082330dcf
commit
d5a5a9ce70
25
src/main.tsx
25
src/main.tsx
@ -308,6 +308,17 @@ class CmdInput extends React.Component<{}, {}> {
|
||||
GlobalModel.clearInfoMsg(true);
|
||||
model.submitRawCommand(commandStr);
|
||||
}
|
||||
|
||||
getAfterSlash(s : string) : string {
|
||||
let slashIdx = s.lastIndexOf("/");
|
||||
if (slashIdx == s.length-1) {
|
||||
slashIdx = s.lastIndexOf("/", slashIdx-1);
|
||||
}
|
||||
if (slashIdx == -1) {
|
||||
return s;
|
||||
}
|
||||
return s.substr(slashIdx+1);
|
||||
}
|
||||
|
||||
render() {
|
||||
let model = GlobalModel;
|
||||
@ -343,15 +354,15 @@ class CmdInput extends React.Component<{}, {}> {
|
||||
{infoMsg.infomsg}
|
||||
</div>
|
||||
</If>
|
||||
<If condition={infoMsg && infoMsg.infostrings != null && infoMsg.infostrings.length > 0}>
|
||||
<div className="info-strings">
|
||||
<For each="istr" index="istrIdx" of={infoMsg.infostrings}>
|
||||
<div key={istrIdx} className="info-string">
|
||||
{istr}
|
||||
<If condition={infoMsg && infoMsg.infocomps != null && infoMsg.infocomps.length > 0}>
|
||||
<div className="info-comps">
|
||||
<For each="istr" index="istrIdx" of={infoMsg.infocomps}>
|
||||
<div key={istrIdx} className="info-comp">
|
||||
{this.getAfterSlash(istr)}
|
||||
</div>
|
||||
</For>
|
||||
<If condition={infoMsg.infostringsmore}>
|
||||
<div key="more" className="info-string">
|
||||
<If condition={infoMsg.infocompsmore}>
|
||||
<div key="more" className="info-comp">
|
||||
...
|
||||
</div>
|
||||
</If>
|
||||
|
@ -499,10 +499,11 @@ class Session {
|
||||
}
|
||||
|
||||
type InfoType = {
|
||||
infotitle : string;
|
||||
infomsg : string;
|
||||
infoerror : string;
|
||||
infostrings : string[];
|
||||
infotitle : string,
|
||||
infomsg : string,
|
||||
infoerror : string,
|
||||
infocomps : string[],
|
||||
infocompsmore : boolean,
|
||||
};
|
||||
|
||||
type CmdLineUpdateType = {
|
||||
|
@ -513,13 +513,13 @@ body .xterm .xterm-viewport {
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.info-strings {
|
||||
.info-comps {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
padding-bottom: 5px;
|
||||
|
||||
.info-string {
|
||||
.info-comp {
|
||||
min-width: 200px;
|
||||
color: #d3d7cf;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user