sourcegraph / sg.nvim

Experimental Sourcegraph + Cody plugin for Neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion: User friendly input box by default for `CodyTask`

manish-baghel opened this issue · comments

Preview

2024-03-13-024915_1014x424_scrot

Code Example

{
	"<space>ca",
	function()
		local buf = vim.api.nvim_get_current_buf()
		local start_row, end_row = utils.get_visual_selection_rows()

		vim.ui.input({ prompt = "Task/Ask: " }, function(input)
			if input == nil or input == "" then
				return
			end
			require("sg.cody.commands").do_task(buf, start_row, end_row, input)
		end)
	end,
	mode = "v",
},

@tjdevries
I can raise a PR if this looks alright to you.