derickc / Fountainhead

Contextual Sublime Text screenwriting environment using the Fountain screenplay syntax.
http://classicblunders.com/fountainhead/
Other
72 stars 13 forks source link

Lag when switching between large files #19

Open forthrin opened 8 years ago

forthrin commented 8 years ago

When switching to a .fountain file which has several thousand lines (not uncommon for a screenplay), there is a noticeable delay of about a second when switching to the tab containing the screenplay.

Can performance please be improved so switching is instant for any reasonable screenplay length (up to 10.000 lines which corresponds to 3 hours of film.)

derickc commented 8 years ago

Is the problem that you have more than one screenplay open and switching between the two (or more) causes a delay? This is caused by the program scanning for all scenes and characters to create the autocompletions for them. I can look at ways of speeding this up. Currently, there is one file that is overwritten every time a new screenplay is loaded. I did think about creating new files based on screenplay name, but didn't know if people wanted to deal with a growing list of text files that had to be cleaned up. Truthfully, with the size of hard drives now, these text files take up a negligible amount of space.

Is the problem that you only have one screenplay open and when you switch from another Sublime Text file, and switch back to the screenplay there is a delay? This might actually be related to the same issue as above, but I'd have to research it more.

forthrin commented 8 years ago

Yes. The delay happens when I switch from a small plain text file to a .fountain file with thousands of lines. The delay is at least one second, which is quite noticeable and disruptive. Hope you can speed it up. If this will take long to fix, could you quickly add a way of switching autocompletion off? (This sounds like a non-essential feature, if what it does is give the user tab completion on names of characters.)

derickc commented 8 years ago

In the settings section you can turn off character and scene autocompletions. You can also turn off CONT'D.

    "characters": false,
    "scenes": false,
    "contd": false,
forthrin commented 8 years ago

"characters": false seems to remove the delay completely. However, I could still press TAB on a character name like "BI" to complete it to "BILL". But it also completed to "Bicycle", "Bifocal", etc. So maybe this is another completion feature?

derickc commented 8 years ago

You can turn autocomplete off, and also make tab not perform autocompletions and insert a normal tab.

"auto_complete": false,
"tab_completion": false,