Giter VIP home page Giter VIP logo

Comments (6)

justbur avatar justbur commented on September 22, 2024

Can you reproduce this by starting emacs without your config (emacs -Q) and loading a basic configuration for which-key like

(require 'which-key)
(which-key-setup-side-window-right)
(which-key-mode)

?

from emacs-which-key.

deen1 avatar deen1 commented on September 22, 2024

My apologies for the slow response.

I tried loading which-key via emacs -Q, with (which-key-setup-side-window-right). The paging display for C-x now fits within the side-window, without any cutting off (see screenshots below).

I then enabled my usual Emacs theme (from the package monokai-theme), and things seemed to be fine.

I was able to reproduce the issue when I made the default frame face larger (to be compatible with my display and eye comfort):

(add-to-list 'default-frame-alist '(font . "Ubuntu Mono-14:antialising=True") )

So it seems to me that one solution for this would be to make the default which-key face smaller, but I haven't been able to do that in a uniform way – i.e. some of the faces become smaller but others don't, so that the completion list is still obscured/cut off, but at a different location to the previous situation.

2024-04-12-150322_327x944_scrot

2024-04-12-150339_491x934_scrot

from emacs-which-key.

justbur avatar justbur commented on September 22, 2024

First off, the intention is for the window to scale appropriately if the font is larger. I just checked that mine does even for larger font sizes than the one you're using.

From the pictures above, it seems like the character widths are not being handled properly. Can you try the following? First,

(setq which-key--debug-buffer-name "wk-debug")

That will dump out some of the calculations to the buffer "wk-debug". I'd like to see what it spits out for one of the problematic cases, preferably like you have here starting from emacs -Q. If possible it would be nice to have a screenshot that corresponds to the data from "wk-debug". Does that make sense?

from emacs-which-key.

deen1 avatar deen1 commented on September 22, 2024

OK, I tried the following: after loading which-key via straight in
emacs -Q,

(require 'which-key)
(which-key-setup-side-window-right)
(which-key-mode)
(add-to-list 'default-frame-alist '(font . "Ubuntu Mono-14:antialising=True") )
(setq which-key--debug-buffer-name "wk-debug")

(Note: this time I didn't load a theme, I just changed the default frame face.)

Opening a new frame (so that the larger font is applied), and hitting C-x produces the following output in wk-debug:

Frame height: 45
Minibuffer height: 1
Max dimensions: (43,56)
Available for bindings: (42,56)
Actual lines: 43

On prefix "C-x" which-key took 113 ms.

Below is the associated screenshot of the first page for the C-x commands:

2024-04-14-151808_332x938_scrot

I also tried C-h to see if there is any difference:

Frame height: 45
Minibuffer height: 1
Max dimensions: (43,56)
Available for bindings: (42,56)
Actual lines: 43

On prefix "C-h" which-key took 43 ms.

I hadn't implemented any special paging for C-h so I couldn't see the remaining options, but the list of commands doesn't look as though it is cut off in the way C-x is:

2024-04-14-155332_344x930_scrot

from emacs-which-key.

justbur avatar justbur commented on September 22, 2024

Sorry, I meant for you to update which-key first because I added some more information to the debug output. Do you mind doing what you did again after updating which-key?

from emacs-which-key.

deen1 avatar deen1 commented on September 22, 2024

I tried it again after updating – it's still version 3.6.0 but it has the new =which-key--debug-message= changes.

The problem remains, here is the output to the wk-debug buffer:

Frame height: 45
Frame pixel width: 1920
Frame char width: 10
Frame width: 192
Which-key initial width: 64
Which-key adjusted width: 59
Minibuffer height: 1
Max dimensions: (43, 56)
Available for bindings: (42, 56)
Popup type info: (side-window, right, 0.333)
Computed page widths: (33 35 32)
Actual lines: 43

Allow imprecise fit: nil
Display window alist: ((window-width . which-key--fit-buffer-to-window-horizontally) (window-height lambda (w) (fit-window-to-buffer w nil 1)) (side . right) (slot . 0))

On prefix "C-x" which-key took 94 ms.

from emacs-which-key.

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.