Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an unexpected error during tab completion for input like a.b. when a is not a record #5250

Merged
merged 1 commit into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions dev/gaptest.expect
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,23 @@ expect "gap> "
send -- "g!.S\t"
expect "ize"
send -- ";;\r"

# issue 5241
expect "gap> "
# this used to trigger an error
send -- "g.x.\t"
# ctrl-u to clear the input given so far
send -- "\025"
# just start a new line to verify we are not in a break loop
send -- "\r"
expect "gap> "
# this also used to trigger an error
send -- "g!.x.\t"
# ctrl-u to clear the input given so far
send -- "\025"
# just start a new line to verify we are not in a break loop
send -- "\r"
expect "gap> "

exit

4 changes: 2 additions & 2 deletions lib/cmdledit.g
Original file line number Diff line number Diff line change
Expand Up @@ -969,9 +969,9 @@ GAPInfo.CommandLineEditFunctions.Functions.Completion := function(l)
if Length(cmps) > 0 and cmps[1] in idbnd then
r := ValueGlobal(cmps[1]);
for j in [2..Length(cmps)] do
if not hasbang[j-1] and IsBound(r.(cmps[j])) then
if not hasbang[j-1] and IsRecord(r) and IsBound(r.(cmps[j])) then
r := r.(cmps[j]);
elif hasbang[j-1] and IsBound(r!.(cmps[j])) then
elif hasbang[j-1] and (IsRecord(r) or IsComponentObjectRep(r)) and IsBound(r!.(cmps[j])) then
r := r!.(cmps[j]);
else
r := fail;
Expand Down