Fix mapping normalization order
This commit is contained in:
@@ -82,7 +82,7 @@ config.get = function()
|
|||||||
global_config.revision or 0,
|
global_config.revision or 0,
|
||||||
onetime_config.revision or 0,
|
onetime_config.revision or 0,
|
||||||
}, function()
|
}, function()
|
||||||
return config.normalize(misc.merge(onetime_config, global_config))
|
return misc.merge(config.normalize(onetime_config), config.normalize(global_config))
|
||||||
end)
|
end)
|
||||||
elseif api.is_cmdline_mode() then
|
elseif api.is_cmdline_mode() then
|
||||||
local cmdtype = vim.fn.getcmdtype()
|
local cmdtype = vim.fn.getcmdtype()
|
||||||
@@ -94,7 +94,7 @@ config.get = function()
|
|||||||
cmdtype,
|
cmdtype,
|
||||||
cmdline_config.revision or 0,
|
cmdline_config.revision or 0,
|
||||||
}, function()
|
}, function()
|
||||||
return config.normalize(misc.merge(cmdline_config, global_config))
|
return misc.merge(config.normalize(cmdline_config), misc.merge(global_config))
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
local bufnr = vim.api.nvim_get_current_buf()
|
local bufnr = vim.api.nvim_get_current_buf()
|
||||||
@@ -111,9 +111,9 @@ config.get = function()
|
|||||||
buffer_config.revision or 0,
|
buffer_config.revision or 0,
|
||||||
}, function()
|
}, function()
|
||||||
local c = {}
|
local c = {}
|
||||||
c = config.normalize(misc.merge(c, buffer_config))
|
c = misc.merge(config.normalize(c), config.normalize(buffer_config))
|
||||||
c = config.normalize(misc.merge(c, filetype_config))
|
c = misc.merge(config.normalize(c), config.normalize(filetype_config))
|
||||||
c = config.normalize(misc.merge(c, global_config))
|
c = misc.merge(config.normalize(c), config.normalize(global_config))
|
||||||
return c
|
return c
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ mapping.preset.cmdline = function(override)
|
|||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
else
|
else
|
||||||
cmp.complete()
|
cmp.complete({ reason = cmp.ContextReason.Manual })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
@@ -60,7 +60,7 @@ mapping.preset.cmdline = function(override)
|
|||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
else
|
else
|
||||||
cmp.complete()
|
cmp.complete({ reason = cmp.ContextReason.Manual })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
@@ -84,6 +84,9 @@ mapping.preset.cmdline = function(override)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
['<C-e>'] = {
|
||||||
|
c = mapping.close(),
|
||||||
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,18 @@ describe('misc', function()
|
|||||||
})
|
})
|
||||||
assert.are.equal(merged.a.b, 1)
|
assert.are.equal(merged.a.b, 1)
|
||||||
|
|
||||||
|
merged = misc.merge({
|
||||||
|
a = {
|
||||||
|
i = 1,
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
a = {
|
||||||
|
c = 2,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
assert.are.equal(merged.a.i, 1)
|
||||||
|
assert.are.equal(merged.a.c, 2)
|
||||||
|
|
||||||
merged = misc.merge({
|
merged = misc.merge({
|
||||||
a = false,
|
a = false,
|
||||||
}, {
|
}, {
|
||||||
|
|||||||
Reference in New Issue
Block a user