Skip to content

Commit c324050

Browse files
committed
(mini.clue) Remove redundant code.
1 parent afceb95 commit c324050

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

lua/mini/clue.lua

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,30 +1851,6 @@ H.is_array_of = function(x, predicate)
18511851
end
18521852

18531853
-- Utilities ------------------------------------------------------------------
1854-
H.echo = function(msg, is_important)
1855-
-- Construct message chunks
1856-
msg = type(msg) == 'string' and { { msg } } or msg
1857-
table.insert(msg, 1, { '(mini.clue) ', 'WarningMsg' })
1858-
1859-
-- Avoid hit-enter-prompt
1860-
local max_width = vim.o.columns * math.max(vim.o.cmdheight - 1, 0) + vim.v.echospace
1861-
local chunks, tot_width = {}, 0
1862-
for _, ch in ipairs(msg) do
1863-
local new_ch = { vim.fn.strcharpart(ch[1], 0, max_width - tot_width), ch[2] }
1864-
table.insert(chunks, new_ch)
1865-
tot_width = tot_width + vim.fn.strdisplaywidth(new_ch[1])
1866-
if tot_width >= max_width then break end
1867-
end
1868-
1869-
-- Echo. Force redraw to ensure that it is effective (`:h echo-redraw`)
1870-
vim.cmd([[echo '' | redraw]])
1871-
vim.api.nvim_echo(chunks, is_important, {})
1872-
end
1873-
1874-
H.unecho = function() vim.cmd([[echo '' | redraw]]) end
1875-
1876-
H.message = function(msg) H.echo(msg, true) end
1877-
18781854
H.error = function(msg) error(string.format('(mini.clue) %s', msg), 0) end
18791855

18801856
H.map = function(mode, lhs, rhs, opts)

0 commit comments

Comments
 (0)