junegunn / junegunn/goyo.vim

Fix to syntax highlighting breaking (in lua)

Open
#269 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vim Script
Stars
4.7k
Forks
118
PR merge metrics
No merged PRs in 30d

Description

I dunno if this has been said before, but I'll just put it here:
When GoyoLeave, check for filetype and source the syntax file (this can be converted to vimscript)
``` lua
function au(evt, pat, cmd) -- (string|table), (string|table), (string)
vim.api.nvim_create_autocmd(evt, { pattern = pat, command = cmd, })
end

au("User", "GoyoLeave", [[if &filetype == "markdown" | source /Users/deangao/.config/nvim/syntax/markdown.vim | endif]])
au("User", "GoyoLeave", [[if &filetype == "nroff" | source /Users/deangao/.config/nvim/syntax/nroff.vim | endif]])
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the GoyoLeave event handling and reproduce the syntax-highlighting break described for Markdown and nroff buffers. Compare the issue's autocmd workaround with the plugin's behavior after leaving Goyo; done means syntax highlighting is restored for those filetypes without the user-local source commands.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, vim
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.