Commit Graph

33 Commits

Author SHA1 Message Date
Corey Johnson
c6c762ba23 Double mouse click selects word
The mousedown event on editor is causing this to fail right now.
2012-02-02 14:13:28 -08:00
Corey Johnson
d8975e7a94 SpecHelper has a method for getting pixel points from a row/column 2012-02-02 11:14:50 -08:00
Nathan Sobo
1dd718f896 Can select text with the mouse 2012-01-28 17:00:59 -08:00
Nathan Sobo
3e5cef9672 Cursor can be re-positioned with the mouse 2012-01-28 15:54:01 -08:00
Corey Johnson & Nathan Sobo
dea99216d4 Cursor blinks 2012-01-27 17:33:02 -08:00
Nathan Sobo
5aeef9e58f WIP: Starting on creating a selection with shift-arrows
Introduce Point and Range objects. Selection.selectRight places an
anchor object before moving right if no anchor yet exists. Still no
visual treatment.
2012-01-26 15:45:49 -08:00
Corey Johnson & Nathan Sobo
b4d91f2bc7 Typing inserts a character at the cursor position 2012-01-24 17:19:01 -08:00
Corey Johnson & Nathan Sobo
5ddf4e1a0b Ensure combined scroll margins are smaller than editor height.
This prevents jerky scrolling when the window is very short.
2012-01-23 17:15:11 -08:00
Corey Johnson & Nathan Sobo
1a52890d19 Cursor scrolls editor as it moves 2012-01-23 16:45:00 -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
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
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
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
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
Corey Johnson & Nathan Sobo
1aa99c379f Move GlobalKeymap instance to App. Clear bindings between examples. 2012-01-11 13:16:11 -08:00
Corey Johnson & Nathan Sobo
e58f699681 Remove KeyBinder and CommandMap. 2012-01-11 13:16:11 -08:00
Nathan Sobo
7f4120ce36 Toggle file-finder with a new CSS-style keybinding
Still doesn't hide when the text field is focused because we need to
handle key events that didn't emerge from Ace. That's next.
2012-01-11 13:16:11 -08:00
Corey Johnson & Nathan Sobo
7f3396c125 Rename createKeyEvent to keydownEvent 2012-01-11 13:16:10 -08:00
Nathan Sobo
18e614e88d Start experiment: associate key bindings with CSS selectors
KeyEventHandler holds references to BindingSets. The name "binding set"
is based on the concept of a CSS ruleset. The idea is to choose a key
binding for an event based on what selectors (match / most closely
contain) the event's target DOM node.
2012-01-11 13:16:10 -08:00
Nathan Sobo
6dddb1aa26 RootView.toggleFileFinder scans urls asynchronously. 2012-01-03 16:39:09 -07:00
Nathan Sobo
a1e0039890 Centralize key binding logic in KeyBinder and jQuery.fn.bindKey extension.
This commit removes window.bindKey in favor of binding keys on dom elements. It also refactors pattern parsing in the test helper to use KeyBinder.parseKeyPattern.
2011-12-30 13:19:41 -06:00
Nathan Sobo
5273cb0638 Add $.fn.bindKey, which works on any jquery-wrapped element.
If given a string as an action, it attempts to call a method by that name on the element's view object. If given a function, it calls it directly.
2011-12-30 12:33:55 -06:00
Corey Johnson & Nathan Sobo
e4d73ace25 Bound up / down keys to moveUp / moveDown in fileFinder 2011-12-29 17:38:08 -08:00
Nathan Sobo
a7aa1d2b75 Add jasmine jquery matchers. 2011-12-27 17:42:29 -06:00
Nathan Sobo
ae4fdf8812 Add Native.resetMainMenu and call it in global afterEach
This method removes any AtomMenuItems that aren't marked as 'global'. It ignores menu items that aren't instances of our custom subclass. This is needed by specs to clear any menu items added during tests. It will also be needed when a window loses focus and we want to remove any non-global menus associated with the window.
2011-12-23 12:43:32 -06:00
Corey Johnson
2d6ddcedfd Add window.bindKey which matches a pattern to an action. 2011-12-22 16:24:09 -08:00
Corey Johnson
5ec94fc28c Triggers the event created with window.keydown. 2011-12-19 12:58:35 -08:00
Nathan Sobo
7dcb00f0ec When saving buffer with no url, pop up 'save as' dialog.
Remove a lot of old code.
2011-12-16 16:31:02 -08:00
Nathan Sobo
c75c3555bb Meta+s triggers save on Editor.
Still can't save buffers that don't have a url.
2011-12-16 16:30:51 -08:00