-
Notifications
You must be signed in to change notification settings - Fork 407
Enhance fold labels on folded beamer frames #1830
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -171,14 +171,20 @@ function! s:folder.parse_caption_frame(line) abort dict " {{{1 | |
| let i = v:foldstart | ||
| while i <= v:foldend | ||
| if getline(i) =~# '^\s*\\frametitle' | ||
| return matchstr(getline(i), | ||
| let frametitle = matchstr(getline(i), | ||
| \ '^\s*\\frametitle\(\[.*\]\)\?{\zs.\{-1,}\ze\(}\s*\)\?$') | ||
| if i+1 <= v:foldend && getline(i+1) =~# '^\s*\\framesubtitle' | ||
| let framesubtitle = matchstr(getline(i+1), | ||
| \ '^\s*\\framesubtitle\(\[.*\]\)\?{\zs.\{-1,}\ze\(}\s*\)\?$') | ||
| return printf('%S: %S', frametitle, framesubtitle) | ||
| end | ||
| return frametitle | ||
| end | ||
| let i += 1 | ||
| endwhile | ||
|
|
||
| " If no caption found, check for a caption comment | ||
| return matchstr(a:line,'\\begin\*\?{.*}\s*%\s*\zs.*') | ||
| return matchstr(a:line,'\\begin\*\?{.*}\(\[.*\]\)\?\s*%\s*\zs.*') | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't get it to work with the suggestion. What would be the improvement? I copied the regex for detecting the brackets from the |
||
| endfunction | ||
|
|
||
| " }}}1 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would simplify this to:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this and as far as I can tell this adds
: 0to the fold text if no subtitle is available, so theifcondition seems necessary. But I could remove the extra variable andreturnstatement, if you prefer.