Commit Graph

61 Commits

Author SHA1 Message Date
Garen Torikian
31aaa23b20 Update tokenizedbuffers 2013-05-01 17:01:55 -07:00
Garen Torikian
2357f46761 Fix block comments in src 2013-05-01 16:58:43 -07:00
Nathan Sobo
7e0ac1db9c Default TokenizedBuffer options hash to {} 2013-04-25 17:15:27 -06:00
Nathan Sobo
0d78098dbf Make TokenizedBuffer select its own grammar, not LanguageMode
This is part of an effort to disentangle LanguageMode, DisplayBuffer,
and TokenizedBuffer. It should be easy to create a DisplayBuffer
without creating an EditSession… let's get the dependencies flowing
in a single direction.
2013-04-25 15:13:00 -06:00
Corey Johnson & Nathan Sobo
96e91f5fa1 Use correct case when requiring subscriber 2013-04-24 14:15:09 -07:00
Corey Johnson & Nathan Sobo
caed3d39de Revert "Don't tokenize files that have more than 10000 lines"
This was a premature optimization. The real problem is
with the spell-check package.

This reverts commit 987d1da233.
2013-04-23 13:50:02 -07:00
Corey Johnson & Nathan Sobo
693a495618 Use _.spliceWithArray in tokenized buffer 2013-04-23 12:01:16 -07:00
Corey Johnson & Nathan Sobo
987d1da233 Don't tokenize files that have more than 10000 lines 2013-04-23 12:00:57 -07:00
Kevin Sawicki & Nathan Sobo
e50aa56d02 Space separate event names 2013-04-23 08:39:26 -07:00
Kevin Sawicki & Nathan Sobo
b9ad462c69 Retokenize when grammar with matching injection selector is updated 2013-04-23 08:39:26 -07:00
Kevin Sawicki & Nathan Sobo
0d35943386 Retokenize when grammar with matching injection selector is loaded 2013-04-23 08:39:26 -07:00
Kevin Sawicki
eec6518278 Add package to open links on ctrl-O 2013-04-23 08:39:26 -07:00
Nathan Sobo
93910201b0 Re-tokenize buffer when its grammar is updated
This can happen if a grammar that the grammar includes is added or
removed from the syntax global.
2013-04-22 11:34:03 -06:00
Garen Torikian
5ee388cede Get it to a proper 80% 2013-04-18 18:50:22 -07:00
Garen Torikian
8bd02358d2 Should I regret a lack of better commit messages? 2013-04-12 22:35:54 -05:00
Garen Torikian
0c5e38680d Internalize a bunch of methods 2013-04-12 14:37:21 -05:00
Nathan Sobo
ed1c5d3417 Localize grammar reloading / setting to LanguageMode
Previously, logic associated with swapping grammars was a bit
scattered. Now grammar reloading / assignment methods delegate to
LanguageMode directly, and it emits a 'grammar-changed' event when
the grammar changes. Now EditSession and TokenizedBuffer listen for
this event and perform necessary actions for grammar change.
2013-04-03 18:34:53 -06:00
Kevin Sawicki & Nathan Sobo
5da5bf94b6 Add 'editor:save-debug-snapshot' command. Closes #191.
This saves the state of the rendered lines, the display buffer, the
tokenized buffer, and the buffer to a file. If a problem arises with
rendering, hopefully we can use it to diagnose in which layer things
went awry.
2013-02-22 14:28:04 -07:00
Kevin Sawicki & Nathan Sobo
98614592af Store line endings on a per-line basis in Buffer
The line ending for each line is recorded and reused
when lines are modified or inserted.

Closes #166
2013-01-27 16:01:22 -08:00
Kevin Sawicki
3b47c26b4d Change an edit session's grammar on meta-l 2013-01-08 13:17:12 -08:00
Nathan Sobo
0a08d03c68 Rename Buffer, TokenizedBuffer, and Selection events 2013-01-04 13:59:11 -07:00
Kevin Sawicki
9f6d1f987f Add initial support for replacing anchors 2012-12-21 13:22:08 -08:00
Corey Johnson & Nathan Sobo
ab96129ef6 Cleanup TokenizedBuffer 2012-12-11 17:17:06 -08:00
Corey Johnson & Nathan Sobo
dc60017c02 Async-tokenize remaining buffer changes that exceed chunk size 2012-12-11 16:51:05 -08:00
Nathan Sobo
a1ae819908 Only tokenize in background if when a buffer is visible in an editor
This will prevent running a bunch of background tokenization when Atom is reloaded. We only perform tokenization to support content that is actually on screen.
2012-11-23 12:41:08 -07:00
Nathan Sobo
f28cedea7d 💄 2012-11-23 12:09:29 -07:00
Nathan Sobo
f466a2eede Un-F 2012-11-23 10:46:26 -07:00
Nathan Sobo
640bf6dc8d Refactor background tokenization 2012-11-23 10:37:14 -07:00
Nathan Sobo
bcab21709b Handle changes that straddle or are inside of the invalid regions 2012-11-22 11:02:14 -07:00
Nathan Sobo
48f9f70dd2 Handle changes in the valid region of a partially tokenized buffer 2012-11-22 10:07:24 -07:00
Nathan Sobo
0fd921bb40 💄 and update specs for async tokenization of invalidated rows 2012-11-21 18:38:39 -07:00
Nathan Sobo
5acd1b6ee3 When a change invalidates subsequent lines, re-tokenize asynchronously
This can happen when inserting a quote at the top of the file. It switches all the strings to source and vice versa, throughout the file. This can be very laggy, so it's good to do it asynchronously.
2012-11-21 10:02:52 -07:00
Nathan Sobo
e92d9c5c9d Reorganize TokenizedBuffer spec
It's going to have to cover edge cases in the async tokenization, and the previous structure wasn't going to cut it.
2012-11-21 09:09:08 -07:00
Nathan Sobo
5aba8596a9 Make tokenization synchronous in all specs
Disabled some specs that need to make it asynchronous again… will deal with those soon.
2012-11-21 08:22:13 -07:00
Corey Johnson & Nathan Sobo
e52dbb682e WIP: Perform tokenization in chunks when edit session is shown 2012-11-19 16:50:49 -07:00
Corey Johnson & Nathan Sobo
1cc43adddb Break out atomic tokens in ScreenLine instead of TextMateGrammar
This paves the way for creating untokenized screen lines that still have leading whitespace and tab characters broken out appropriately.
2012-11-19 15:44:24 -07:00
Nathan Sobo
61ce3b0f1a Simplify TokenizedBuffer#handleBufferChange for row-oriented events
Only talking about rows, instead of both rows and columns makes everything a lot simpler.
2012-11-16 09:23:36 -07:00
Nathan Sobo
a441ddec7c Make TokenizedBuffer emit row-oriented change events 2012-11-16 08:57:59 -07:00
Corey Johnson & Nathan Sobo
139f5d0b50 EditSession.setTabLength assigns tabLength on the TokenizedBuffer. 2012-11-06 11:35:13 -08:00
Corey Johnson & Nathan Sobo
10090219cb TokenizedBuffer change events reference the precipitating Buffer change event. 2012-11-06 10:56:05 -08:00
Corey Johnson & Nathan Sobo
0e0f747764 TokenizedBuffer.setTabLength retokenizes the entire buffer 2012-11-06 10:44:50 -08:00
Corey Johnson & Nathan Sobo
89ef3f0f20 Build Token objects in TextMateGrammar. Tokenization-related renames. 2012-11-05 16:03:19 -07:00
Nathan Sobo
3d12269315 DisplayBuffer specs passing with greatly simplified LineMap 2012-11-01 07:15:51 -06:00
Corey Johnson
40673549cb Quotes only automatically close if they are opened after a non-word character. 2012-10-29 13:12:28 -07:00
Corey Johnson
1924e92727 Create method getTokenizedBuffer() on language mode
Instead of assigning a tokenizedBuffer property on LanguageMode instances from the TokenizedBuffer constructor.
2012-10-29 11:54:14 -07:00
Corey Johnson
82e0a458fa Do not automatically close quotes when inserted inside a string. 2012-10-29 11:54:13 -07:00
Corey Johnson & Nathan Sobo
ae0a60f4a9 Eliminate unused showInvisibles parameter. 2012-10-18 11:52:51 -07:00
Corey Johnson & Nathan Sobo
b33bbbfc0d Handle invisible character rendering when building HTML for lines.
Not during creation of tokens.
2012-10-18 11:43:17 -07:00
Corey Johnson
22e009a999 Set invisible values for spaces and tabs when initial tokenization occurs.
Also break whitespace into its own token just like tabs.
2012-10-18 11:33:19 -07:00
Corey Johnson
e2a917fcf3 Change tabText to tabLength 2012-10-18 11:31:39 -07:00