Commit Graph

44 Commits

Author SHA1 Message Date
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
Nathan Sobo
c3e748a17c WIP: Use rake to start compiling resources (like require.coffee) 2012-08-26 16:29:46 -05:00
Nathan Sobo
c2c8724ad0 Initial commit 2012-08-10 13:32:19 -06:00
Corey Johnson & Nathan Sobo
0e1d3fe3a9 wip: fixing capture group problems 2012-08-03 11:38:45 -07:00
Corey Johnson
08a55dfcac wip: IndentationForRow almost works TextMate preferences 2012-08-02 17:02:17 -07:00
Corey Johnson & Nathan Sobo
0a97cb0590 Tokenized buffer uses TextMate grammar 2012-08-02 10:05:09 -07:00
Corey Johnson & Nathan Sobo
b50b8eacca wip: hooking up tokenized buffer to textmate grammars 2012-08-01 17:54:08 -07:00
Nathan Sobo
3516dea210 Introduce LanguageMode wrapper for Ace modes as a foundation of our own modes
LanguageMode is the central point for all language-specific behavior associated with an EditSession. There is one LanguageMode instance per EditSession. LanguageMode has access to the EditSession and its TokenizedBuffer, and in reverse the EditSession, DisplayBuffer, and TokenizedBuffer also make use of LanguageMode. This is a bit incestuous, but I think it's okay because you can think of LanguageMode as a swappable strategy object that governs language-specific aspects of that constellation of objects.
2012-07-27 12:30:06 -06:00
Corey Johnson
5184b90365 Hitting tab on a line (containing only whitespace) will auto indent the line and set the cursor to the end 2012-07-16 10:25:28 -07:00
David Graham & Nathan Sobo
5b8cc8a6b6 Snippets matching the cursor's word prefix are inserted on 'tab' events 2012-06-19 17:47:09 -06:00
Corey Johnson & Nathan Sobo
8d516fe4fe Use a legitimate replace method in AceAdaptor.
Fixes comment toggling in coffeescript, and requires a better implementation of findMatchingBracket in AceAdaptor for outdent to work.
2012-06-15 11:56:09 -07:00
Corey Johnson & Nathan Sobo
291886b4b3 Rename LanguageMode to TokenizedBuffer 2012-06-14 11:02:52 -06:00