Skip to content
Open
Changes from 1 commit
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
8 changes: 6 additions & 2 deletions plugin/rubocop.vim
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ function! s:RuboCop(current_args)
endif
let l:rubocop_output = substitute(l:rubocop_output, '\\"', "'", 'g')
let l:rubocop_results = split(l:rubocop_output, "\n")
cexpr l:rubocop_results
copen
if len(l:rubocop_results)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think cwindow in essence does this same logic; if there are errors populated in cexpr, then it opens the cwindow if it is not opened. Else, it does nothing

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, I forgot all about this PR and have been just maintaining my own fork.

cwindow doesn't work here since it's just parsing the return value of a system() call which does not populate the quickfix list.

cexpr l:rubocop_results
copen
else
echo 'RuboCop: No violations!'
endif
" Shortcuts taken from Ack.vim - git://github.com/mileszs/ack.vim.git
exec "nnoremap <silent> <buffer> q :ccl<CR>"
exec "nnoremap <silent> <buffer> t <C-W><CR><C-W>T"
Expand Down