Git Product home page Git Product logo

Comments (5)

b0o avatar b0o commented on August 26, 2024

Interesting, thanks for the report. I am indeed able to reproduce this issue. I'll have a look into what's causing this.

from incline.nvim.

TheCedarPrince avatar TheCedarPrince commented on August 26, 2024

@b0o - thank you! And of course, this really isn't a bug with your plugin but more so just a compatibility issue with Goyo. Thanks for being willing to give this a shot! 😄

from incline.nvim.

b0o avatar b0o commented on August 26, 2024

So far, what I've discovered is that Goyo seems to clear certain highlight groups after it's disabled.

My incline highlight groups before running Goyo:

InclineNormal                     links to NormalFloat
InclineNormalNC                   links to NormalFloat
incline__guifg_b4a7de             guifg=#b4a7de
incline__guifg_white              guifg=White
incline__guibg_none__guifg_b4a7de guifg=#b4a7de
incline__gui_bolditalic           gui=bold,italic
incline__guibg_none__guifg_white  guifg=White
incline__guifg_51a0cf             guifg=#51a0cf

My incline highlight groups after toggling Goyo on and then off:

InclineNormal                     links to NormalFloat
InclineNormalNC                   links to NormalFloat
incline__guifg_b4a7de             cleared
incline__guifg_white              cleared
incline__guibg_none__guifg_b4a7de cleared
incline__gui_bolditalic           cleared
incline__guibg_none__guifg_white  cleared
incline__guifg_51a0cf             cleared

The next steps would be to determine why Goyo is clearing highlight groups it didn't create, and then either figure out how to avoid Goyo doing this, or detecting it and re-creating the highlights afterwards.

from incline.nvim.

b0o avatar b0o commented on August 26, 2024

@TheCedarPrince For now, adding this line to your goyo_leave function should cause incline to re-create the highlights:

lua require'incline'.setup{}

(calling setup like this won't clear your pre-existing incline configuration)

Can you let me know if this works?

from incline.nvim.

TheCedarPrince avatar TheCedarPrince commented on August 26, 2024

Hey @b0o ! This works perfectly and completely restores all my original configurations to incline after exiting Goyo! Super excited as now I can use incline for my workflow completely and without problems. Really love the tool and am excited to keep using it. Thanks b0o -- I will close the issue for now. For those curious, here is my current Goyo configuration:

vim.g.goyo_width = '85%' -- Default width
vim.g.goyo_height = '90%' -- Default height

vim.cmd [[
function! s:goyo_enter()
  " Hides mode from showing
  set noshowmode 

  " Hides the sign column
  :set scl=no 

  " Hides lualine
  lua require"lualine".hide() 

  " ...
endfunction
function! s:goyo_leave()
  " Resets syntax highlighting (workaround for goyo bug)
  syntax off 
  syntax on 

  " Makes the signcolumn match the background colorscheme
  highlight clear SignColumn

  " Brings mode back
  set showmode 

  " Shows lualine again
  lua require"lualine".hide({unhide=true})

  " Recreate incline functionality
  lua require'incline'.setup{}

  " ...
endfunction
autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()
]]

from incline.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.