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

for setext style headers the underline is displayed in the symbol list #158

Closed
e3krisztian opened this Issue Feb 28, 2014 · 8 comments

Comments

Projects
None yet
2 participants
@e3krisztian

e3krisztian commented Feb 28, 2014

Setext headers like this
------------------------

show up as underlines (------------------------) instead of the header text in symbol view (ctrl-p @ or ctrl-r)

ST 2.0.2 (Linux), MarkdownEditing 2.0.6

@maliayas

This comment has been minimized.

Show comment
Hide comment
@maliayas

maliayas Feb 28, 2014

Member

I am aware of that. Unfortunately, capturing the header text for setext headers is not possible afaik. For this reason, instead of showing nothing, I preferred displaying the underlines to indicate there is a header there.

Member

maliayas commented Feb 28, 2014

I am aware of that. Unfortunately, capturing the header text for setext headers is not possible afaik. For this reason, instead of showing nothing, I preferred displaying the underlines to indicate there is a header there.

@maliayas maliayas added the impossible label Feb 28, 2014

@maliayas

This comment has been minimized.

Show comment
Hide comment
@maliayas

maliayas Feb 28, 2014

Member

But maybe we can put a fixed placeholder text instead of ----- and ====. What do you think?

Member

maliayas commented Feb 28, 2014

But maybe we can put a fixed placeholder text instead of ----- and ====. What do you think?

@e3krisztian

This comment has been minimized.

Show comment
Hide comment
@e3krisztian

e3krisztian Mar 1, 2014

Well, I do not think it would help much placing a message instead of the underlines in the symbol list.

I have looked into it a bit and even had partial success: had multi-line paragraphs show up as one line in the symbol list (modified Markdown.tmLanguage at meta.paragraph.markdown's patterns), tailor it down for the first line in a special case (with a new symbolTransformation in Symbol List - Heading.tmPreferences).
However I could not filter the paragraphs down to headers - either all paragraphs or none was shown.

So I feel it should be possible, but too hard for me to make it.

e3krisztian commented Mar 1, 2014

Well, I do not think it would help much placing a message instead of the underlines in the symbol list.

I have looked into it a bit and even had partial success: had multi-line paragraphs show up as one line in the symbol list (modified Markdown.tmLanguage at meta.paragraph.markdown's patterns), tailor it down for the first line in a special case (with a new symbolTransformation in Symbol List - Heading.tmPreferences).
However I could not filter the paragraphs down to headers - either all paragraphs or none was shown.

So I feel it should be possible, but too hard for me to make it.

@maliayas

This comment has been minimized.

Show comment
Hide comment
@maliayas

maliayas Mar 1, 2014

Member

It is not possible.

For multiline blocks, Sublime Text offers only one way for capturing. It is this: you define a regex to capture the beginning and another regex to capture the end of the block. This way you can define the block. However, those regexes can be run against only a single line.

To put it in another way, if you can define the beginning and the end regex for a setext header, I can help you with the rest.

The second regex is easy: ^[=\-]+$

But the first one is not. If you think something like this: ^.+(?=\n[=\-]+$) it won't work because it is not allowed to overflow to the next line.

Member

maliayas commented Mar 1, 2014

It is not possible.

For multiline blocks, Sublime Text offers only one way for capturing. It is this: you define a regex to capture the beginning and another regex to capture the end of the block. This way you can define the block. However, those regexes can be run against only a single line.

To put it in another way, if you can define the beginning and the end regex for a setext header, I can help you with the rest.

The second regex is easy: ^[=\-]+$

But the first one is not. If you think something like this: ^.+(?=\n[=\-]+$) it won't work because it is not allowed to overflow to the next line.

@e3krisztian

This comment has been minimized.

Show comment
Hide comment
@e3krisztian

e3krisztian Mar 3, 2014

OK, I see now, thanks!

At the time of trying I was unable to find any usable Sublime Text documentation on it, certainly not something with details you mentioned.

Is TextMate's 12.2 Language Rules the ST documentation?


I see any of these steps slightly forward:

  • notify Jon about the problem, so that ST could develop this feature in the future

  • document it in the README.md with text like

    ## KNOWN BUGS ##
    
    - Setext headers do not show up in symbol list (#158)
    
  • show some strange looking placeholder instead of underlines as you first mentioned - (Setext header - MarkdownEditing #158: can not show it here, sorry)

But these are just slightly better than simply closing this issue, so closing is fine as well.

e3krisztian commented Mar 3, 2014

OK, I see now, thanks!

At the time of trying I was unable to find any usable Sublime Text documentation on it, certainly not something with details you mentioned.

Is TextMate's 12.2 Language Rules the ST documentation?


I see any of these steps slightly forward:

  • notify Jon about the problem, so that ST could develop this feature in the future

  • document it in the README.md with text like

    ## KNOWN BUGS ##
    
    - Setext headers do not show up in symbol list (#158)
    
  • show some strange looking placeholder instead of underlines as you first mentioned - (Setext header - MarkdownEditing #158: can not show it here, sorry)

But these are just slightly better than simply closing this issue, so closing is fine as well.

@maliayas

This comment has been minimized.

Show comment
Hide comment
@maliayas

maliayas Mar 3, 2014

Member

Is TextMate's 12.2 Language Rules the ST documentation?

That mostly applies to ST, too. However, I couldn't find the detail I mentioned (single-line only regex) there. When the docs doesn't cover things, trial and error is your friend. And don't forget to read the unofficial docs.

show some strange looking placeholder instead of underlines as you first mentioned

Underlines are better IMHO.

document it in the README.md with text like

Done.

Member

maliayas commented Mar 3, 2014

Is TextMate's 12.2 Language Rules the ST documentation?

That mostly applies to ST, too. However, I couldn't find the detail I mentioned (single-line only regex) there. When the docs doesn't cover things, trial and error is your friend. And don't forget to read the unofficial docs.

show some strange looking placeholder instead of underlines as you first mentioned

Underlines are better IMHO.

document it in the README.md with text like

Done.

@maliayas maliayas closed this Mar 3, 2014

@e3krisztian

This comment has been minimized.

Show comment
Hide comment
@e3krisztian

e3krisztian Mar 4, 2014

Thank you for explaining all the details and your time!

:)

(BTW the README.md have not changed, yet)

e3krisztian commented Mar 4, 2014

Thank you for explaining all the details and your time!

:)

(BTW the README.md have not changed, yet)

@maliayas

This comment has been minimized.

Show comment
Hide comment
@maliayas

maliayas Mar 4, 2014

Member

Haha, you're creative with markdown :)

It's in the v2.0.7 branch. Not merged yet.

Member

maliayas commented Mar 4, 2014

Haha, you're creative with markdown :)

It's in the v2.0.7 branch. Not merged yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment