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

"Live preview" in the editor itself #59

Open
piersdeseilligny opened this issue May 6, 2020 · 12 comments
Open

"Live preview" in the editor itself #59

piersdeseilligny opened this issue May 6, 2020 · 12 comments
Labels
feature A feature that should or is being worked on microsofts-problem The issue is caused by one in vscode, with no workaround available yet

Comments

@piersdeseilligny
Copy link
Owner

A picture speaks a thousand words:
image
What if, while you were typing, it were possible to see the screenplay as such, without the need for a live preview?

Unfortunately this feature is currently impossible because the vscode extension API doesn't support extensions setting margins themselves, but if you're interested, I would highly recommend upvoting this issue in the vscode repo.

@piersdeseilligny piersdeseilligny added the feature A feature that should or is being worked on label May 6, 2020
@segreeeen
Copy link
Contributor

Couldn't you do that by adding tabs instead of the original margins? If it's just a preview, it doesn't really matter if the margins are correct, right? I mean, there already is a really nice preview in the preview window. I'm thinking something like: 3 tabs Character, 2 tabs parentethical, 1 tab dialog, 0 tab instruction. Or such? Just a little input :)...

@piersdeseilligny
Copy link
Owner Author

@segreeeen yeah I was actually just looking at doing that, but the issue is that I can't seem to find a way to add margins on the right-hand side, so it would all look quite weird. But I'm going to keep on digging into this API, and if I find out it's possible i'il definitely be adding that as an optional feature.

@segreeeen
Copy link
Contributor

Ah, got it, its about the right side. True, I didn't think of that.

@osomfinch
Copy link

osomfinch commented Jun 10, 2020

A picture speaks a thousand words...

That would be nice! I would like for this link to be reopen and get enough people for the vote.

BTW. Have you looke into Theia? It's a text editor that is supposed to be like VSCode but with more possibilities for the extension creators.

Thank you for your work!

@daryluren
Copy link
Contributor

So this would be non-editable spacing like what was done with the dialogue numbers? As for the right-margins, I imagine this setting would require/imply the setting "editor.wordWrapColumn": 57 so that you can insert the spacing in the right places.

@piersdeseilligny
Copy link
Owner Author

So this would be non-editable spacing like what was done with the dialogue numbers? As for the right-margins, I imagine this setting would require/imply the setting "editor.wordWrapColumn": 57 so that you can insert the spacing in the right places.

Yep probably, but the issue is that, even with editor.wordWrapColumn set, I don't think it's actually possible to add spacing to the right without actually inserting new lines in the text itself. And modifying the text as such is obviously extremely inconvenient and hacky, so not something I think we should do.

@viegasfh
Copy link

This would be a really nice feature.

@piersdeseilligny
Copy link
Owner Author

It turns out the core issue preventing this from working is a bug in vscode, as it doesn't take into account decorations when calculating the word wrapping positions: microsoft/vscode#32856

Until that bug is fixed in vscode, there's no way of getting this behaviour without some very hacky and unreliable new line insertions :/

@piersdeseilligny piersdeseilligny added the microsofts-problem The issue is caused by one in vscode, with no workaround available yet label Nov 8, 2020
@therealminzii
Copy link

Hey there, just started using this extension and wanted to pick up on this. Granted that right hand margins are a problem, is there a way to automatically add tab/some sort of centering to the dialogue and parenthesis elements? As per previous comments, it doesn’t have to be to exact formatting, but so long as it breaks the dialogue out of action, it’s still a handy way to use it.

@daryluren
Copy link
Contributor

Hi @therealminzii

There was more to this discussion on discord, where Piers decided that modifying the author's text would be too messy.

I gave the text-decoration method a go, which was how we discovered the word-wrap issue.
This is the closest I got. ( '~' used instead of spaces for debugging purposes)
image

Personally, I'd be happy to ignore centering the dialogue (because that's the troublesome part) - and shifting Parentheticals and Character names left to compensate, which would look like this. Piers wasn't too keen on this either though IIRC.
image

@therealminzii
Copy link

Thanks for your response. I agree that even having the character names/parenthesis tabbed in would result in a more helpful way to navigate the text. If you have any hints as to how to do that, I’d be happy to give it a try.

@daryluren
Copy link
Contributor

That's from my own branch which would need Piers' approval and some polish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A feature that should or is being worked on microsofts-problem The issue is caused by one in vscode, with no workaround available yet
Projects
None yet
Development

No branches or pull requests

6 participants