Commit Graph

316 Commits

Author SHA1 Message Date
Nathan Sobo
7be3c55765 Only auto-indent when typing, not when pasting or programmatically inserting
This paves the way for using a different strategy to normalize indentation when pasting, without it getting tangled in auto-indent.
2012-10-23 11:59:54 -06:00
Corey Johnson & Nathan Sobo
e6d541438d Editor uses @command to register command handlers 2012-10-19 12:48:19 -06:00
Corey Johnson & Nathan Sobo
de3bbce29f Only show events w/ descriptions in EventPalette
Also, auto-generate human readable event name in editor. This is a good example of how we could do this automatically for some kind of `onCommand`, `command`, `onInteractiveEvent` method that combines the event name, documentation string, and handler in one shot.
2012-10-19 11:24:40 -06:00
Nathan Sobo
2b8c946a65 Merge branch 'master' into event-palette
Conflicts:
	spec/extensions/fuzzy-finder-spec.coffee
	src/extensions/fuzzy-finder/fuzzy-finder.coffee
2012-10-18 16:33:44 -06:00
Corey Johnson & Nathan Sobo
33b1b66ee4 Merge branch 'invisibles' 2012-10-18 14:44:48 -07:00
Corey Johnson & Nathan Sobo
a72d0399f7 Add Editor.setShowInvisibles and remove showInvisibles from EditSession 2012-10-18 14:10:36 -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 & Nathan Sobo
dd5a10e82e 💄 2012-10-18 11:33:19 -07:00
Corey Johnson
d7bc03112b Empty lines require a special case for invisibles. 2012-10-18 11:33:19 -07:00
Corey Johnson
1ffbff7d99 Fix newline invisible symbol 2012-10-18 11:33:19 -07:00
Corey Johnson
4478bbca9a When project.showInvisibles is true; spaces, tabs and newlines are visible 2012-10-18 11:31:39 -07:00
Corey Johnson
e2a917fcf3 Change tabText to tabLength 2012-10-18 11:31:39 -07:00
Corey Johnson & Nathan Sobo
640e9b6b0d Editor.scrollTop can't be assigned to a negative number.
This was possible when the verticalScrollbar's scrollHeight was smaller than its height.
2012-10-17 18:02:45 -07:00
Chris Wanstrath
f5f18abbf0 ctrl-t: transpose 2012-10-08 20:08:07 -07:00
Nathan Sobo
c09f7ebc60 Fix the command panel's handling of move-up/move-down
Forgot to add the core: prefix to this area
2012-10-05 10:55:55 -10:00
Nathan Sobo
a180e6d703 Merge branch 'master' into event-palette
Conflicts:
	spec/extensions/fuzzy-finder-spec.coffee
	src/app/editor.coffee
	src/extensions/fuzzy-finder/fuzzy-finder.coffee
2012-10-05 10:29:10 -10:00
Nathan Sobo
9906dd41b4 Give editor-specific events the "editor:" prefix 2012-10-05 10:07:37 -10:00
Nathan Sobo
0ab50cf102 Move cut, copy, and paste into "core:" 2012-10-05 10:07:37 -10:00
Nathan Sobo
23f4e533d9 Move undo and redo in "core:" 2012-10-05 10:07:37 -10:00
Nathan Sobo
a2a15a90fd Move backspace and delete into "core:" 2012-10-05 10:07:37 -10:00
Nathan Sobo
8cde98bf45 Move select-to-top/bottom and select-all into "core:" 2012-10-05 10:07:36 -10:00
Nathan Sobo
c221729407 Move "select-up/down/left-right" into "core:" 2012-10-05 10:07:36 -10:00
Nathan Sobo
6061c3e52a Prefix move-to-top/bottom page-up/down with "core:" 2012-10-05 10:07:36 -10:00
Nathan Sobo
67c6ed8de7 Prefix "move-*" events with "core:"
I want to prefix all custom events for better categorization and to
distinguish them from built-in webkit events
2012-10-05 10:07:36 -10:00
Nathan Sobo
0ecdabb023 Pressing enter emits an event on the previously focused element 2012-10-04 10:26:06 -10:00
Nathan Sobo
1b013cc029 Add ability to move through select list and 'event-palette:cancel' event 2012-10-04 10:26:06 -10:00
Kevin Sawicki
282802ac6c Scroll auto complete view with editor window 2012-10-02 12:51:06 -07:00
Kevin Sawicki
b7f32036c2 Change editor-selection-change event name to selection-change 2012-10-01 15:44:58 -07:00
Kevin Sawicki
41cdf130fb Update highlighted line when editor selection changes 2012-10-01 15:44:58 -07:00
Kevin Sawicki
c7361d487f Update cursor line when selection screen range changes 2012-10-01 15:44:58 -07:00
Kevin Sawicki
f2306f444a 💄 2012-10-01 15:44:58 -07:00
Kevin Sawicki
0059accaa4 Access correct editor mini variable 2012-10-01 15:44:58 -07:00
Kevin Sawicki
350e1a22da Add missing space in class name 2012-10-01 15:44:58 -07:00
Kevin Sawicki
e039dab0f6 Don't highlight line in mini editor 2012-10-01 15:44:57 -07:00
Kevin Sawicki
f87b186538 Add highlight to new line html builder 2012-10-01 15:44:57 -07:00
Kevin Sawicki
33abaff747 Don't highlight line if selection is multiline 2012-10-01 15:44:57 -07:00
Kevin Sawicki
d69e08a858 Use screen rows for line highlight 2012-10-01 15:44:57 -07:00
Kevin Sawicki
be8120e8c6 Add initial support for line highlighting 2012-10-01 15:44:56 -07:00
Nathan Sobo
3a8fe2b24e Spans have a class for each dot-separated portion of their token's scope
Previously, we were rendering every prefix of the dot-separated scope as its own class. So the scope meta.delimiter.method.period.coffee would make a token w/ classes:

class="meta, meta-delimiter, meta-delimiter-method, meta-delimiter-method-period…"

Now we just give the token each piece of the scope as a class:

class="meta delimiter method period coffee"

We lose a bit of meaning, in that a scope selector method.period.coffee would match this element in CSS even though it *wouldn't* in TextMate. But we also gain the behavior where longer prefixes are more specific by naturally producing more specific css selectors. So '.meta.delimiter.method' is always more specific than '.meta.delimiter', whereas '.meta-delimiter-method' ties with '.meta-delimiter'. 

If prefix ambiguities become a problem later we may need to revisit this approach, but I think it's good enough for now.
2012-09-28 17:00:31 -06:00
Nathan Sobo
7c9f50209f HTML escape line text 2012-09-28 13:46:15 -06:00
Nathan Sobo
3ebd7cfef1 Output nested spans so that scope selector specificity translates better to CSS
The tokenizer emits individual tokens with arrays of scopes, rather than a more tree-like structure. It's debatable whether we want to emit scope trees rather than token streams in general, though that might complicate things like line wrapping. For now, we're reconstructing the tree during rendering based on information that's implicit in the tokens.
2012-09-28 13:36:43 -06:00
Corey Johnson & Nathan Sobo
bebfaed69b wip: creating token spans 2012-09-28 13:36:43 -06:00
Corey Johnson & Nathan Sobo
875852d1de logCursorScope works properly 2012-09-28 13:36:43 -06:00
Corey Johnson
f95e67d8cd Triple click selects entire line (including \n). Fixes #44 2012-09-26 13:53:51 -07:00
Corey Johnson
282da8b975 Output the syntax scope of the cursor by pressing cmd-alt-p 2012-09-26 13:53:51 -07:00
Nathan Sobo
5f253d78e9 Optimization: Use absolute positioning instead of flexbox in editor
Flexbox was causing layouts and repaints to cover the entire scroll view instead of just the edited line. This cuts down on DOM manipulation cost significantly.
2012-09-25 14:58:31 -06:00
Nathan Sobo
d3df0a305b Use <pre> tag for lines instead of using white-space: pre css property
One less CSS rule, since the whitespace behavior of a `pre` tag is already baked into the browser's default styles.
2012-09-25 13:09:12 -06:00
Kevin Sawicki
b18627ab9b Add delete line support bound to meta-d key 2012-09-19 15:23:10 -07:00
Kevin Sawicki
47ed19f851 Substract scroll top when paging up 2012-09-19 08:52:05 -07:00
Kevin Sawicki
9ba3b74a9d Add support for Page Up and Page Down keys 2012-09-18 19:53:23 -07:00