emacs-lsp / lsp-ui

UI integrations for lsp-mode
https://emacs-lsp.github.io/lsp-ui
GNU General Public License v3.0
1.03k stars 139 forks source link

lsp-ui-doc freezes emacs when scrolling up in a big enough unordered list #530

Open ThChatz opened 3 years ago

ThChatz commented 3 years ago

When an unordered list has enough elements (11 in my case), scrolling down and then up the doc frame freezes emacs completely. Replacing the markdown bullets with unicode bullets or removing the list markers fixes the issue.

Ordered lists DO NOT have the same problem and work completely fine.

Version: GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3) of 2020-08-28 OS: linux x64 (archlinux)

ashton314 commented 3 years ago

Can confirm that scrolling in the doc frame freezes Emacs cold. This happens whenever I even scroll down. Also: I noticed that the documentation frame is off to one corner rather than next to the cursor.

I've reverted to version 254501789dd684feaa36b4208d5b13cefa9a8d47, and that seems to remove the problem. I haven't taken the time to bisect through the repo history to find the exact point, but that hash can serve as a nice first "good" commit.

Version: GNU Emacs 27.1 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95)) of 2020-08-11 OS: macOS 10.15.7

I can provide a complete snapshot of all my Emacs packages if needed.

parvizfarnia commented 3 years ago

I have encountered the same problem:

OS: Ubuntu 20.04 x86_64 - Emacs 27.1

Besides hyperlinks don't work at all

c0001 commented 3 years ago

Same here, just occur on recent commits.

jcs090218 commented 3 years ago

Hmm... Can anyone provide the snapshot and maybe the step to reproduce? I still don't have a clear idea of how the issue is occurring. Thanks!

c0001 commented 3 years ago

Hmm... Can anyone provide the snapshot and maybe the step to reproduce? I still don't have a clear idea of how the issue is occurring. Thanks!

Of counse, the issue is referred to an monuse-wheel problem, after view hours investigating lsp-ui-doc source where I can not judge the problem sticker yet but finally focus on one emacs customization: the mouse-wheel-scroll-amount variable which is the pain for thus did occur on :

You can set it with (setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) while the amount default is 5, but many user including me set it to 1 or any other value less than 5 for the sake of "smooth scrolling" , Uh.. , the freezing occurred.

This may an emacs internal bug, but I can not ensure that is it, because, it didn't occurred in the stable version of `lsp-ui' , just after we use the more mordern doc buffer renderring mechanism, is it?


UPDATE ON 2021-01-23 Sat 17:07:30

Follow above, we must add to init.el both of bellow setq to reproduce this bug:

(setq
   mouse-wheel-scroll-amount '(1 ((shift) . 1))
   mouse-wheel-progressive-speed nil)
c0001 commented 3 years ago

@jcs090218 bug reproduce here:

;; Bug reproduce emacs init.el related to
;; https://github.com/emacs-lsp/lsp-ui/issues/530
;;
;; USAGE: emacs -q -l _path_of_this_file
;;
;; Please hover the mounse on the symbol `scanf' or `main' on test.c
;; buffer thens scroll the lsp-ui-doc frame window by mounse-wheel,
;; then the bug will be occurred with freezing session, and beeping
;; sequentially while emacs bell ring is not null.
;;
;; If the bug not occurred try enter <f11> let emacs judging into
;; fullscreen and redo above section, this may occurred as well.
;;

(package-initialize)
(setq inhibit-startup-screen t)

(defalias '_buginit
  (lambda (&rest _)
    (when (display-graphic-p)
      (let* ((testdir "~/TEST/lsp-ui-bug_530")
             (test-c-file
              (expand-file-name "test.c" testdir))
             (inhibit-read-only t)
             buffer)
        (dolist (pkg '(lsp-mode lsp-ui))
          (package-install pkg))
        (mkdir testdir t)
        (setq
         mouse-wheel-scroll-amount '(1 ((shift) . 1))
         mouse-wheel-progressive-speed nil)

        (with-current-buffer
            (setq buffer (find-file test-c-file))
          (erase-buffer)
          (insert
           "#include <stdio.h>

int main(int argc, char *argv[])
{
    char c;
    scanf(\"%c\", &c);
    return 0;
}
"
           )
          (save-buffer)
          (unless (eq major-mode 'c-mode)
            (c-mode))
          (require 'lsp)
          (lsp))
        (switch-to-buffer buffer)))))

(_buginit)