Giter Club home page Giter Club logo

Comments (14)

casouri avatar casouri commented on July 23, 2024

Just to clarify, you make eldoc-box show three different doc at three different locations, first and last small, the second one large, and for the third one the child frame doesn't automatically shrink? Could you show some screenshots? That'll be extra clear.

from eldoc-box.

parbo avatar parbo commented on July 23, 2024

from eldoc-box.

parbo avatar parbo commented on July 23, 2024

Correct size:

image

Something bigger:

image

Back to the small one (now too wide):

image

Showing a single line doc and then the small one again, makes the small one have correct width again.

from eldoc-box.

casouri avatar casouri commented on July 23, 2024

Thanks. I think this is due to the markdown separator. You see, one of the prettifier replaces markdown's separator with a strike-through line with a display text property. The display property specifies that the width of the strike though is the width of the window. That might interfered with window-text-pixel-size, which return the size of the text in a window, and is used by eldoc-box to determine the frame size for the childframe.

Anyway, I added a (harmless) workaround that should fix this.

from eldoc-box.

mrsch avatar mrsch commented on July 23, 2024

This workaround breaks the childframe for me.
It causes the childframe to be 1 by 1 character in size sometimes:

1684941528_grim

from eldoc-box.

casouri avatar casouri commented on July 23, 2024

The workaround probably just exposed this problem, rather than caused it. Could you give me a reproduce recipe?

from eldoc-box.

deifactor avatar deifactor commented on July 23, 2024

I've noticed the issue @mrsch mentioned happening when using the pure GTK version of emacs (I'm using sway; not sure about X or other compositors). it doesn't always happen, but it happens eventually if I just move point around enough. It goes away if I get rid of the workaround (but then of course I get the behavior the workaround fixes). I think something doesn't like setting the frame width rapidly and it gets 'stuck' on the first frame size.

from eldoc-box.

deifactor avatar deifactor commented on July 23, 2024

Aha, it seems to consistently happen if and only if the new documentation frame would be the same size as the old one (moving point within an identifier, is one way to trigger this, but I verified it's not the only way). I think this is an emacs bug.

from eldoc-box.

casouri avatar casouri commented on July 23, 2024

I added a workaround for the workaround. Not sure it'll fix the problem though, let's see :-)

from eldoc-box.

casouri avatar casouri commented on July 23, 2024

Oops, I just see your patch. Let me have a look!

from eldoc-box.

deifactor avatar deifactor commented on July 23, 2024

Just tried and (redisplay t) doesn't fix it. The weird thing is that if I add

(message (format "%s %s" (frame-height frame) (frame-width frame)))
(run-with-idle-timer 0 nil (lambda () (message (format "%s %s" (frame-height frame) (frame-width frame)))))

then the first message has the size from (set-frame-size) and the second is 1 1.

from eldoc-box.

casouri avatar casouri commented on July 23, 2024

Ok, I pushed another fix following your idea. Could you give it a try?

from eldoc-box.

deifactor avatar deifactor commented on July 23, 2024

It works! And that's a much cleaner solution.

from eldoc-box.

casouri avatar casouri commented on July 23, 2024

Great. Thanks for your PR, and the detailed commit message, I appreciate it 😊

from eldoc-box.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.