tweecode/twine — pull request #128 by greyelf (2014-02-12 03:32:41+00:00)
Title: Tweelexer and external passages

Story Authors use the StoryIncludes feature to get around the Twine GUI's problem of displaying TWS files containing a large number of Passages.
A side-effect of doing this is that the TweeLexer incorrectly marks any links to these external passages as broken / non-existing.

This patch parses the TWS/TS/TXT files referenced within StoryIncludes, stores the passage names found within these files and uses this set when searching to see if a passage title exists.

It does the following:
- Populate externalPassages set using existing buildIncludes method.
- Lexer highlights link to found external passage as good.
- Remove found external passages from broken links list.
- Dont show broken link emblem if all internal and external passages found.

NOTE:
- Currently the user has to use one of the build menu items ("Build Story" or "Rebuild Story") to populate the set, after which the UI will correctly handle links to external passages. This could be changed to happen when a TWS file is initially opened.
- The set of externalPassages is NOT persisted within the story pickle.
- A StoryPanel.paint call is required to update all the resolved broken link emblems, which this code does NOT currently do because I don't know the ramification. Clicking on an individual passage widget will update it.