Commit Graph

1172 Commits

Author SHA1 Message Date
Corey Johnson
3efcc50a0d Renamed call to ControlPanel.hide to ControlPanel.detach 2012-06-26 16:41:13 -07:00
Corey Johnson
6d69ec77f1 Remove un-needed window.advanceClock calls from editor 2012-06-26 16:41:13 -07:00
Nathan Sobo
65991c686a Snippets can contain placeholder text (but can't nest yet)
Snippet placeholders are managed by adding an "anchor range" to the edit session. An anchor range basically tracks two anchors for the start and the end of the range.
2012-06-26 17:29:32 -06:00
Nathan Sobo
c354f016b9 Ensure tab-stops are correctly placed on indented snippet lines 2012-06-22 23:03:29 -06:00
Nathan Sobo
3483317549 Subsequent lines of a snippet are indented based on the first line 2012-06-22 22:57:49 -06:00
Nathan Sobo
de9486320d Shift-tab moves through snippet tab stops backwards 2012-06-22 22:10:14 -06:00
Nathan Sobo
6389b19b7c Merge branch 'master' into snippets 2012-06-22 16:25:33 -06:00
Nathan Sobo
e2efa95d13 Ensure that 'change-screen-range' events are triggered on selections by backspace 2012-06-22 16:20:50 -06:00
Nathan Sobo
c4046bbdc5 Place snippet tab relative to snippet start position. Terminate when pressing 'tab' at last tab-stop. 2012-06-22 12:52:40 -06:00
Nathan Sobo
5c6e94ec74 Tab stops are associated with anchors so we can jump to them event when the buffer changes 2012-06-22 12:07:20 -06:00
Nathan Sobo
ae2b686802 Parse tab-stop positions correctly when there are multiple on a line 2012-06-22 11:44:58 -06:00
Nathan Sobo
a936b6b716 Tab advances between snippet tab stops. Still need to account for tab stops moving due to buffer changes. 2012-06-21 16:53:13 -06:00
Nathan Sobo
f9ec6214e6 Snippets parser can parse tab stops in the form of $1, $2, etc.
It associates each tab stop with its position relative to the beginning of the snippet body, and strips the '$number' marker from the inserted snippet body.
2012-06-21 16:33:21 -06:00
Nathan Sobo
f1678fdafe Use an overloaded 'tab' keybinding and the new abortKeyBinding method to implement conditional snippet expansion
If the current word prefix doesn't correspond to a valid snippet, we abort the key binding and try the next one, which ends up being the standard tab binding so a typical tab gets inserted. This is a mechanism that could support overloading of arbitrary keys.
2012-06-20 22:47:05 -06:00
Nathan Sobo
e1309f7c66 Key binding event handlers can call abortKeyBinding on the event object to abort and try the next binding 2012-06-20 22:08:16 -06:00
Nathan Sobo
4590321f0a Apply a hybrid approach to handling events in snippets extension 2012-06-20 21:52:53 -06:00
Nathan Sobo
1bec4c8404 Snippets now advise the insertTab method on EditSessions instead of intercepting events on Editor 2012-06-20 17:56:02 -06:00
Nathan Sobo
9c02e05051 Preserve the value of this when applying before advice 2012-06-20 17:55:29 -06:00
Nathan Sobo
a8a1a74b11 Refactor Snippets to a class that creates an instance for each Editor 2012-06-20 17:46:22 -06:00
Nathan Sobo
d50b7f7a37 Trigger a 'new-edit-session' event when Project.prototype.open creates an EditSession 2012-06-20 17:40:45 -06:00
Nathan Sobo
583af86f68 Add _.adviseBefore for adding before advice to methods 2012-06-20 17:34:21 -06:00
Nathan Sobo
4c8aeb16bb Merge branch 'master' into snippets
Conflicts:
	src/app/window.coffee
2012-06-20 17:11:25 -06:00
Nathan Sobo
e3d7ab31b5 Merge branch 'project-refactor' 2012-06-20 16:41:54 -06:00
Nathan Sobo
b4d77fd107 Load user configuration as part of RootView initialization, before any editors are created 2012-06-20 16:06:45 -06:00
Nathan Sobo
dd69abbdfe Add test case for non-matching prefix causing a regular tab to be inserted 2012-06-20 12:20:37 -06:00
David Graham & Nathan Sobo
d992458c8c Load snippets from .atom/snippets when snippets extension is activated 2012-06-20 11:49:29 -06:00
Corey Johnson & Nathan Sobo
af9aec7cbc SoftWrap state is stored in EditSessions, but it is set and toggled via Editor. 2012-06-20 09:28:23 -07:00
Corey Johnson & Nathan Sobo
d1c1f3cfce Move autoIndent, tabText, softTabs and softWrap to project 2012-06-20 09:28:23 -07:00
Corey Johnson & Nathan Sobo
4e78b29e81 Replace Editor.setBuffer with Editor.edit 2012-06-20 09:28:23 -07:00
Corey Johnson & Nathan Sobo
1280370fd1 Editor constructor requires an editSession (unless it is a mini buffer) 2012-06-20 09:28:23 -07:00
Corey Johnson & Nathan Sobo
4659fd7dc3 Project.open returns an editSession instead of a buffer.
First step in removing the coupling of Editor and Buffer. Editor should get all information about the active buffer from the activeEditSession.
2012-06-20 09:28:22 -07:00
David Graham & Nathan Sobo
e4409be95a Parse multiple snippets and allow any characters in snippet body 2012-06-19 17:56:03 -06: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
David Graham & Nathan Sobo
4204b27751 Start on Snippets extension
Can parse a basic snippets file
2012-06-19 17:19:47 -06:00
Nathan Sobo
c21766c328 Add RootView.proto.focusNextPane 2012-06-18 20:27:39 -06:00
Nathan Sobo
171a19369a Fix remaining multi-keystroke specs 2012-06-18 17:31:26 -06:00
Nathan Sobo
85f695e4f1 Ensure that only whole keystrokes are matched in binding prefix matches 2012-06-18 17:31:11 -06:00
Nathan Sobo
5ef5c4565a Merge branch 'master' of github.com:github/atom into multi-keystroke-bindings 2012-06-18 17:06:17 -06:00
Nathan Sobo
d9dec3d974 Add spec confirming that multi-keystroke bindings can match against bindings in multiple binding sets
For example, if you have a very unspecific binding "ctrl-x ctrl-c", you can also have very specific "ctrl-x …" bindings, and bindings from both sets can be matched. A partial match in a more specific does not rule out later matches in a less specific set.
2012-06-18 17:05:52 -06:00
Nathan Sobo
9e5b4beeaa Add spec to confirm that an entering an unmatched keystroke sequence clears the queued keystrokes 2012-06-18 16:53:58 -06:00
Nathan Sobo
ac4aae2cec WIP: Begin introducing multi-keystroke bindings to Keymap 2012-06-18 16:46:39 -06:00
Corey Johnson & Nathan Sobo
c02e5bbdbf Do not allow root view to set a font-size less than 1 2012-06-15 17:30:10 -07:00
Corey Johnson & Nathan Sobo
db69ee5627 Calculate gutter dimensions when editor's dimensions are calculated 2012-06-15 17:30:10 -07:00
Nathan Sobo
d9500e6bcd Atom spec no longer closes all open windows
This makes life easier when you're running the spec suite while actually using atom to edit itself.
2012-06-15 16:24:49 -06:00
Corey Johnson & Nathan Sobo
951f76f2bf Serialize root view state to a string of JSON when storing it on the window upon refresh
This avoid situations where arrays in the window state pointed to a different constructor than the current context's Array constructor.
2012-06-15 15:34:07 -06:00
Nathan Sobo
95622dc64e If the cursor is at any buffer position inside a fold, backspace deletes the folded text 2012-06-15 14:41:05 -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
e38ade2730 Bugfix: Backspace in middle of line below a fold no longer deletes the newline preceding the cursor 2012-06-14 17:08:14 -06:00
Corey Johnson & Nathan Sobo
1dfbaf67d1 Delete at the end of a line above a fold deletes the folded lines (leaving a newline) 2012-06-14 16:58:47 -06:00
Corey Johnson & Nathan Sobo
daa688b1e1 Merge branch 'master' of github.com:github/atom
Conflicts:
	src/app/edit-session.coffee
2012-06-14 16:25:05 -06:00
Corey Johnson & Nathan Sobo
f025bec910 If a selection ends on a fold, backspace/delete delete all lines inside the fold 2012-06-14 15:52:54 -06:00
Corey Johnson & Nathan Sobo
c73eb97d72 💄 2012-06-14 15:41:02 -06:00
Corey Johnson & Nathan Sobo
9ada2daebd If command panel selects text within a fold, the fold is destroyed 2012-06-14 14:00:35 -07:00
Corey Johnson & Nathan Sobo
8416dc3598 DisplayBuffer.destroyFoldsContainingBufferRow destroys all folds containing buffer row (instead of just folds starting at buffer row) 2012-06-14 13:56:08 -07:00
Corey Johnson & Nathan Sobo
6b5a52ae5c Add repeat-relative-address-in-reverse event to command panel 2012-06-14 11:01:28 -07:00
Corey Johnson & Nathan Sobo
bc3f9543be Update search in reverse test on command interpreter spec 2012-06-14 11:00:14 -07:00
Corey Johnson & Nathan Sobo
b6f9801a19 Move repeat-relative-address test from command inter peter spec to command panel spec 2012-06-14 10:35:30 -07:00
Corey Johnson
c98ad2973d Adding '-' in front of a RegexAddress causes it to search in reverse 2012-06-14 10:35:29 -07:00
Corey Johnson & Nathan Sobo
940b7b0e7a RootView.proto.activateExtension requires extensions to have names 2012-06-14 11:20:36 -06:00
Corey Johnson & Nathan Sobo
810b9849ee RootView serialize absorbs exceptions when serializing extensions 2012-06-14 11:20:16 -06:00
Corey Johnson & Nathan Sobo
291886b4b3 Rename LanguageMode to TokenizedBuffer 2012-06-14 11:02:52 -06:00
Nathan Sobo
470f46931f Selection views update properly when selections are merged 2012-06-14 10:28:21 -06:00
Nathan Sobo
47533ad3a0 Add spec coverage for command panel serialization and fix bad method call therein 2012-06-13 21:23:33 -06:00
Nathan Sobo
b59e73edcd Rename Renderer -> DisplayBuffer
The idea is that the DisplayBuffer serves a similar role to the Buffer, except that it's holding content in an arrangement that's optimized for display.
2012-06-13 21:02:30 -06:00
Nathan Sobo
5135f3e066 Editor no longer references Renderer directly 2012-06-13 20:37:30 -06:00
Nathan Sobo
ede9309a80 💄 2012-06-13 20:09:33 -06:00
Nathan Sobo
e385f8051f Merge branch 'master' into language-mode 2012-06-13 19:56:01 -06:00
Corey Johnson
17e20d2fb0 Change .editor to .miniEditor in command panel specs 2012-06-13 17:48:51 -07:00
Nathan Sobo
8769061a0f Merge branch 'master' of github.com:github/atom into language-mode 2012-06-13 18:34:59 -06:00
Nathan Sobo
e444ba193c Merge all ace adaptors into a single AceAdaptor class 2012-06-13 18:31:03 -06:00
Corey Johnson
5d552d3df3 Add comand-panel:set-selection-as-regex-address 2012-06-13 16:54:55 -07:00
Corey Johnson
9c748d14c3 💄 2012-06-13 16:54:55 -07:00
Nathan Sobo
591a294e2e Absorb FoldSuggester into LanguageMode 2012-06-13 15:44:40 -06:00
Nathan Sobo
49e0e2095a Absorb line commenting into LanguageMode 2012-06-13 15:36:35 -06:00
Nathan Sobo
f1397db60b Rename Highlighter -> LanguageMode 2012-06-13 15:21:44 -06:00
Nathan Sobo
c09c672843 Rename screenLineForRow -> lineForScreenRow 2012-06-13 14:40:23 -06:00
Nathan Sobo
f000686f07 Method name 💄 2012-06-13 11:49:01 -06:00
Nathan Sobo
1a1d3b3cf9 EditSession no longer requires a reference to its Editor 2012-06-13 11:18:47 -06:00
Nathan Sobo
4ccf976501 Pass tabText into EditSession explicitly on construction 2012-06-13 11:13:41 -06:00
Nathan Sobo
e5b5f7b886 Absorb cursor-spec into editor-spec 2012-06-13 11:04:17 -06:00
Nathan Sobo
099151eeb2 Eliminate Editor from remaining selection-spec 2012-06-13 10:32:42 -06:00
Nathan Sobo
a6b066ef3d Move specs of fold interactions with backspace/delete/insertText methods to edit-session-spec 2012-06-13 10:32:23 -06:00
Nathan Sobo
b53686ed36 Move selection rendering specs from selection-spec to editor-spec 2012-06-13 10:19:24 -06:00
Corey Johnson & Nathan Sobo
222e12d29d Backspace in column 0 below a fold absorbs line into fold 2012-06-12 16:49:49 -07:00
Corey Johnson & Nathan Sobo
6c8b2e1a54 Use buffer instead of line map for EditSession.clipBufferPosition(position) 2012-06-12 16:49:48 -07:00
Nathan Sobo
51905f245a Move auto-indent/outdent specs from selection-spec to edit-session-spec 2012-06-12 16:31:17 -06:00
Nathan Sobo
33ed6e980e This is tested implicitly everywhere 2012-06-12 16:26:01 -06:00
Nathan Sobo
0e592b0e7a Move selectWord specs to edit-session-spec 2012-06-12 16:25:50 -06:00
Nathan Sobo
b44a0b69a9 Move specs for toggleLineCommentsInSelection to edit-session-spec 2012-06-12 16:22:18 -06:00
Nathan Sobo
426eeb5abe Merge branch 'master' of github.com:github/atom 2012-06-12 16:15:23 -06:00
Nathan Sobo
560db26cf1 Move indent/outdent selection specs to edit-session-spec 2012-06-12 16:15:11 -06:00
Nathan Sobo
67e9faa5d0 Kill redundant specs 2012-06-12 16:14:52 -06:00
Nathan Sobo
cca387b36a Move selectLine specs from selection-spec to edit-session-spec 2012-06-12 16:14:37 -06:00
Corey Johnson
b841a04093 Don't serialize pathless buffer text 2012-06-12 15:12:58 -07:00
Corey Johnson
2ce6276e22 Add fs.exists test 2012-06-12 15:12:58 -07:00
Nathan Sobo
09bfc1db92 Reorganize editor-spec more logically 2012-06-12 15:59:55 -06:00
Nathan Sobo
6317f9526f 💄 2012-06-12 15:49:49 -06:00
Nathan Sobo
3a93887292 Move structural folding to EditSession 2012-06-12 15:49:42 -06:00
Nathan Sobo
6a017ba666 Move all mouse event specs under one describe block 2012-06-12 15:33:25 -06:00
Nathan Sobo
efcc43c296 Merge branch 'master' of github.com:github/atom 2012-06-12 15:21:06 -06:00