From 59fa2b680d169cddc45b65c20e8bc2402d30164c Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 14 Nov 2023 10:47:40 +0100 Subject: nvim: Simplify condition --- .config/nvim/after/ftplugin/gitrebase.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to '.config/nvim/after') diff --git a/.config/nvim/after/ftplugin/gitrebase.lua b/.config/nvim/after/ftplugin/gitrebase.lua index 3a81d62..948ee30 100644 --- a/.config/nvim/after/ftplugin/gitrebase.lua +++ b/.config/nvim/after/ftplugin/gitrebase.lua @@ -11,12 +11,10 @@ local function map(lhs, rhs) node = node:parent() end - if node == nil or node:type() ~= 'operation' then - return + if node ~= nil then + local sr, sc, er, ec = node:child(0):range() + vim.api.nvim_buf_set_text(0, sr, sc, er, ec, { rhs }) end - - local sr, sc, er, ec = node:child(0):range() - vim.api.nvim_buf_set_text(0, sr, sc, er, ec, { rhs }) end, { buffer = true, noremap = true, -- cgit v1.2.3