Giter Site home page Giter Site logo

Comments (10)

sebastiencs avatar sebastiencs commented on May 26, 2024 1

Yes there isn't any solution to that yet, I will work on it

from lsp-ui.

casouri avatar casouri commented on May 26, 2024

For now I add a function to my config that detects the width of windows and toggles doc and side line.

One problem is that setting lsp-ui-doc-enable to nil doesn't stop it from showing doc. How should I apply the changes?

from lsp-ui.

sebastiencs avatar sebastiencs commented on May 26, 2024

You can call (lsp-ui-doc-enable t) and (lsp-ui-doc-enable nil).
Sorry I'm on holiday now I will fix that in 2 weeks

from lsp-ui.

casouri avatar casouri commented on May 26, 2024

No no, There isn't any problem. I'm saying simply setting the variable doesn't apply changes. I should express that clearer. 😄

from lsp-ui.

MaskRay avatar MaskRay commented on May 26, 2024

Do we also want to cancel the auto-enabling when the height is too small? Are there other packages having similar window configuration needs that lsp-ui-doc can take an example from?

from lsp-ui.

casouri avatar casouri commented on May 26, 2024

I tried to make sure childframe's width is always small enough so the current cursor position is not covered.

P.S. This is just a test version. We can make sure the word at point is not covered by calculating word's length and count it in.

But there isn't any effect that I expected. Nothing really changed.

(defun get-cursor-column ()
  (let ((inhibit-message t))
    (string-to-number
     (substring-no-properties
      (what-cursor-position)
      (+ 7 (string-match "column=.+" (what-cursor-position)))
      ))))

(defun lsp-ui-doc-max-width ()
  (- (window-width) (get-cursor-column)))

(defun lsp-ui-doc--resize-buffer ()
  "If the buffer's width is larger than the current window, resize it."
  (let* ((window-width (window-width))
         (fill-column (min (lsp-ui-doc-max-width) (- window-width 5))))
    (message (format "max width: %d" (lsp-ui-doc-max-width)))
    (message (format "win width: %d" (window-width)))
    (when (> (lsp-ui-doc--buffer-width) (min (lsp-ui-doc-max-width) window-width))
      (lsp-ui-doc--with-buffer
       (fill-region (point-min) (point-max))))))

Any idea?

from lsp-ui.

MaskRay avatar MaskRay commented on May 26, 2024

Some commit between emacs-mirror/emacs@1bc998f and
emacs-mirror/emacs@a8be860 breaks the width of the child frame.

With a8be860e17e2a737bda7a4c5075b71f0fb627a92,
The width is good with 1bc998f98f937ee82e29d80e19fda7c32632501a

from lsp-ui.

sebastiencs avatar sebastiencs commented on May 26, 2024

@MaskRay Thanks, I have reported the bug:
http://lists.gnu.org/archive/html/bug-gnu-emacs/2018-03/msg00376.html

from lsp-ui.

sebastiencs avatar sebastiencs commented on May 26, 2024

@casouri e7257c9 should improve the situation

from lsp-ui.

casouri avatar casouri commented on May 26, 2024

Cool, I think that should work for most of the cases. Thanks 😄

from lsp-ui.

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.