Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problematic focus when using company #3

Closed
shrubbroom opened this issue Feb 10, 2022 · 3 comments
Closed

Problematic focus when using company #3

shrubbroom opened this issue Feb 10, 2022 · 3 comments

Comments

@shrubbroom
Copy link

I am using emacs, whose version is mac-port 27.2. When company-mode is turned on and the tooltip pops up right after the first char is inserted, sort-tab will focus on wrong buffer.
截屏2022-02-10 下午6 47 37

The sort-tab should focus on the tmp.el, however, it focuses on the tmp.lua as I typed the firs char. The minimal configuration to reproduce the behavior is shown as follow.

(package-initialize)
(add-to-list 'load-path
             (concat user-emacs-directory "site-packages/sort-tab"))
(require 'sort-tab)
(sort-tab-mode +1)
(require 'company)
(setq company-idle-delay 0
      company-minimum-prefix-length 1)
(global-company-mode)

This behavior is not harming the functionality since sort-tab will focus correct buffer as more char is inserted. However, it may be annoying as the focused buffer changes rapidly. Modifying the following line may help.
From

LINE 280:sort-tab.el:   (let ((current-buffer (current-buffer)))

to

LINE 280:sort-tab.el:   (let ((current-buffer (window-buffer)))

I have no idea if this would break other functionalities.

BR

@manateelazycat
Copy link
Owner

I can't reproduce your problem, can you test with "emacs -Q" ?

Thanks

@shrubbroom
Copy link
Author

I can reproduce the problem with emacs -Q. After the emacs is started, I eval

(package-initialize)
(require 'sort-tab)
(sort-tab-mode +1)
(require 'company)
(setq company-idle-delay 0
      company-minimum-prefix-length 1)
(global-company-mode)

and create two new files. One tmp.c is just empty, the other one is tmp.el. When one char is inserted and company is active, the wrong buffer would be focused.
截屏2022-02-11 下午6 22 15
The sort-tab should focus on tmp.el rather than tmp.c here.

The version of my company is company-20220110.2248, the sort-tab version is HEAD. I have tried to reinstall company, but it doesn't help.

BR

@manateelazycat
Copy link
Owner

Please try newest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants