yatli / fvim

Cross platform Neovim front-end UI, built with F# + Avalonia
MIT License
1.34k stars 30 forks source link

LunarVim rendering issues #205

Closed cro closed 2 years ago

cro commented 3 years ago

I appreciate the look of FVim over neovim-qt, really nice job!

I'm seeing something odd when trying to adopt the LunarVim configs. On startup I appear to get a variable-width font, which isn't a big deal, I can set guifont fine. But the LunarVim popups appear to be cut off.

On startup:

Screen Shot 2021-10-14 at 10 10 18 AM

After set guifont=Hack:h14

Screen Shot 2021-10-14 at 10 11 23 AM

After pressing Space to get the standard popup menu:

Screen Shot 2021-10-14 at 10 12 23 AM

Expected result (screenshot from neovim-qt):

Screen Shot 2021-10-14 at 10 16 18 AM
yatli commented 3 years ago

Should be fixed in the latest release.

cro commented 3 years ago

I'm sorry, I upgraded this morning and am still seeing the same behavior. Anything else I can do to help track this down?

yatli commented 3 years ago

Ah, I misunderstood -- the latest release fixed an issue where the floating window is not displaying its content. This appears to be a different issue -- the floating window position is off.

I'll see if I can repro this.

yatli commented 3 years ago

Btw still get all these square boxes instead of the ascii art?

cro commented 3 years ago

Yes, even if I switch to a patched font (SauceCodePro Nerd Font Mono)

ttytm commented 2 years ago

Finding fvim is like finding a brick of gold. Can't believe my eyes how impressive it is.

I'm not using lunarvim but also have the problem that floating windows like whichkey are displaced.

Would love to use fvim as main editor.

yatli commented 2 years ago

@tobealive which version are you on?

I may have to try "whichkey" myself.

https://github.com/liuchengxu/vim-which-key , right?

ttytm commented 2 years ago

Hey, great reading from you.

I installed fvim via the fvim-linux-amd64-v0.3.520+g8a6f26b.deb

https://github.com/folke/which-key.nvim

yatli commented 2 years ago

Problem identified. This plugin properly implements 'anchor to bottom' which I did not implement back then.

yatli commented 2 years ago

https://github.com/yatli/fvim/commit/8d6abeb050fcaffdf3950c16f907ab308d68c474

yatli commented 2 years ago

@tobealive @cro https://dev.azure.com/v-yadli/fvim/_build/results?buildId=700&view=results

When the build finishes, you can access built artifacts for your platform -- in the "Jobs" section, click the platform, go to the build logs, then there's a "download artifact" in the log. Really accessible (TM).

yatli commented 2 years ago

This is better

image

https://dev.azure.com/v-yadli/fvim/_build/results?buildId=701&view=results

ttytm commented 2 years ago

oh great. the overused term blazingly fast is probably really appropriate here.

Not having the build dependencies installed and time today I 'm exited to check this tomorrow.

kudos! 🙏

ttytm commented 2 years ago

@tobealive @cro https://dev.azure.com/v-yadli/fvim/_build/results?buildId=700&view=results

When the build finishes, you can access built artifacts for your platform -- in the "Jobs" section, click the platform, go to the build logs, then there's a "download artifact" in the log. Really accessible (TM).

Oh nice, I didn't quiet understood that yesterday and thought I'll need to build it from source. Didn't come a lot in contact with azure yet. That's very nice. Thank you.

yatli commented 2 years ago

https://dev.azure.com/v-yadli/fvim/_build/results?buildId=701&view=artifacts&pathAsName=false&type=publishedArtifacts

ttytm commented 2 years ago

Using a border around that floating windows it gets visible that it gets cut off a little, so the border is missing on the right side. That's not a thing that really bothers me and there are probably more important things for that development phase. Just mentioning it here for a possible backlog.

left: fvim, right: nvim in terminal Screenshot_20220323_102001

Probably another thing that is related to the opened issue and is also visible on the screenshot is the error displaying icons and just showing those boxes.

It's possible to solve this by conditionally assigning other icons to fvim. But there is probably a more elegant solution to this. E.g. the codicons pack have trouble being displayed in fvim.

yatli commented 2 years ago

When you have time, you can try clone the repo and run in debug mode: dotnet run This will give you extra info on the window layout (like in my screenshot)

And btw, do please try this: https://github.com/yatli/fvim/blob/master/ViewModels/CompletionItemViewModel.fs

(How can I not write it in the README??)

Replace your completion icons with these text characters (yes just text) and they will be shown graphically in FVim.

Check Assets/intellisense for the icons, and I believe you can even hack them for customization.

Update: see https://github.com/yatli/fvim#custom-pum-icons

yatli commented 2 years ago

Could you copy pasta the lua code snippet for icon configuration? I'd like to paste it in and debug.

For example:

    symbol_map = {
      Text = "",
      Method = "",
      Function = "",
      Constructor = "",
      Field = "ﰠ",
      Variable = "",
      Class = "ﴯ",
      Interface = "",
      Module = "",
      Property = "ﰠ",
      Unit = "塞",
      Value = "",
      Enum = "",
      Keyword = "",
      Snippet = "",
      Color = "",
      File = "",
      Reference = "",
      Folder = "",
      EnumMember = "",
      Constant = "",
      Struct = "פּ",
      Event = "",
      Operator = "",
      TypeParameter = ""
    },

These characters display fine on my side:

image

yatli commented 2 years ago

wait, it displays fine in comments but not in code?

image

ttytm commented 2 years ago

Nope this comment is a leftover from the icons above.

here the full icons lua can you use it like that?

-- https://github.com/microsoft/vscode/blob/main/src/vs/base/common/codicons.ts
-- go to the above and then enter <c-v>u<unicode> and the symbold should appear
-- or go here and upload the font file: https://mathew-kurian.github.io/CharacterMap/
-- find more here: https://www.nerdfonts.com/cheat-sheet
if vim.fn.has "mac" == 1  then
  -- elseif vim.fn.has "mac" == 1 then
  return {
    kind = {
      Text = "",
      -- Method = "m",
      -- Function = "",
      -- Constructor = "",
      Method = "",
      Function = "",
      Constructor = "",
      Field = "",
      -- Variable = "",
      Variable = "",
      Class = "",
      Interface = "",
      -- Module = "",
      Module = "",
      Property = "",
      Unit = "",
      Value = "",
      Enum = "",
      -- Keyword = "",
      Keyword = "",
      -- Snippet = "",
      Snippet = "",
      Color = "",
      File = "",
      Reference = "",
      Folder = "",
      EnumMember = "",
      Constant = "",
      Struct = "",
      Event = "",
      Operator = "",
      TypeParameter = "",
    },
    type = {
      Array = "",
      Number = "",
      String = "",
      Boolean = "蘒",
      Object = "",
    },
    documents = {
      File = "",
      Files = "",
      Folder = "",
      OpenFolder = "",
    },
    git = {
      Add = "",
      Mod = "",
      Remove = "",
      Ignore = "",
      Rename = "",
      Diff = "",
      Repo = "",
    },
    ui = {
      Lock = "",
      Circle = "",
      BigCircle = "",
      BigUnfilledCircle = "",
      Close = "",
      NewFile = "",
      Search = "",
      Lightbulb = "",
      Project = "",
      Dashboard = "",
      History = "",
      Comment = "",
      Bug = "",
      Code = "",
      Telescope = "",
      Gear = "",
      Package = "",
      List = "",
      SignIn = "",
      Check = "",
      Fire = "",
      Note = "",
      BookMark = "",
      Pencil = "",
      -- ChevronRight = "",
      ChevronRight = ">",
      Table = "",
      Calendar = "",
    },
    diagnostics = {
      Error = "",
      Warning = "",
      Information = "",
      Question = "",
      Hint = "",
    },
    misc = {
      Robot = "ﮧ",
      Squirrel = "",
      Tag = "",
      Watch = "",
    },
  }
elseif(vim.g.fvim_loaded) then
  return {
    kind = {
      Text = " ",
      -- Method = "m ",
      -- Function = " ",
      -- Constructor = " ",
      Method = " ",
      Function = " ",
      Constructor = " ",
      Field = " ",
      -- Variable = " ",
      Variable = " ",
      Class = " ",
      Interface = " ",
      -- Module = " ",
      Module = " ",
      Property = " ",
      Unit = " ",
      Value = " ",
      Enum = " ",
      -- Keyword = " ",
      Keyword = " ",
      -- Snippet = " ",
      Snippet = " ",
      Color = " ",
      File = " ",
      Reference = " ",
      Folder = " ",
      EnumMember = " ",
      Constant = " ",
      Struct = " ",
      Event = " ",
      Operator = " ",
      TypeParameter = " ",
    },
    type = {
      Array = " ",
      Number = " ",
      String = " ",
      Boolean = "蘒 ",
      Object = " ",
    },
    documents = {
      File = " ",
      Files = " ",
      Folder = " ",
      OpenFolder = " ",
    },
    git = {
      Add = " ",
      Mod = " ",
      Remove = " ",
      Ignore = " ",
      Rename = " ",
      Diff = " ",
      Repo = " ",
    },
    ui = {
      Lock = " ",
      Circle = " ",
      BigCircle = " ",
      BigUnfilledCircle = " ",
      Close = " ",
      NewFile = " ",
      Search = " ",
      Lightbulb = " ",
      Project = " ",
      Dashboard = " ",
      History = " ",
      Comment = " ",
      Bug = " ",
      Code = " ",
      Telescope = " ",
      Gear = " ",
      Package = " ",
      List = " ",
      SignIn = " ",
      Check = " ",
      Fire = " ",
      Note = " ",
      BookMark = " ",
      Pencil = " ",
      -- ChevronRight = " ",
      ChevronRight = "> ",
      Table = " ",
      Calendar = " ",
    },
    diagnostics = {
      Error = " ",
      Warning = " ",
      Information = " ",
      Question = " ",
      Hint = " ",
    },
    misc = {
      Robot = "ﮧ ",
      Squirrel = " ",
      Tag = " ",
      Watch = " ",
    },
  }
else
  --   פּ ﯟ   蘒練 some other good icons
  return {
    kind = {
      Text = " ",
      Method = " ",
      Function = " ",
      Constructor = " ",
      Field = " ",
      Variable = " ",
      Class = " ",
      Interface = " ",
      Module = " ",
      Property = " ",
      Unit = " ",
      Value = " ",
      Enum = " ",
      Keyword = " ",
      Snippet = " ",
      Color = " ",
      File = " ",
      Reference = " ",
      Folder = " ",
      EnumMember = " ",
      Constant = " ",
      Struct = " ",
      Event = " ",
      Operator = " ",
      TypeParameter = " ",
      Misc = " ",
    },
    type = {
      Array = " ",
      Number = " ",
      String = " ",
      Boolean = " ",
      Object = " ",
    },
    documents = {
      File = " ",
      Files = " ",
      Folder = " ",
      OpenFolder = " ",
    },
    git = {
      Add = " ",
      Mod = " ",
      Remove = " ",
      Ignore = " ",
      Rename = " ",
      Diff = " ",
      Repo = " ",
    },
    ui = {
      Lock = " ",
      Circle = " ",
      BigCircle = " ",
      BigUnfilledCircle = " ",
      Close = " ",
      NewFile = " ",
      Search = " ",
      Lightbulb = " ",
      Project = " ",
      Dashboard = " ",
      History = " ",
      Comment = " ",
      Bug = " ",
      Code = " ",
      Telescope = " ",
      Gear = " ",
      Package = " ",
      List = " ",
      SignIn = " ",
      Check = " ",
      Fire = " ",
      Note = " ",
      BookMark = " ",
      Pencil = " ",
      ChevronRight = "",
      Table = " ",
      Calendar = " ",
    },
    diagnostics = {
      Error = " ",
      Warning = " ",
      Information = " ",
      Question = " ",
      Hint = " ",
    },
    misc = {
      Robot = " ",
      Squirrel = " ",
      Tag = " ",
      Watch = " ",
    },
  }
end
yatli commented 2 years ago

alright got repro:

image

yatli commented 2 years ago

Are they part of NERD font? I may have to update it.

ttytm commented 2 years ago

I'm not 100% sure but I think they are not. Got them from a nvim from scratch series and hadn't had problems with them yet i other scenarios. I think lunarvim is using the same icons though probably that's why the thread starter also having those issues.

yatli commented 2 years ago

That lunarvim logo looks like braille to me.

yatli commented 2 years ago

https://utf8-icons.com/utf-8-character-60051 It displays as a battery icon on my side:

image

This is clearly the windows 10 power tray icon. Probably not what you want?

yatli commented 2 years ago

(offtopic)

image

Half an hour ago I checked this page, it displays a "mahjong" block. Now it resolves to the battery icon. How weird...

yatli commented 2 years ago

Okay, EA93 is a part of (0xEA60u, 0xEBEBu) // Codicons New NERD font.

ttytm commented 2 years ago

Hey, sorry the late response.

wanting to start into vacation this evening and having ongoing projects, the office is trying to squeeze out the rest of the energy that is left inside of me.

haha a mahjong block sounds cool to me. An abc symbol would be the intended one. abc

Oh great insight and starting point of a real fix.

yatli commented 2 years ago

gotem.

image

yatli commented 2 years ago

@tobealive https://dev.azure.com/v-yadli/fvim/_build/results?buildId=706&view=results will be ready to download soon.

yatli commented 2 years ago

Braille display ok. image

yatli commented 2 years ago

Version 0.3.528 released. Should've fixed everything related to this thread. Case closed. 😎