qvacua / vimr

VimR — Neovim GUI for macOS in Swift
https://twitter.com/VimRefined
MIT License
6.62k stars 218 forks source link

[Bug] Line spacing greater than 1.0 prevents continuous vertical lines #957

Open hernancerm opened 2 years ago

hernancerm commented 2 years ago

Environment

VimR: Version 0.40.0 (20220618.161750)
Neovim: v0.7.0

Pre-conditions

I assume anything which displays vertical lines that should be visually continuous should trigger the issue. I've seen this issue with Telescope, gitsigns and nvim-tree. Here I provide a minimal init.vim for gitsigns and nvim-tree.

  1. Put the following in the init.vim. Make sure to also have vim-plug installed.
    
    call plug#begin()
    Plug 'lewis6991/gitsigns.nvim'
    Plug 'kyazdani42/nvim-tree.lua'
    call plug#end()

lua<<EOF require'nvim-tree'.setup { renderer = { indent_markers = { enable = true, }, }, } EOF lua require'gitsigns'.setup {}


2. Install the plugins listed in the `init.vim` (`:PlugInstall`)

### Reproduction steps

1. Open in VimR a directory tracked by Git.
2. Set the line spacing to 1.2 (`:VimRSetLinespacing 1.2`).
3. Use any font, in the following screenshots I'm using [Iosevka Nerd Font](https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/Iosevka).
4. Open the nvim-tree (`:NvimTreeOpen`).
5. You may also modify consecutive lines of a file to show the gitsigns modified indicator in the signcolumn. 

### Actual result

Notice the indent indicators of nvim-tree are not a continuous vertical line. The same issue is present for the vertical line drawn by git-signs for the modified lines in the buffer.

![image](https://user-images.githubusercontent.com/42811720/175752985-65d7e8c0-5f4d-4ee8-98c0-d86ab89e9602.png)

### Expected result

The screenshot is of Neovim running in [Kitty](https://sw.kovidgoyal.net/kitty/). Notice that the indent indicators of nvim-tree and the modified line indicators of gitsigns are displayed as continous vertical lines. 

![image](https://user-images.githubusercontent.com/42811720/175753007-743007f8-9890-4c56-9a98-b2a15c6be48b.png)
khalidchawtany commented 2 years ago

You need to modify your font and make those "separator" characters taller. The GUI does not differentiate between those characters or any other character.

hernancerm commented 2 years ago

That makes sense, I know Kitty provides symbol mapping, which allows mapping unicode codepoints to a particular font. I might have some mapping that makes the vertical bar char taller in Kitty than in VimR.

I've tried Fira Code in VimR, which has a very tall vertical bar, and the broken vertical lines no longer happens.

image

It would be nice if VimR also provided the symbol mapping feature that Kitty provides, not sure how big of a feature request that would be. This would remove the need to patch fonts for VimR, as it's now the case for Kitty. Here is some documentation about the symbol map in Kitty:

https://gist.github.com/fwfurtado/e7e40cf8b07cff18c6d7bd1649676abf#file-kitty-conf-L60

EDIT:

I've explicitly configured the delimiter character used by nvim-tree to be the box drawing unicode character U+2502. When using Fira Code, there are no gaps, when using Iosevka (and other fonts) I see gaps. In the box drawing document provided by unicode.org, it says:

The shapes of the reference glyphs used in these code charts are not prescriptive. Considerable variation is to be expected in actual fonts.

So I think the height of a Unicode character might depend also on the font, not just on the codepoint. I haven't been able to make U+2502 not full height in Kitty, even when mapping it to the one provided by Iosevka, so not sure if some other magic is being done by Kitty, or what is special about Fira Code.