Skip to content

Commit 3462383

Browse files
committed
fix(messages): Right align icons
fix(messages): Set correct `numberwidth` & other statuscolumn options
1 parent faf0074 commit 3462383

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

lua/ui/message.lua

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ message.statuscolumn = function ()
6363
for _, entry in ipairs(win == message.history_window and (message.history_decorations or {}) or (message.decorations or {})) do
6464
if lnum >= entry.from and lnum <= entry.to then
6565
if lnum == entry.from and vim.v.virtnum == 0 then
66-
return utils.to_statuscolumn(entry.icon);
66+
return "%=" .. utils.to_statuscolumn(entry.icon);
6767
elseif lnum == entry.to and vim.v.virtnum == 0 then
68-
return utils.to_statuscolumn(
68+
return "%=" .. utils.to_statuscolumn(
6969
entry.tail or entry.padding or entry.icon
7070
);
7171
else
72-
return utils.to_statuscolumn(
72+
return "%=" .. utils.to_statuscolumn(
7373
entry.padding or entry.icon
7474
);
7575
end
@@ -1253,6 +1253,9 @@ message.__history = function (entries)
12531253

12541254
vim.api.nvim_set_current_win(message.history_window);
12551255

1256+
utils.set("w", message.history_window, "number", true);
1257+
utils.set("w", message.history_window, "relativenumber", true);
1258+
utils.set("w", message.history_window, "numberwidth", 1);
12561259
utils.set("w", message.history_window, "statuscolumn", "%!v:lua.__ui_statuscolumn()");
12571260

12581261
utils.set("w", message.history_window, "wrap", true);
@@ -1340,7 +1343,7 @@ message.__showcmd = function (content)
13401343
if message.show_window and vim.api.nvim_win_is_valid(message.show_window) then
13411344
vim.api.nvim_win_set_config(message.show_window, window_config);
13421345
else
1343-
message.show_window = vim.api.nvim_open_win(message.show_buffer, false, window_config);
1346+
message.show_window = utils.open_win(message.show_buffer, false, window_config);
13441347
vim.api.nvim_win_set_var(message.show_window, "ui_window", true);
13451348

13461349
--- Always horizontally center the cursor.

0 commit comments

Comments
 (0)