add Range:difference
All checks were successful
NeoVim tests / plenary-tests (push) Successful in 9s

This commit is contained in:
2025-04-13 14:44:28 -06:00
parent dacb186324
commit 9f5fdb4f2b
4 changed files with 101 additions and 50 deletions

View File

@@ -1,11 +1,12 @@
local vim_repeat = require 'u.repeat'
local Pos = require 'u.pos'
local Range = require 'u.range'
local Buffer = require 'u.buffer'
local CodeWriter = require 'u.codewriter'
local M = {}
local ESC = vim.api.nvim_replace_termcodes('<Esc>', true, false, true)
local surrounds = {
[')'] = { left = '(', right = ')' },
['('] = { left = '( ', right = ' )' },
@@ -126,7 +127,7 @@ function M.setup()
do_surround(range, bounds)
-- this is a visual mapping: end in normal mode:
vim.cmd { cmd = 'normal', args = { '' }, bang = true }
vim.cmd.normal(ESC)
end, { noremap = true, silent = true })
-- Change