Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usability "upgrades" #14

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
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