acksld / messages.nvim Goto Github PK
View Code? Open in Web Editor NEWCapture and show any messages in a customisable (floating) buffer
Capture and show any messages in a customisable (floating) buffer
Hello! Thanks so much for building this.
Would it be possible to name the messages buffer, or provide some sort of identifying information?
I'd love to be able to hit <esc>
to close it, but I'm not seeing it in the :buffers
call and not sure how to target it with a lua function. Apologies if this isn't in scope. Thanks!
According to the manual, this issue is reported after setting.
Error executing Lua callback: /Users/****/.config/nvim/lua/co re/messages.lua:24: attempt to call global 'clip_val' (a nil value) stack traceback: /Users/****/.config/nvim/lua/core/messages.lua:24: in function 'buffer_opts' ...ite/pack/packer/start/messages.nvim/lua/messages/api.lua:8: in function 'open_float' ...ite/pack/packer/start/messages.nvim/lua/messages/api.lua:23: in function 'capture_cmd' ...te/pack/packer/start/messages.nvim/lua/messages/init.lua:12: in function <...te/pack/packer/start/messages.nvim/lua/messages/init.lua:11>
This is my set
`local message_status_ok, messages = pcall(require, "messages")
if not message_status_ok then
return
end
messages.setup({
command_name = 'Messages',
-- should prepare a new buffer and return the winid
-- by default opens a floating window
-- provide a different callback to change this behaviour
-- @param opts: the return value from float_opts
prepare_buffer = function(opts)
local buf = vim.api.nvim_create_buf(false, true)
return vim.api.nvim_open_win(buf, true, opts)
end,
-- should return options passed to prepare_buffer
-- @param lines: a list of the lines of text
buffer_opts = function(lines)
local gheight = vim.api.nvim_list_uis()[1].height
local gwidth = vim.api.nvim_list_uis()[1].width
return {
relative = 'editor',
width = gwidth - 2,
height = clip_val(1, #lines, gheight * 0.5),
anchor = 'SW',
row = gheight - 1,
col = 0,
style = 'minimal',
border = 'rounded',
zindex = 1,
}
end,
})`
Hi - thanks for the plugin! I'm trying to change the window border style, but in the buffer_opts
function, the return map calls clip_val
, which means I need to import messages.utils
in order to use it.
Perhaps a slight restructuring of the config such that window styles can be separated out?
Hey, today I thought that it would be nice to have a toggleable :messages
command, then I found your brand-new plugin :D Thanks for creating it.
I know this is still WIP but would you consider adding an option for the command name? So that one could type e.g. :Mes messages
instead of :Messages messages
?
Edit: I also just noticed that one can't really toggle the messages window yet, what do you think about adding a :TogglesMessages
command that either closes or opens the messages window?
I'd like to be able to run :Messages
instead of :Messages messages
.
The current structure of init.lua
doesn't allow for that.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.