Skip to content

Commit

Permalink
fix: minor tweaks to fix LSP type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed May 22, 2023
1 parent 9b0a311 commit 2f17eee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
set -e
luacheck .
stylua --check .
luacheck lua tests
stylua --check lua tests
9 changes: 5 additions & 4 deletions lua/dressing/input.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ M.close = function()
end

M.highlight = function()
if not context.opts then
local opts = context.opts
if not opts then
return
end
local bufnr = vim.api.nvim_win_get_buf(context.winid)
local opts = context.opts
local text = vim.api.nvim_buf_get_lines(bufnr, 0, 1, true)[1]
local ns = vim.api.nvim_create_namespace("DressingHighlight")
local highlights = {}
Expand Down Expand Up @@ -201,6 +201,8 @@ M.trigger_completion = function()
end
end

---@return integer
---@return boolean
local function create_or_update_win(config, prompt, opts)
local parent_win = 0
local winopt
Expand Down Expand Up @@ -260,8 +262,7 @@ local function create_or_update_win(config, prompt, opts)
-- Make sure the previous on_confirm callback is called with nil
vim.schedule(context.on_confirm)
vim.api.nvim_win_set_config(context.winid, winopt)
local start_in_insert = context.start_in_insert
return context.winid, start_in_insert
return context.winid, context.start_in_insert
else
local start_in_insert = string.sub(vim.api.nvim_get_mode().mode, 1, 1) == "i"
local bufnr = vim.api.nvim_create_buf(false, true)
Expand Down

0 comments on commit 2f17eee

Please sign in to comment.