mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-02-22 02:41:23 +01:00
checkpoint, add winsize to uicontext
This commit is contained in:
parent
7882232a0e
commit
d286f4d6ab
@ -525,7 +525,7 @@ func fixupVarPrefix(varPrefix string) string {
|
||||
func DoCompGen(ctx context.Context, cmdStr utilfn.StrWithPos, compCtx CompContext) (*CompReturn, *utilfn.StrWithPos, error) {
|
||||
words := shparse.Tokenize(cmdStr.Str)
|
||||
cmds := shparse.ParseCommands(words)
|
||||
compPos := shparse.FindCompletionPos(cmds, cmdStr.Pos, 0)
|
||||
compPos := shparse.FindCompletionPos(cmds, cmdStr.Pos)
|
||||
fmt.Printf("comppos: %v\n", compPos)
|
||||
if compPos.CompType == shparse.CompTypeInvalid {
|
||||
return nil, nil, nil
|
||||
|
@ -55,6 +55,7 @@ type UIContextType struct {
|
||||
WindowId string `json:"windowid"`
|
||||
Remote *sstore.RemotePtrType `json:"remote,omitempty"`
|
||||
TermOpts *packet.TermOpts `json:"termopts,omitempty"`
|
||||
WinSize *WinSize `json:"winsize,omitempty"`
|
||||
}
|
||||
|
||||
type FeInputPacketType struct {
|
||||
|
@ -135,7 +135,7 @@ func testCompPos(t *testing.T, cmdStr string, compType string, hasCommand bool,
|
||||
cmdSP := utilfn.ParseToSP(cmdStr)
|
||||
words := Tokenize(cmdSP.Str)
|
||||
cmds := ParseCommands(words)
|
||||
cpos := FindCompletionPos(cmds, cmdSP.Pos, 0)
|
||||
cpos := FindCompletionPos(cmds, cmdSP.Pos)
|
||||
fmt.Printf("testCompPos [%d] %q => [%s] %v\n", cmdSP.Pos, cmdStr, cpos.CompType, cpos)
|
||||
if cpos.CompType != compType {
|
||||
t.Errorf("testCompPos %q => invalid comp-type %q, expected %q", cmdStr, cpos.CompType, compType)
|
||||
|
Loading…
Reference in New Issue
Block a user