Stop throwing exceptions in cterm vim. #4

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@drn
drn commented Jul 8, 2014

@junegunn

Neat idea for a plugin!

I was getting an "Unsupported color scheme" exception even after setting the cterm environment variables. I patched it below, though I'm not sure if this was the behavior you wanted.

I didn't look into patching the tests to cover this case, but that'd probably make sense to do.

@junegunn
Owner
junegunn commented Jul 8, 2014

Hi. There's already a test case for the scenario. See https://github.com/junegunn/limelight.vim/blob/master/test/limelight.vader#L101-L118. Did you start Limelight with an argument? (interpolation coefficient) The optional argument doesn't make sense when the background color can't be calculated and is fixed by the variable, so it throws an exception in that case. (The behavior is not explicitly documented so I understand that you may find it confusing.) So :Limelight without argument should work. Let me know if it doesn't.

@junegunn
Owner
junegunn commented Jul 8, 2014

Okay, I just realized that the error message is incorrect in that case.

Unsupported color scheme. g:limelight_conceal_ctermfg required.

Will fix it.

@junegunn junegunn added a commit that referenced this pull request Jul 8, 2014
@junegunn Fix error message (#4) 5c164c9
@junegunn
Owner
junegunn commented Jul 8, 2014

I've fixed the message. What do you think?

colo default
unlet! g:limelight_conceal_ctermfg

" Unsupported color scheme. g:limelight_conceal_ctermfg fg required.
Limelight

let g:limelight_conceal_ctermfg = 'red'

" OK
Limelight

" Cannot calculate background color.
Limelight 0.7
@drn
drn commented Jul 8, 2014

Hey there! Yes, that makes sense. I called :Limelight with an argument. It works great without the argument.

The updated error message definitely makes more sense. Might want to elaborate either in the README, /doc, or in the error message about calling :Limelight without an argument, but this is great!

Thanks 👍

@drn drn closed this Jul 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment