Commit Graph

996 Commits

Author SHA1 Message Date
Danny Greg & Nathan Sobo
616a47d9dc Render cursor's   with a raw call 2012-01-19 17:03:17 -08:00
Danny Greg & Nathan Sobo
81c2faf529 Merge branch 'master' into editor 2012-01-19 16:49:48 -08:00
Danny Greg & Nathan Sobo
fe582d7cd7 Proxy raw from template to builder. 2012-01-19 16:49:42 -08:00
Danny Greg & Nathan Sobo
7d0c5ff2f0 Merge branch 'master' into editor 2012-01-19 16:47:12 -08:00
Danny Greg & Nathan Sobo
5e41f82985 Add a raw call to builder. 2012-01-19 16:46:32 -08:00
Danny Greg & Nathan Sobo
597e4c54b2 Merge branch 'master' into editor 2012-01-19 16:37:58 -08:00
Danny Greg & Nathan Sobo
660beb9f65 Text inside of tags is HTML escaped. 2012-01-19 16:36:32 -08:00
Danny Greg & Nathan Sobo
030e241c75 Don't spill out of document when moving right and left 2012-01-19 15:40:26 -08:00
Danny Greg & Nathan Sobo
a606fe55b3 Keep cursor inside the lines when moving. 2012-01-19 14:39:16 -08:00
Danny Greg & Nathan Sobo
cd127c009e Cursor can move around screen
Still not handling corner cases like moving off the edge of screen,
line, etc.
2012-01-17 18:13:50 -08:00
Nathan Sobo
5198a88cce Half-baked: Have a lines reasonably looking cursor working.
A bunch of tests are failing but you can load a buffer and display its
lines.
2012-01-16 22:11:38 -08:00
Nathan Sobo
4274ff4a81 Merge branch 'master' into editor 2012-01-16 21:28:31 -08:00
Nathan Sobo
ba2ed50e87 Also trigger 'attach' on subviews when parent view is attached. 2012-01-16 21:28:18 -08:00
Nathan Sobo
a051e452ea Merge branch 'master' into editor 2012-01-16 21:17:51 -08:00
Nathan Sobo
5dbdd92e6c When views are attached to dom, trigger 'attach' events
Added this mechanism by augmenting jQuery dom mutation methods. It will
only trigger an event if the element has a truthy value for the
'triggerAttach' data entry. This will allow us to execute actions that
require the view to be physically on the dom at the appropriate time.
2012-01-16 21:15:57 -08:00
Nathan Sobo
bde3a9f5f5 Use requireStylesheet for editor stylesheet. 2012-01-16 20:17:07 -08:00
Nathan Sobo
1a16a755b4 Merge branch 'master' into editor
Conflicts:
	spec/spec-helper.coffee
2012-01-16 20:04:50 -08:00
Nathan Sobo
f4aa8daa52 Add window.requireStylesheet
This allows you to synchronously load a stylesheet into the document's
head whenever it is needed.
2012-01-16 20:03:48 -08:00
Nathan Sobo
7d7b119927 WIP 2012-01-16 19:23:27 -08:00
Nathan Sobo
07a51fb310 Displaying lines and a basic cursor 2012-01-16 17:17:36 -08:00
Nathan Sobo
30faf9b043 Make @editor instance var on motions, commands & operators
We were passing it around all over the place. Now access to the editor
can always be assumed.
2012-01-14 08:28:34 -08:00
Nathan Sobo
1c12773a7a Split vim-mode objects into motions, commands, & operators 2012-01-14 08:22:11 -08:00
Nathan Sobo
532cc83681 Refactor dd to push a SelectLine operation on top of Delete
Delete expects to compose with a motion, which selects the text to be
deleted. SelectLine slots in cleanly to make dd delete the current line.
2012-01-14 00:46:45 -08:00
Nathan Sobo
83cfe70962 Rename Editor.get/setCursor to get/setPosition
This makes it more consistent with selectoToPosition. Also... you
weren't getting the cursor. The cursor is a thing on the screen. At the
very least getCursor should return an object you can move around, not
just a row/column struct. Position seems like a better name.
2012-01-14 00:36:15 -08:00
Nathan Sobo
d1869516fd Implement d3w
NumericPrefix now has a .select() method that calls select multiple
times on its operand. Editor.selectToPosition modified to extend
existing selections, and only create a new one if needed. This allows
repetition of a motion's select method to expand the selection.
2012-01-14 00:31:11 -08:00
Nathan Sobo
91cc9cc9a4 Implement dw (delete to beginning of next word)
The w motion has a .select() method. When d composes with a motion it
calls select() on it and then deletes the selected text.
2012-01-14 00:10:34 -08:00
Nathan Sobo
d94d387101 Cover other next word cases.
Now it moves to words on the next line and also to the next empty line.
2012-01-13 19:47:09 -08:00
Nathan Sobo
1809ba4ef1 💄 2012-01-13 19:18:13 -08:00
Nathan Sobo
7546ddc8cc 'w' moves to next word (not fully functional for multi-line) 2012-01-13 19:18:13 -08:00
Corey Johnson & Nathan Sobo
b2648723de dd deletes an entire line 2012-01-13 17:38:33 -08:00
Nathan Sobo
712475569d Can enter multi-digit numeric prefixes in command mode. 2012-01-13 14:49:25 -08:00
Nathan Sobo
b4886bb6d6 In vim command-mode, only eat insertion keys, not other modifiers 2012-01-13 14:23:58 -08:00
Nathan Sobo
a7e8246de0 Refactor handling of numeric prefixes
Match prefix keys by doing a regex match against the keystroke string
in the vim mode catch all binding.
2012-01-13 14:19:44 -08:00
Nathan Sobo
13d7f93dd9 GlobalKeyMap adds a 'keystroke' string to events
The keystroke is a string representation of the event... like
"alt-ctrl-x" or "q"
2012-01-13 14:03:22 -08:00
Nathan Sobo
aa49ab82fe Merge branch 'master' of github.com:probablycorey/Atomicity 2012-01-13 13:05:14 -08:00
Corey Johnson & Nathan Sobo
649415d20a more 💄 2012-01-13 12:34:25 -08:00
Corey Johnson & Nathan Sobo
fd48c67bfa Add App.bindKey 2012-01-13 12:06:52 -08:00
Corey Johnson & Nathan Sobo
9ea7663256 super 💄 2012-01-13 11:56:34 -08:00
Corey Johnson & Nathan Sobo
ca2b7c9fd1 Add MoveUp command to VimMode 2012-01-13 10:57:08 -08:00
Corey Johnson & Nathan Sobo
257ae7f67d Rename navigateLeft to moveLeft 2012-01-13 10:46:33 -08:00
Corey Johnson & Nathan Sobo
d3d832a740 Add h (move left) monvment to vimMode. 2012-01-13 10:44:51 -08:00
Nathan Sobo
2fc3c5b58c 💄 2012-01-12 18:00:16 -08:00
Nathan Sobo
86d7a91dcd 💄 2012-01-12 17:56:49 -08:00
Nathan Sobo
a2cf77892d Don't insert characters in vim command mode
GlobalKeymap.bindKey can take a selector and a custom function that
maps key events to commands. If it returns false, no command is
triggered but event propagation is halted.
2012-01-12 17:51:23 -08:00
Nathan Sobo
ee068a4b84 GlobalKeymap favor most recently declared bindings in case of tie
Just like in CSS, when multiple equally-specific selectors match an
element, we favor the most recently declared one, so keybindings
cascade.
2012-01-12 16:35:10 -08:00
Nathan Sobo
5951d6e5af Summit talk outline 2012-01-12 16:03:31 -08:00
Nathan Sobo
2c2423f985 Single-digit numeric prefixes can repeat commands in vim-mode
Vim mode has an operator stack. Every time an operator is pushed to the
stack, we ask if it is complete. If it's complete, we compose it with
the operator below it, then pop that operator if its complete. When no
operators remain on the stack, we call execute the final composed
operator. So far we only have DeleteChar (x) and NumericPrefix
operators.
2012-01-11 22:02:47 -08:00
Nathan Sobo
671d862441 💄 2012-01-11 20:21:38 -08:00
Corey Johnson & Nathan Sobo
8471270add Vim mode supports command mode and insert mode with i, esc, and x bindings 2012-01-11 15:00:40 -08:00
Corey Johnson & Nathan Sobo
17ad7a26e7 Ensure focus returns to the editor when file finder closes.
We just capture focusout events on root view… if anything other than the editors text area lost focus, we focus the editor again. This will likely need refinement when we add more widgets to the system, but its enough to make the fuzzy finder behave appropriately.
2012-01-11 13:16:11 -08:00