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

Folding at scene_headings level #92

Open
davidbragg opened this issue Sep 9, 2019 · 6 comments
Open

Folding at scene_headings level #92

davidbragg opened this issue Sep 9, 2019 · 6 comments

Comments

@davidbragg
Copy link

It would be extremely helpful if we could code fold scenes with scene_headings items at the start level item. Makes writing and editing easier as Atom remembers what was folded. Easy visual markers and makes things clearer.

Currently indenting scenes to use Atom's automatic folding, but this requires undoing all the indents to export appropriately. Haven't tried to see how fault tolerant other apps might be importing this indented content. Would be much nicer if it supported it in the package.

@jrbostic
Copy link
Collaborator

It's not entirely clear to me what you're describing here. This is a feature desired in the editor window? Outline? Exported pdf? Screenshots and links might help to demonstrate desired behavior as well as how you're working around.

@davidbragg
Copy link
Author

davidbragg commented Sep 11, 2019

Code folding in the editor, using the scene_headings item as the opener and folding everything beneath it until the next scene_headings. This way you could collapse a screenplay the same way you collapse code.

https://flight-manual.atom.io/using-atom/sections/folding/
https://flight-manual.atom.io/hacking-atom/sections/creating-a-grammar/#code-folding

It's something I looked at briefly to see if I could implement it locally, but it's pretty far outside my wheelhouse.

Atom will do folding based on tabbing. Right now tab indenting everything in the scene. This causes output issues, either not rendering at all or honouring the indents in the formatted screenplay. I believe honouring the indents is the correct behaviour in this case, but not what I'd ultimately like.

@superlou
Copy link
Owner

I think part of the problem is we aren't using the new tree-sitter parser for the Fountain grammar. It would be a good improvement to recreate the grammar for tree-sitter, which would give us features like code-folding for free.

@davidbragg
Copy link
Author

That would explain why my attempts to hack at it locally failed.

@superlou
Copy link
Owner

There is a script to convert grammars if you want to try getting the tree-sitter parser working. I'd be happy to accept PRs.

@davidbragg
Copy link
Author

Script doesn't appear to be doing what I want. I keep getting left with an initialized, empty project.

Tried poking at it further and the scope of the changes required is definitely outside of my expertise.

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

3 participants