File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -153,11 +153,11 @@ function M.add_selection_context()
153153 -- Create context object
154154 local context = {
155155 type = " file" ,
156- path = context_path ,
157- lines_range = {
156+ path = current_file ,
157+ linesRange = {
158158 start = start_line ,
159- End = end_line
160- }
159+ [ " end " ] = end_line , -- end is a reserved word in Lua
160+ },
161161 }
162162
163163 -- Get current sidebar and add context
Original file line number Diff line number Diff line change @@ -1132,6 +1132,10 @@ function M:_update_contexts_display()
11321132 for i , context in ipairs (self ._contexts ) do
11331133 local name = context .type == " repoMap" and " repoMap" or vim .fn .fnamemodify (context .path , " :t" ) -- Get filename only
11341134
1135+ if context .linesRange and context .linesRange .start and context .linesRange [" end" ] then
1136+ name = string.format (" %s:%d-%d" , name , context .linesRange .start , context .linesRange [" end" ])
1137+ end
1138+
11351139 -- Create context reference with @ prefix like eca-emacs
11361140 local ref = " @" .. name
11371141 table.insert (context_refs , ref )
You can’t perform that action at this time.
0 commit comments