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

rust and lua(sumneko) share the lua icon in the split-windows(:vs and :sp) #2644

Open
xvim64 opened this issue May 28, 2023 · 4 comments
Open

Comments

@xvim64
Copy link

xvim64 commented May 28, 2023

environment

  • vim: gvim v9.0.1585
  • vim-airline: 423fe9e
  • OS: Windows 11 x64 22H2
  • Have you reproduced with a minimal vimrc: no ( "It occurs in "vim-plug + airline + airlien theme + coc + coc-rust + coc-sumneko-lua".)
  • What is your airline configuration: default
    if you are using terminal: no

actual behavior

in the right lua window,
when refreshing screen with "Ctrl + L",
rust and lua(sumneko) share the lua icon.

in the left rust window.
when refreshing screen with "Ctrl + L",
rust and lua(sumneko) share the "rust-analyzer" text.

expected behavior

No lua icon in rust.

screen shot (if possible)

001

UPDATED

------------------------------
Environment Variables
------------------------------
// in Windows, the %HOME% and %XDG_xxxxx% variables are required,
// without these variables, coc-extensions seems to generate some errors when using "c:/users/[my account]".

HOME=C:\Apps\HOME
XDG_CONFIG_HOME=C:\Apps\HOME
XDG_DATA_HOME=C:\Apps\HOME
XDG_STATE_HOME=C:\Apps\HOME

------------------------------
vim-plug
------------------------------
https://github.com/junegunn/vim-plug

------------------------------
c:\Apps\HOME\_vimrc
------------------------------
set bomb
set enc=utf-8
set fenc=utf-8
set fencs=ucs-bom,cp949,utf-8,utf-16le,cp1251,latin1
set nocompatible

set gfn=Consolas:h12

source ~/vimplug/plug.vim
call plug#begin('~/plugged')
    Plug 'neoclide/coc.nvim', {'branch': 'release'}
    Plug 'vim-airline/vim-airline'
    Plug 'vim-airline/vim-airline-themes'
call plug#end()

------------------------------
how to reproduce
------------------------------
1. set the above Environment Variables
2. copy the above _vimrc to C:/Apps/HOME/_vimrc
3. copy plug.vim to ~/vimplug/plug.vim
4. run gvim.exe
5. :PlugInstall
6. restart gvim.exe
7. :CocInstall coc-sumneko-lua (+ server)
8. :CocInstall coc-clangd (+ server)
9. :CocInstall coc-[anything-you-want]
10. restart gvim.exe
11. :e t1.cpp (or t1.rs)
12. :vs t2.lua
13. move the window focus to "left <--> right" using "Ctrl + w + h/l"
14. sometimes, press 'Ctrl + l' to refresh the status bars.
01.mp4

The lua Emoji appears in an inappropriate place in the C++ status bar.

@xvim64 xvim64 changed the title rust and lua(sumneko) share the lua icon rust and lua(sumneko) share the lua icon in vertical split May 28, 2023
@xvim64 xvim64 changed the title rust and lua(sumneko) share the lua icon in vertical split rust and lua(sumneko) share the lua icon in ":vs, :sp" May 28, 2023
@xvim64 xvim64 changed the title rust and lua(sumneko) share the lua icon in ":vs, :sp" rust and lua(sumneko) share the lua icon in split window(:vs and :sp) May 28, 2023
@xvim64 xvim64 changed the title rust and lua(sumneko) share the lua icon in split window(:vs and :sp) rust and lua(sumneko) share the lua icon in the split-window(:vs and :sp) May 28, 2023
@xvim64 xvim64 changed the title rust and lua(sumneko) share the lua icon in the split-window(:vs and :sp) rust and lua(sumneko) share the lua icon in the split-windows(:vs and :sp) May 29, 2023
@chrisbra
Copy link
Member

I have no idea what you mean with lua icon or where it comes from. Does it only happen with coc ? If yes, what exactly is coc doing in that case? If not, please give reproducible steps.
If it only happens with coc I suppose it uses some autocommands that vim-airline does not see, most likely of missing nested.

BTW: does it change, after you move to the windows and then back? e.g. :wincmd w and then :wincmd w?

@xvim64
Copy link
Author

xvim64 commented May 30, 2023

Does it only happen with coc ?

BTW: does it change, after you move to the windows and then back? e.g. :wincmd w and then :wincmd w?

Updated the post.

some 'coc-extention + server' like coc-rust-analyzer, 'coc-sumneko-lua + lua-language-server' affect the statusline.

I found the 'StatusLineParser' string in

coc-sumneko-lua-data\sumneko-lua-ls\extension\client\node_modules\simple-git\dist\cjs\index.js.map
coc-sumneko-lua-data\sumneko-lua-ls\extension\client\node_modules\simple-git\dist\esm\index.js.map

I don't know if the problem of not being able to distinguish between the individual buffers when displaying the statusline is a structural problem with 'vim-alirline' or the fault of 'coc-extention'.

@chrisbra
Copy link
Member

what are those 'StatusLineParser' links?

@xvim64
Copy link
Author

xvim64 commented May 31, 2023

what are those 'StatusLineParser' links?

I don't know js, so I suspected something is affecting to the 'statusline'.
so I searched the 'statusline' keyword.
The 'StatusLineParser' is the only keyword that has 'statusline' in 'coc-sumneko-lua-data**'

ps.

I found the cat.

https://github.com/LuaLS/lua-language-server/blob/master/script/service/service.lua
line number: 209

function m.reportStatus()
local info = {}
if m.workingClock and time.monotonic() - m.workingClock > 100 then
info.text = '$(loading~spin)Lua'
elseif m.sleeping then
info.text = "💤Lua"
else
info.text = '😺Lua'
end

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