Skip to content

Commit

Permalink
Fix tab completion on non-record component objects
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Sep 9, 2022
1 parent 7ba252e commit 4b01ecd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions dev/gaptest.expect
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,16 @@ expect "data1 data2"
send -- "1);\r"
expect "true"

# test tab completion for a non-record component object
expect "gap> "
send -- "g:=SmallGroup(6,1);;\r"
expect "gap> "
send -- "g.\t"
send -- "1;;\r"
expect "gap> "
send -- "g!.S\t"
expect "ize"
send -- ";;\r"
expect "gap> "

exit
4 changes: 3 additions & 1 deletion lib/cmdledit.g
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,10 @@ GAPInfo.CommandLineEditFunctions.Functions.Completion := function(l)
# the first two <TAB> hits try existing component names only first
if cf.tabbang then
searchlist := ShallowCopy(NamesOfComponents(cf.tabrec));
else
elif IsRecord(cf.tabrec) then
searchlist := ShallowCopy(RecNames(cf.tabrec));
else
searchlist := [];
fi;
if cf.tabcount > 2 then
Append(searchlist, ALL_RNAMES());
Expand Down

0 comments on commit 4b01ecd

Please sign in to comment.