Closed uga-rosa closed 1 month ago
The built-in function pathshorten() handles multibyte characters correctly. If your own pure Lua functions do not handle them well, this is a good choice.
Unfortunately that’s not a good choice, path manipulation happens inside a libuv callback, using vim.fn.pathshorten
will result in:
E5560: Vimscript function must not be called in a lua loop callback
I’m sure I can fix it within the path
module.
Can vim.schedule
help you?
Hope you can solve this problem. There are libraries like this one that may be of some help. https://github.com/uga-rosa/utf8.nvim
Can
vim.schedule
help you?Hope you can solve this problem. There are libraries like this one that may be of some help. https://github.com/uga-rosa/utf8.nvim
Wont help for two reasons, (1) can’t use a coroutine in the callback (2) horrible performance (this needs to be called for every entry).
https://github.com/ibhagwan/fzf-lua/commit/57ed2503ce35d7a697d99810797bc12893cd16a6
@uga-rosa, should work as expected now.
Thank you! It's no longer broken.
Thank you! It's no longer broken.
Ty for the update @uga-rosa!
RTFM Checklist
man fzf
/ I am well versed in shell fzfOperating system
Mac M3
Shell
fish
Neovim version (
nvim --version
)0.10.0
Fzf version (
fzf --version
)0.52.1 (6432f00)
Output of
:lua print(os.getenv('FZF_DEFAULT_OPTS'))
--height 50% --reverse
Is the problem reproducible with
mini.sh
?mini.sh
mini.sh
mini.sh
(not relevant, requires LSP, Windows, etc)Fzf-lua configuration
Describe the bug / steps to reproduce
It seems that if the directory name contains multibyte characters (e.g.
これは日本語です
), the first character is not taken correctly. Characters are not displayed and the cursor position is off.The built-in function
pathshorten()
handles multibyte characters correctly. If your own pure Lua functions do not handle them well, this is a good choice.