aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorFlorian Fischer <gitlab@muhq.space>2025-07-27 14:55:37 +0000
committerFlorian Fischer <gitlab@muhq.space>2025-07-27 14:55:37 +0000
commitd9c6b0f60dae559eca22b0d0750c2327d11e11ef (patch)
tree681d3e2557544e7008dba8644a98f0f37a1f2b37 /init.lua
parentbb3b211399ae0738c52acedae202565dacdadb4e (diff)
parent6a4755ec3ee4c8214d76bf8b0461534490df47dd (diff)
downloadvis-lspc-d9c6b0f60dae559eca22b0d0750c2327d11e11ef.tar.gz
vis-lspc-d9c6b0f60dae559eca22b0d0750c2327d11e11ef.zip
Merge branch 'fix_last_char_range' into 'main'
fix conversion of last newline selections Closes #52 See merge request muhq/vis-lspc!63
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua34
1 files changed, 18 insertions, 16 deletions
diff --git a/init.lua b/init.lua
index 469736b..29a4ed2 100644
--- a/init.lua
+++ b/init.lua
@@ -487,27 +487,29 @@ local function vis_apply_workspaceEdit(_, _, workspaceEdit)
end
end
- -- generate change summary
- local summary = '--- workspace edit summary ---\n'
- for uri, edits in pairs(file_edits) do
- local path = uri_to_path(uri)
- summary = summary .. path .. ':\n'
- for i, edit in ipairs(edits) do
- summary = summary .. '\t' .. i .. '.: ' .. lspc.json.encode(edit) .. '\n'
+ if not lspc.autoconfirm_edits then
+ -- generate change summary
+ local summary = '--- workspace edit summary ---\n'
+ for uri, edits in pairs(file_edits) do
+ local path = uri_to_path(uri)
+ summary = summary .. path .. ':\n'
+ for i, edit in ipairs(edits) do
+ summary = summary .. '\t' .. i .. '.: ' .. lspc.json.encode(edit) .. '\n'
+ end
end
- end
- lspc_show_message(summary)
- vis:redraw()
+ lspc_show_message(summary)
+ vis:redraw()
- -- get user confirmation
- local confirmation = lspc_confirm('apply changes:')
+ -- get user confirmation
+ local confirmation = lspc_confirm('apply changes:')
- -- close summary window
- lspc_close_message_win()
+ -- close summary window
+ lspc_close_message_win()
- if not confirmation then
- return
+ if not confirmation then
+ return
+ end
end
-- apply changes to open files