mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-12-24 22:34:52 +01:00
fix: startswith direction
This commit is contained in:
parent
b3315dff9b
commit
2d41812e23
1 changed files with 5 additions and 5 deletions
|
@ -83,7 +83,7 @@ M.move = function(state, path, extra)
|
|||
if selected.type == "buffer" then
|
||||
return vim.ui.input({ prompt = "move content into open buffer?" }, function (input)
|
||||
if input == nil then return end
|
||||
if not vim.startswith("y", string.lower(input)) then return end
|
||||
if not vim.startswith(string.lower(input), "y") then return end
|
||||
local window = utils.get_appropriate_window(state)
|
||||
local buf = vim.api.nvim_win_get_buf(window)
|
||||
buf_manager.attach(selected.name, buf)
|
||||
|
@ -97,7 +97,7 @@ M.copy = function(state, path, extra)
|
|||
if selected.type == "buffer" then
|
||||
return vim.ui.input({ prompt = "copy content to remote buffer?" }, function (input)
|
||||
if input == nil then return end
|
||||
if not vim.startswith("y", string.lower(input)) then return end
|
||||
if not vim.startswith(string.lower(input), "y") then return end
|
||||
local window = utils.get_appropriate_window(state)
|
||||
local buf = vim.api.nvim_win_get_buf(window)
|
||||
local content = codemp_utils.buffer.get_content(buf)
|
||||
|
@ -112,14 +112,14 @@ M.delete = function(state, path, extra)
|
|||
if selected.type == "root" and vim.startswith(selected.name, "#") then
|
||||
vim.ui.input({ prompt = "disconnect from workspace?" }, function (input)
|
||||
if input == nil then return end
|
||||
if not vim.startswith("y", string.lower(input)) then return end
|
||||
if not vim.startswith(string.lower(input), "y") then return end
|
||||
ws_manager.leave()
|
||||
end)
|
||||
elseif selected.type == "buffer" then
|
||||
if CODEMP.workspace == nil then error("join a workspace first") end
|
||||
vim.ui.input({ prompt = "delete buffer '" .. selected.name .. "'?" }, function (input)
|
||||
if input == nil then return end
|
||||
if not vim.startswith("y", string.lower(input)) then return end
|
||||
if not vim.startswith(string.lower(input), "y") then return end
|
||||
CODEMP.workspace:delete(selected.name):and_then(function ()
|
||||
print("deleted buffer " .. selected.name)
|
||||
manager.refresh("codemp")
|
||||
|
@ -129,7 +129,7 @@ M.delete = function(state, path, extra)
|
|||
if CODEMP.client == nil then error("connect to server first") end
|
||||
vim.ui.input({ prompt = "delete buffer '" .. selected.name .. "'?" }, function (input)
|
||||
if input == nil then return end
|
||||
if not vim.startswith("y", string.lower(input)) then return end
|
||||
if not vim.startswith(string.lower(input), "y") then return end
|
||||
CODEMP.client:delete_workspace(selected.name):and_then(function ()
|
||||
print("deleted workspace " .. selected.name)
|
||||
manager.refresh("codemp")
|
||||
|
|
Loading…
Reference in a new issue