Skip to content

Commit

Permalink
Remove special handling for empty structs
Browse files Browse the repository at this point in the history
Not sure what the reason was at the time, and no tests fail, so let's
see.
  • Loading branch information
AndrewRadev committed Sep 2, 2023
1 parent a914282 commit 5396244
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 0 additions & 6 deletions autoload/sj/go.vim
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ function! sj#go#SplitVars() abort
return 0
endif

if sj#SearchUnderCursor('^\s*type\s\+.*\s\+struct\s*{') > 0
" Handled by SplitSingleLineCurlyBracketBlock, which is a bit wonky, but
" it seems to work correctly, at least
return 0
endif

call search(pattern, 'Wce', line('.'))
let line = getline('.')

Expand Down
9 changes: 9 additions & 0 deletions spec/plugin/go_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@
assert_file_contents <<~EOF
type empty struct{}
EOF

vim.search 'type'
split

assert_file_contents <<~EOF
type (
empty struct{}
)
EOF
end
end

Expand Down

0 comments on commit 5396244

Please sign in to comment.