mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 19:12:38 +00:00 
			
		
		
		
	Merge pull request #825 from horriblename/fix-additional-rtp-override
rc: do not set options via luaConfigPre
This commit is contained in:
		
				commit
				
					
						d2cb38ca0e
					
				
			
		
					 3 changed files with 13 additions and 25 deletions
				
			
		|  | @ -107,6 +107,8 @@ | |||
| - Add `LazyFile` user event. | ||||
| - Migrate language modules from none-ls to conform/nvim-lint | ||||
| - Add tsx support in conform and lint | ||||
| - Moved code setting `additionalRuntimePaths` and `enableLuaLoader` out of | ||||
|   `luaConfigPre`'s default to prevent being overridden | ||||
| 
 | ||||
| [diniamo](https://github.com/diniamo): | ||||
| 
 | ||||
|  |  | |||
|  | @ -5,7 +5,7 @@ | |||
| }: let | ||||
|   inherit (builtins) map mapAttrs filter; | ||||
|   inherit (lib.attrsets) mapAttrsToList; | ||||
|   inherit (lib.strings) concatLines concatMapStringsSep; | ||||
|   inherit (lib.strings) concatLines concatMapStringsSep optionalString; | ||||
|   inherit (lib.trivial) showWarnings; | ||||
|   inherit (lib.generators) mkLuaInline; | ||||
|   inherit (lib.nvim.dag) entryAfter mkLuarcSection resolveDag entryAnywhere; | ||||
|  | @ -72,6 +72,14 @@ in { | |||
|           dag = cfg.luaConfigRC; | ||||
|           mapResult = result: | ||||
|             concatLines [ | ||||
|               (optionalString (cfg.additionalRuntimePaths != []) '' | ||||
|                 vim.opt.runtimepath:append(${toLuaObject cfg.additionalRuntimePaths}) | ||||
|               '') | ||||
|               (optionalString cfg.enableLuaLoader '' | ||||
|                 if vim.loader then | ||||
|                   vim.loader.enable() | ||||
|                 end | ||||
|               '') | ||||
|               cfg.luaConfigPre | ||||
|               (concatMapStringsSep "\n" mkLuarcSection result) | ||||
|               cfg.luaConfigPost | ||||
|  |  | |||
|  | @ -1,15 +1,7 @@ | |||
| { | ||||
|   config, | ||||
|   lib, | ||||
|   ... | ||||
| }: let | ||||
| {lib, ...}: let | ||||
|   inherit (lib.options) mkOption literalMD literalExpression; | ||||
|   inherit (lib.strings) optionalString; | ||||
|   inherit (lib.types) str bool int enum attrsOf lines listOf either path submodule anything; | ||||
|   inherit (lib.nvim.types) dagOf; | ||||
|   inherit (lib.nvim.lua) listToLuaTable; | ||||
| 
 | ||||
|   cfg = config.vim; | ||||
| in { | ||||
|   options.vim = { | ||||
|     enableLuaLoader = mkOption { | ||||
|  | @ -286,21 +278,7 @@ in { | |||
| 
 | ||||
|     luaConfigPre = mkOption { | ||||
|       type = str; | ||||
|       default = '' | ||||
|         ${optionalString (cfg.additionalRuntimePaths != []) '' | ||||
|           -- The following list is generated from `vim.additionalRuntimePaths` | ||||
|           -- and is used to append additional runtime paths to the | ||||
|           -- `runtimepath` option. | ||||
|           vim.opt.runtimepath:append(${listToLuaTable cfg.additionalRuntimePaths}) | ||||
|         ''} | ||||
| 
 | ||||
|         ${optionalString cfg.enableLuaLoader '' | ||||
|           if vim.loader then | ||||
|             vim.loader.enable() | ||||
|           end | ||||
|         ''} | ||||
|       ''; | ||||
| 
 | ||||
|       default = ""; | ||||
|       defaultText = literalMD '' | ||||
|         By default, this option will **append** paths in | ||||
|         [](#opt-vim.additionalRuntimePaths) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 GitHub
					GitHub