Skip to content
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
2 changes: 1 addition & 1 deletion stdlib/REPL/src/LineEdit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ function refresh_multi_line(termbuf::TerminalBuffer, terminal::UnixTerminal, buf
full_input = String(buf.data[1:buf.size])
if !isempty(full_input)
passes = StylingPass[]
context = StylingContext(buf_pos, regstart, regstop)
context = StylingContext(buf_pos + 1, regstart + 1, regstop) # StylingContext positions are 1-based

# Add prompt-specific styling passes if the prompt has them and styling is enabled
enable_style_input = prompt_obj === nothing ? false :
Expand Down
2 changes: 1 addition & 1 deletion stdlib/REPL/src/StylingPasses.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function find_enclosing_parens(content::String, ast, cursor_pos::Int)
elseif depthchange < 0 && !isempty(paren_stack)
# Closing paren - pop from stack and check if cursor is inside
open_pos, depth, open_ptype = pop!(paren_stack)
if open_ptype == ptype && open_pos <= cursor_pos < pos
if open_ptype == ptype && open_pos <= cursor_pos <= pos
# Cursor is inside this paren pair - keep only innermost per type
# Only update if this is the first pair or if it's smaller (more inner) than existing
if !haskey(innermost_pairs, ptype) || (pos - open_pos) < (innermost_pairs[ptype][2] - innermost_pairs[ptype][1])
Expand Down
Loading