Closed Nithin745 closed 1 year ago
@Nithin745 do you have set the org_tags_column
option in in your config?
@Nithin745 do you have set the
org_tags_column
option in in your config?
yes i set it to 50 and also checked with 20. still the look the same ` require('orgmode').setup{ org_agenda_files = {'/Public/orgmode/agenda/*', '/Public/orgmode/notes/*/'}, org_default_notes_file = '/Public/orgmode/notes/refile.org', org_capture_templates = { n = { description = 'Notes', template = '#+TITLE: %?\n#+DATE: %t\n', target = '~/Public/orgmode/notes/refile.org' } }, org_tags_column = 20 -- win_split_mode = {'float', .9} }
`
I had the same problem and turning of the sign column helped. I end up with an autocommand for that
vim.api.nvim_create_autocmd("FileType", {
pattern = "orgagenda",
callback = function()
vim.cmd[[
set nornu
set nonu
set signcolumn=no
]]
end
})
vim.api.nvim_create_autocmd("FileType", { pattern = "orgagenda", callback = function() vim.cmd[[ set nornu set nonu set signcolumn=no ]] end })
Yes this works, but the left side contents too close to the edge of the screen, so turned on only the signcolumn now it looks much better. signcolumn=no
signcolumn=yes
set it to 50 and also checked with 20. still the look the same
My bad, this option does not influence how the tags are displayed in the agenda.
@anton-fomin @Nithin745 could you please try whether this also happens when you run neovim with the minimal config? nvim -u /path/to/orgmode/scripts/minimal_init.lua your-file.org
@anton-fomin @Nithin745 could you please try whether this also happens when you run neovim with the minimal config? nvim -u /path/to/orgmode/scripts/minimal_init.lua your-file.org
And also if it fixes itself if you press r
to refresh the agenda?
@anton-fomin @Nithin745 could you please try whether this also happens when you run neovim with the minimal config?
nvim -u /path/to/orgmode/scripts/minimal_init.lua your-file.org
In the minimal config it is not happening, but i think (like @anton-fomin said) culprit is the sign column, because when i add the sign column to the minimal-config the tags are once again out of screen.
And also if it fixes itself if you press r to refresh the agenda?
Refreshing the agenda by pressing the r
is also not working, when signcolumn is present in both my config and minimal-config
mininmal-config with signcolumn and relativenumbers
mininmal-config without signcolumn
I've started looking into this. The issue is that we are only checking if the (rel)numbers column is present. What we should do instead is getting the whole gutter width with getwininfo().textoff
, but unfortunately we are determining the content of the agenda (including the offset between agenda-items and their tags) before the window in question is even created. @kristijanhusak would there be a drawback to calling Agenda:open_window
from Agenda:new
or wherever suitable, as long as it is before we call e.g. AgendaView:new
? We could then add another field win_width
to store getwininfo().textoff
, that we then pass to the views via the opts. This would also make the call to utils.winwidth
for every agenda item obsolete.
edit: on that note, can we also use getwininfo().textoff
in utils.winwidth
?
@jgollenz I remember splitting things out for some reason, but I don't remember what was the reason.
The only thing that crosses my mind is custom agenda commands that we plan to add in the future.
Generally utils.winwidth
seems invalid because it's not really checking the agenda window propeties, at least not on the initial open.
I think we should just disable all numbers/relativenumbers/signcolumn in the agenda view. Emacs doesn't render any of those, no matter the configuration that you have (tried relative numbers).
If you think there is some value to not override those, we can go with the solution to open the window before generating the data and use textoff
for offset.
This has troubled me for a while :sweat_smile: @anton-fomin's autocommand does the trick, but I also agree with @Nithin745 that with this it's visually displeasing as the content of the agenda is too close to the left edge. There is a break the text flow from the org file opened to the agenda.
So :+1: if it can be fixed without getting rid of the relative numbers an signs column. @jgollenz maybe check the getwininfo().textoff
in the current org
file and then use it for the Agenda? This would make the Agenda content align well with the org file content.
If you think there is some value to not override those
Well, personally I think the num and relnum columns are valuable, because I use them for vertical navigation. My agenda gets quite long sometimes and 17j
beats pressing j
seventeen times any day.
maybe check the getwininfo().textoff in the current org file
@gerazov I don't think this will be consistent. E.g. I have org files with thousands of lines, making the textoff
value at least four, whereas the aganda has a couple of hundred lines tops (ok, vy
almost exceeds 1k for me, but still), so the value would be three. The sign column itself also has no predictable width, as multiple plugins might use it. For instance, I do use gitsigns, which usually means that a sign column is present in the buffer of my org file, but it is not in the agenda buffer.
But even if the margin is too large - at least the text in the Agenda will line up nicely with the text in the open buffer. This is :+1: for aesthetics :slightly_smiling_face:
Actually atm with only the signs column turned off in the Agenda with the autocommand @anton-fomin suggested works ok - I can see the tags in their entirety :+1:
@Nithin745 @anton-fomin @gerazov
Please have a look at #444 and let me know if it fixes the issue
@Nithin745 @anton-fomin @gerazov
Please have a look at #444 and let me know if it fixes the issue
Yes this fixes the issue in the agenda view, thank you
Now even with the signcolumn ON the tags are displaying correctly.
Describe the bug
The tags on the heading are going beyond screen, had to scroll to the right to see the tags.
Steps to reproduce
open agenda to view the week agenda.
Expected behavior
Show the tags within the screen, i.e without need for horizontal scroll
Emacs functionality
No response
Minimal init.lua
n/a
Screenshots and recordings
OS / Distro
fedora 36
Neovim version/commit
0.9
Additional context
No response