epwalsh / epwalsh/obsidian.nvim
Custom symbols for checkboxes break when used as narrow symbols in kitty
- Dominant language
- Lua
- Stars
- 6.2k
- Forks
- 250
- PR merge metrics
- No merged PRs in 30d
Description
### 🐛 Describe the bug
When using custom symbols for checkboxes, specified to be rendered narrow in kitty terminal, they look fine. But if you reload kitty config (that is not the only way of triggering bug, but the most consistent one), symbols are displayed at full size, but cut off at 1 cell width
This is it originally
The only thing changed is kitty config reloaded
This is so weird, the issue then persists for every narrow symbol in any kitty window (even new ones), and is fixable in only two ways:
- force quit & relaunch kitty
- reloading config without looking at nvim buffer with loaded obsidian.nvim
Disabling ui does not help, preventable only by completely disabling obsidian.nvim
Does not reproduce with render-markdown.nvim (and obsidian.nvim completely disabled), or in clean install of nvim with custom syntax items. A really weird bug, specific only to obsidian.nvim
### Config
Screenshots above come from this minimal config file:
```lua
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
vim.opt.conceallevel = 2
-- install plugins
local plugins = {
{
"epwalsh/obsidian.nvim",
version = "*", -- recommended, use latest release instead of latest commit
lazy = false,
dependencies = {
"nvim-lua/plenary.nvim",
-- optionals:
"hrsh7th/nvim-cmp",
"nvim-telescope/telescope.nvim",
"nvim-treesitter/nvim-treesitter",
},
opts = {
workspaces = {
{
name = "personal",
path = "~/Notes",
overrides = {
notes_subdir = "inbox",
},
},
},
ui = {
checkboxes = {
[" "] = { char = "", order = 1, hl_group = "ObsidianTodo" },
["x"] = { char = "", order = 2, hl_group = "ObsidianDone" },
[">"] = { char = "", order = 3, hl_group = "ObsidianRightArrow" },
["~"] = { char = "", order = 4, hl_group = "ObsidianTilde" },
["!"] = { char = "!", order = 5, hl_group = "ObsidianImportant" },
},
},
},
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
```
Steps to reproduce:
1. In kitty, specify any nerd font symbols as narrow symbols
2. use those symbols for checkbox items (I believe one is enough, also should work with list items)
3. write any note with modified item
4. reload config
5. ??
6. profit
### Environment
NVIM
```
NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1727870382
Run "nvim -V1 -v" for more info
```
obsidian.nvim
```
Obsidian.nvim v3.9.0 (ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b)
Status:
• buffer directory: nil
• working directory: /Users/som38/Notes/diary
Workspaces:
✓ active workspace: Workspace(name='personal', path='/Users/som38/Notes', root='/Users/som38/Notes')
✗ inactive workspace: Workspace(name='pets', path='/Users/som38/Notes', root='/Users/som38/Notes')
✗ inactive workspace: Workspace(name='straight', path='/Users/som38/Notes', root='/Users/som38/Notes')
Dependencies:
✓ plenary.nvim: 2d9b06177a975543726ce5c73fca176cedbffe9d
✓ nvim-cmp: 3403e2e9391ed0a28c3afddd8612701b647c8e26
✓ telescope.nvim: a0bbec21143c7bc5f8bb02e0005fa0b982edc026
Integrations:
✓ picker: TelescopePicker()
✓ completion: enabled (nvim-cmp) ✗ refs, ✗ tags, ✗ new
all sources:
• nvim_lua
• nvim_lsp
• luasnip
• buffer
• path
• vim-dadbod-completion
• crates
• render-markdown
Tools:
✓ rg: ripgrep 14.1.0
Environment:
• operating system: Darwin
Config:
• notes_subdir: inbox%
```
Contributor guide
Research direction
Start by reproducing the issue with the minimal Lua configuration and the listed Neovim, obsidian.nvim, and kitty setup. Trace the checkbox UI rendering and the behavior after kitty config reload, comparing it with a clean Neovim setup and render-markdown.nvim. Done means custom narrow symbols remain correctly rendered after reloads and in newly opened kitty windows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100