Closed stardiviner closed 4 years ago
@stardiviner Does https://github.com/sebastiencs/company-box/commit/d28025fa0c833ce85c4cf3c965581914daebfab0 fix your issue ?
I pulled commit, and tested with same condition. Still not fixed. I try to get backtrace error log, but I got nothing when I toggle-debug-on-error
. And no company auto popup neither.
I press [TAB]
to manually start company. Only get error:
Company: An error occurred in auto-begin
Company: frontend company-box-frontend error "Args out of range: 0, 26" on command show
Then I try to edebug on company-box--candidate-string
. Then press TAB
manually, but seems it's not invoked.
Then I edbeug on company-box-frontend
, and company-box-show
.
Got error:
Debugger entered--Lisp error: (error "Company: frontend company-box-frontend error \"Args out of range: 0, 26\" on command show")
signal(error ("Company: frontend company-box-frontend error \"Args..."))
error("Company: frontend %s error \"%s\" on command %s" company-box-frontend "Args out of range: 0, 26" show)
company-call-frontends(show)
company--begin-new()
company--perform()
company-auto-begin()
company-manual-begin()
company-complete()
funcall-interactively(company-complete)
call-interactively(company-complete nil nil)
command-execute(company-complete)
Then I press q
in backtrace buffer, then it auto popup another error log:
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
company--continue()
company--perform()
company-post-command()
Sorry that I can't provide more detailed feedback. Hope this info can help you.
@stardiviner Does the error occur without company-box enabled ?
@dgutov company-fill-propertize
throws an error when called with:
(company-fill-propertize "唐鳳 <audreyt@audreyt.org>" nil 24 nil nil nil)
(company-fill-propertize "唐鳳 <audreyt@audreyt.org>" nil 26 nil nil nil)
24 & 26 refers to the result of calling length
and string-width
on the string.
Is this expected ?
@sebastiencs No, company-box popup is fine. Only occur in company-box.
@sebastiencs Sorry, I can't answer that off the top of my head without debugging with exact example inputs.
company-fill-propertize
is a weird function; in essence, it's a part of the default popup frontend so you might as well reimplement it in your frontend as well. It would be good if this function were more stable, but wide characters are a tricky issue. Help cleaning up their handling is welcome.
@dgutov Thanks, I think calling company--clean-string
fixes the issue.
@stardiviner Can you test again with https://github.com/sebastiencs/company-box/commit/b056a148558738790c6b9699cc216540b5628540
Confirme fixed, :) Thanks @sebastiencs 👍🏻
When I type name in the
To:
field of mu4e compose mode. I got error after toggleddebug-on-error
. Here is the backtrace:I can see
company-fill-propertize(#("唐鳳 <audreyt@audreyt.org>" 23 24 (font-lock-face bold)) nil 24 nil nil nil)
becomes"唐鳳 <audreyt@audreyt.or"
. Seems somewhere changed the text.