summaryrefslogtreecommitdiff
path: root/.config/nvim
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-11-14 10:47:40 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-11-14 10:48:21 +0100
commit59fa2b680d169cddc45b65c20e8bc2402d30164c (patch)
treec59289a8051b48b4ef11356f0809c6d5747403df /.config/nvim
parentd62026673b0b833f27b85f8a551cb646ae2bd751 (diff)
nvim: Simplify condition
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/after/ftplugin/gitrebase.lua8
1 files changed, 3 insertions, 5 deletions
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,