From 3eccd67b21722de5f219205e16a5bdcd8b4ae13d Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 30 Apr 2021 16:45:48 +0200 Subject: [PATCH] Fix option precedence buffer over global --- lua/zettelkasten/files.lua | 1 - lua/zettelkasten/options.lua | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/zettelkasten/files.lua b/lua/zettelkasten/files.lua index 8b6d987..4870545 100644 --- a/lua/zettelkasten/files.lua +++ b/lua/zettelkasten/files.lua @@ -1,5 +1,4 @@ local ls = {} --- TODO rename to files.lua? since it's the only module interacting solely w/ the file system local o = require 'zettelkasten.options' diff --git a/lua/zettelkasten/options.lua b/lua/zettelkasten/options.lua index 3569f45..3b444fe 100644 --- a/lua/zettelkasten/options.lua +++ b/lua/zettelkasten/options.lua @@ -45,7 +45,7 @@ local function get_options(defaults) for opt, _ in pairs(def) do -- check for vim options set (globally or buffer), otherwise use default value - options[opt] = vim.g[def[opt].vimname] or vim.b[def[opt].vimname] or + options[opt] = vim.b[def[opt].vimname] or vim.g[def[opt].vimname] or def[opt].default -- check correct option set for constrained value sets