Skip to content

Commit fcebd2d

Browse files
fix
1 parent 03ec7af commit fcebd2d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

stdlib/REPL/src/REPLCompletions.jl

+4-3
Original file line numberDiff line numberDiff line change
@@ -1130,9 +1130,10 @@ function in_scope_of_prefix(string::String, pos::Int, separatorpos::Int)
11301130
pos <= separatorpos && return true
11311131
after_separator = string[separatorpos+1:pos]
11321132
isempty(after_separator) && return true
1133-
if any(in(non_identifier_chars), after_separator)
1134-
# Non-identifier chars means we're not in the identifier linked to the prefix
1135-
# i.e. the space in `Base.@time x`, or ( in `Base.@time(x`
1133+
# check for spaces outside of strings, i.e. not `var"foo bar"`
1134+
# also accounting for incomplete strings like `var"foo `
1135+
if occursin(r"^(?:[^\"]+|\"[^\"]*\")*\s", after_separator)
1136+
# i.e. the space in `Base.@time x`
11361137
return false
11371138
else
11381139
return true

0 commit comments

Comments
 (0)