File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,15 @@ M.wrap_golang_return = function()
169169
170170 -- If the cursor is positioned outside of the immediate return declaration match then we do not want to touch it as this can
171171 -- cause weird behavior when editing parts of a function that are unrelated to the return declaration and if there is a weird edge that triggers
172- if cursor_row < final_start_row + 1 or cursor_row > final_end_row + 1 or cursor_col < final_start_col or cursor_col > final_end_col then
172+ --
173+ -- We offset the final column start value to avoid edgecases with regards to using 'daw' or similar on a method_declaration
174+ -- E.G
175+ -- daw
176+ -- func (f Foo) B|ar() int {}
177+ -- ->
178+ -- func (f Foo) () int {}
179+ -- This parse will break without the final_start_col offset
180+ if cursor_row < final_start_row + 1 or cursor_row > final_end_row + 1 or cursor_col < final_start_col + 1 or cursor_col > final_end_col then
173181 return
174182 end
175183
You can’t perform that action at this time.
0 commit comments