checkpoint, add winsize to uicontext

This commit is contained in:
sawka 2022-11-23 14:34:49 -08:00
parent 7882232a0e
commit d286f4d6ab
3 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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)