mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 19:12:38 +00:00 
			
		
		
		
	nvim-bufferline: fix catppuccin integration
Handle breaking changes gracefully for once, ffs Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6a6a69647fc9d590ec3cb0cee53e4e6ae2f88de5
This commit is contained in:
		
					parent
					
						
							
								2586f3ef61
							
						
					
				
			
			
				commit
				
					
						7592797325
					
				
			
		
					 2 changed files with 19 additions and 7 deletions
				
			
		|  | @ -3,7 +3,7 @@ | |||
|   lib, | ||||
|   ... | ||||
| }: let | ||||
|   inherit (lib.options) mkOption mkEnableOption literalExpression; | ||||
|   inherit (lib.options) mkOption mkEnableOption literalExpression literalMD; | ||||
|   inherit (lib.types) enum bool either nullOr str int listOf attrs; | ||||
|   inherit (lib.generators) mkLuaInline; | ||||
|   inherit (lib.nvim.binds) mkMappingOption; | ||||
|  | @ -24,17 +24,28 @@ in { | |||
|       movePrevious = mkMappingOption "Move previous buffer" "<leader>bmp"; | ||||
|     }; | ||||
| 
 | ||||
|     setupOpts = mkPluginSetupOption "Bufferline-nvim" { | ||||
|     setupOpts = mkPluginSetupOption "bufferline-nvim" { | ||||
|       highlights = mkOption { | ||||
|         type = either attrs luaInline; | ||||
|         default = | ||||
|           if config.vim.theme.enable && config.vim.theme.name == "catppuccin" | ||||
|           then | ||||
|             mkLuaInline | ||||
|             '' | ||||
|               require("catppuccin.groups.integrations.bufferline").get() | ||||
|             mkLuaInline '' | ||||
|               (function() | ||||
|                 local integration = require("catppuccin.groups.integrations.bufferline") | ||||
|                 return (integration.get_theme or integration.get)() | ||||
|               end)() | ||||
|             '' | ||||
|           else {}; | ||||
|         defaultText = literalMD '' | ||||
|           ```lua | ||||
|           (function() | ||||
|             local integration = require("catppuccin.groups.integrations.bufferline") | ||||
|             return (integration.get_theme or integration.get)() | ||||
|           end)() | ||||
|           ``` | ||||
|           if the active theme is Catppuccin, `{}` otherwise. | ||||
|         ''; | ||||
|         description = '' | ||||
|           Overrides the highlight groups of bufferline. | ||||
| 
 | ||||
|  | @ -59,10 +70,11 @@ in { | |||
|         themable = mkOption { | ||||
|           type = bool; | ||||
|           default = true; | ||||
|           example = false; | ||||
|           description = '' | ||||
|             Whether or not to allow highlight groups to be overridden. | ||||
| 
 | ||||
|             While false, bufferline.nvim sets highlights as default. | ||||
|             While `false`, bufferline.nvim sets highlights as default. | ||||
|           ''; | ||||
|         }; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue