quick-peek icon indicating copy to clipboard operation
quick-peek copied to clipboard

Lenses support

Open yyoncho opened this issue 5 years ago • 10 comments

I am working on lsp-mode and I want to use the library for displaying lenses (https://camo.githubusercontent.com/348d682e4a4cc1f84e8571a9488c2087ae754c88/68747470733a2f2f692e696d6775722e636f6d2f437846506f50472e706e67) this would require changes to quick-peek to support that option(e. g. removing the spacers). Are you fine with that approach or you would prefer to fork it?

yyoncho avatar Sep 24 '18 08:09 yyoncho

I use quick-peek in company-coq to display info in the style that you call lenses, so I'm all for supporting your use case too :) IOW, I'd prefer patches over a fork.

cpitclaudel avatar Sep 24 '18 17:09 cpitclaudel

I might be missing something but there is no reference to quick-peek in https://github.com/cpitclaudel/company-coq ?

yyoncho avatar Sep 24 '18 18:09 yyoncho

That's because the code from quick-peek was originally extracted from company-coq, and I haven't done the refactoring to make company-coq use the separately packaged version yet.

cpitclaudel avatar Sep 24 '18 18:09 cpitclaudel

Ok, just one more question - as far as I can see quick-peek--insert-spacer is called unconditionally - do I miss something or quick-peek as it is does not support what I am calling lenses?

yyoncho avatar Sep 24 '18 19:09 yyoncho

Maybe I'm misunderstanding what you mean by lenses? :)

cpitclaudel avatar Sep 24 '18 20:09 cpitclaudel

I believe that the following changes are needed (unless I am missing something).

  1. Provide option to display the overlays without the spacer since they take a lot of space.
  2. Optionally allow displaying multiple overlays on the same line.

yyoncho avatar Sep 25 '18 04:09 yyoncho

Provide option to display the overlays without the spacer since they take a lot of space.

Can you show a screenshot? Normally the spacer should be very thin on graphic displays; maybe there's a bug?

cpitclaudel avatar Sep 25 '18 21:09 cpitclaudel

No, they are fine if you want to display one item but they introduce a lot of noise if you show them on a lot of places in the file. Note that lenses could be visible all the time.

selection_001 vs selection_002

yyoncho avatar Sep 26 '18 05:09 yyoncho

OK, I'm sold :) Do you want to prepare a pach? We could have a dynamic variable for this.

cpitclaudel avatar Sep 26 '18 19:09 cpitclaudel

There are a few more things that I have to do before that, then I will provide a patch. Also, I have to figure out whether I have to support multiple lenses on a single line which may complicate the code a bit. Also, choosing overlays kind of depends on https://github.com/noctuid/link-hint.el/issues/24#issuecomment-424068597 .

yyoncho avatar Sep 26 '18 19:09 yyoncho