Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: one-line named section #8

Open
wleoncio opened this issue May 12, 2020 · 2 comments
Open

Feature request: one-line named section #8

wleoncio opened this issue May 12, 2020 · 2 comments

Comments

@wleoncio
Copy link

Feature

I would like to be able to automatically add one-line section names like this:

# Section Name ============================

(ditto for sub-sections)

Motivation

I've set "divider.lines": 1 thinking it would allow me to have a section formatted as mentioned above, but all I get is

# ============================

Which is the one-line comment discussed on issue #4. That is different from what I would like to have, which is a one-line named (sub)section divider. Apparently, the minimum value for divider.lines which produces a meaningful output is 3, but that produces a block-formatted section divider.

I believe this feature is important for those writing in languages such as R, where the VS Code Breadcrumbs won't see the section names unless they are formatted as one-liners (not to mention other editors such as RStudio).

For what it's worth, the Comment Divider extension offers that feature, but it is buggy (indentation doesn't work, divider ends with character that also breaks the Breadcrumb detection) and the whole project seems to have been abandoned mid-2019.

@dinhani
Copy link
Owner

dinhani commented May 12, 2020

I will keep this issue open because it is something that can be implemented, but it is outside of the initial intended scope for this extension because Comment Divider already does that.

To support this feature it will be necessary to handle not only one-line dividers, but also generating block dividers from text. Also text can have more than one line. And probably text alignment inside the block.

@wleoncio
Copy link
Author

Thank you for considering the feature! Since the base extension already assumes left-aligned text, I see no reason to implement text alignment just to fulfill this request. I do see your point about having to take the section name length into consideration when generating the line to be a new thing, though. Perhaps something involving a dialog box asking for the section name would help?

FWIW, my workaround for now is to generate the regular one-line dividers, go back up one line and use "overwrite mode" (thanks to the Overtype extension) to write the section name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants