You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tabstop and list settings are ignored on cat mode #35
Currently when printing tabs on cat mode, nvimpager ignores tabstop and list settings and just prints the tabs as is. This is different from pager mode, where those settings are used as expected. I was wondering if it's possible to add support for them for cat mode, so the output of cat mode and pager mode would be the same.
Interpreting ts in cat mode might involve keeping track of the current (virtual) position in the line to know where the next tabstop should start. There is also tabs(1) to handle tabstop definitions on the terminal side of things. Maybe it is as easy as calling system("tabs -".&ts). But as ts is buffer-local we have to do this in an BufferLoad auto command or so.
Reading the docs of &listchar it might be some work to implement the rendering with &list on. Especially the different possibilities for a tab. That might make the tabs(1) solution from above unsuitable.
Currently I am working on replacing the AnsiEsc plugin in the poc/ansi2syntax branch. So it might take some time before I get to this but I'm happy to explore and discuss this.
@tamirzb today I had some time and started to implement this. Have a look at the feature/listchars branch. Tabs are still missing and the extends and precedes listchar settings are not applicable in cat mode. And for the listchar conceal setting I still have to figure out how it interacts with the general conceal setting. But eol, space nbsp and tailing spaces are implemented.
Please check out 6b0733e. I have implemented rendering of listchars in cat mode for spaces, trailing spaces, nbsp and EOL. Tabs are more complicated and have been skipped for now. They can be added later.
@tamirzb I was thinking about the tabs for some time again. I think it might be nice to only render tabs as the correct number of spaces if &expandtab is set. Normally the option is only used in insert mode, so it has no meaning in nvimpagers cat mode. So we can use it to decide if we should turn tags into the correct number of spaces to honour &ts or just print plain tab characters ad let the terminal handle it all. What do you think?
Activity
lucc commentedon Oct 30, 2020
Interesting idea.
Interpreting
tsin cat mode might involve keeping track of the current (virtual) position in the line to know where the next tabstop should start. There is alsotabs(1)to handle tabstop definitions on the terminal side of things. Maybe it is as easy as callingsystem("tabs -".&ts). But astsis buffer-local we have to do this in anBufferLoadauto command or so.Reading the docs of
&listcharit might be some work to implement the rendering with&liston. Especially the different possibilities for a tab. That might make thetabs(1)solution from above unsuitable.Currently I am working on replacing the AnsiEsc plugin in the poc/ansi2syntax branch. So it might take some time before I get to this but I'm happy to explore and discuss this.
lucc commentedon Jan 17, 2021
Currently I can not find the time to work on this but I am open for PRs.
Implement listchars handling for spaces and eol
lucc commentedon Mar 1, 2021
@tamirzb today I had some time and started to implement this. Have a look at the feature/listchars branch. Tabs are still missing and the extends and precedes listchar settings are not applicable in cat mode. And for the listchar conceal setting I still have to figure out how it interacts with the general conceal setting. But eol, space nbsp and tailing spaces are implemented.
tamirzb commentedon Mar 2, 2021
Cool! Will take a look soon
Implement listchars handling for spaces and eol
lucc commentedon Jun 5, 2021
Please check out 6b0733e. I have implemented rendering of listchars in cat mode for spaces, trailing spaces, nbsp and EOL. Tabs are more complicated and have been skipped for now. They can be added later.
Merge tag 'v0.10' into develop
lucc commentedon Jun 7, 2021
I released 0.10 which contains the above commit.
@tamirzb I was thinking about the tabs for some time again. I think it might be nice to only render tabs as the correct number of spaces if
&expandtabis set. Normally the option is only used in insert mode, so it has no meaning in nvimpagers cat mode. So we can use it to decide if we should turn tags into the correct number of spaces to honour&tsor just print plain tab characters ad let the terminal handle it all. What do you think?