Commit Graph

2498 Commits

Author SHA1 Message Date
Kevin Sawicki & Nathan Sobo
0d6d89b209 Fix cursor autoscrolling when position doesn't change
When assigning the cursor's position, if we decide we want to autoscroll,
we should do so even if the cursor's position doesn't change.

The previous approach relied on a comparison of the position being
assigned, but this is before it has been clipped. Now we rely on a
boolean return value from the marker position assignment methods, which
tells us if the position has changed. If not, we need to emit our own
event to force autoscrolling.
2013-02-05 16:37:54 -07:00
Kevin Sawicki & Nathan Sobo
75e040b73b Merge remote-tracking branch 'origin/dev' into markers
Conflicts:
	src/app/editor.coffee
2013-02-05 16:07:05 -07:00
Kevin Sawicki & Nathan Sobo
3dab8e92ee Convert snippets to use markers instead of anchor ranges 2013-02-05 15:54:41 -07:00
Kevin Sawicki & Nathan Sobo
94d1edcc06 Add EditSession.selectMarker 2013-02-05 15:54:20 -07:00
Kevin Sawicki & Nathan Sobo
c893f0c338 Add Buffer.markersForPosition and coerce marker ids to strings 2013-02-05 15:50:54 -07:00
Kevin Sawicki & Nathan Sobo
240e893d33 Don't emit a cursor-moved event when only the tail of the marker moves 2013-02-05 15:19:10 -07:00
Kevin Sawicki
3e84e9886c Break out event handler setup into separate method
This mirrors the keymap setup method and allows specs
to reattach handlers after calling shutdown()
2013-02-05 13:17:53 -08:00
Kevin Sawicki
17825edf66 Use off() instead of unbind()
unbind() is so pre-jQuery 1.7
2013-02-05 13:13:01 -08:00
Nathan Sobo
1d30605f7f Convert selection and cursor fully over to markers. 2013-02-05 13:39:00 -07:00
Kevin Sawicki
8de45ccc21 Bind meta-D to duplicate line below
Refs #134
2013-02-05 12:16:50 -08:00
Kevin Sawicki
ad3c18077c Compare against EOF position when clipping
Previously the column could potentially be set to
zero since a Math.min comparison was used for the
length of an already adjusted row.
2013-02-05 12:08:17 -08:00
Kevin Sawicki
1b2c7faed9 Bind ctrl-meta-f to toggle full screen
Refs #134
2013-02-05 09:36:38 -08:00
Justin Palmer
dd7835faf4 merge dev, fix conflicts 2013-02-05 08:18:59 -08:00
Nathan Sobo
afe0a6570a Reduce observation to single observeMarker method on display buffer
It will call the observer callbacks with the buffer and screen positions
of the head and tell each time any of these values is changed.
2013-02-04 21:24:06 -07:00
Nathan Sobo
58450d6a65 Give Buffer only a single observeMarker method
It will fire the callback whenever the marker's head or tail position
changes, and it's up to the subscriber to use the information how they
want to.
2013-02-04 20:35:30 -07:00
Nathan Sobo
852b4c2f8a Merge remote-tracking branch 'origin/dev' into markers 2013-02-04 20:04:01 -07:00
Kevin Sawicki
0270ba3e1c Add bracket matcher that highlights pair
(), {}, and [] pairs are now highlighted when
after or before the cursor
2013-02-04 18:09:20 -08:00
Justin Palmer
022b5fb88c use is-focused for the editor because it needs it's own state independent of the window state 2013-02-04 16:42:46 -08:00
Justin Palmer
f8855ef2e3 the editor has it's own blurred state independent of the window 2013-02-04 16:20:07 -08:00
Justin Palmer
53bf6f5341 tag blurred state instead of focused state 2013-02-04 15:55:14 -08:00
Justin Palmer
7a2a02dacf Merge pull request #227 from github/cut-dat-fat
Reusable styles for common UI elements
2013-02-04 15:39:22 -08:00
Kevin Sawicki
e9747a8f9c Use outer height of item scrolling to item 2013-02-04 14:15:12 -08:00
Kevin Sawicki
25b75b6659 Use fs.resolve instead of fs.resolveExtension 2013-02-04 12:51:04 -08:00
Kevin Sawicki
bd88a0de15 Support CSON config file
Use ~/.atom/config.cson as the new default when no
config file exists.

~/.atom/config.json is still the default if they both
exist.
2013-02-04 12:38:00 -08:00
Nathan Sobo
ead93d0f39 Rename to DisplayBuffer.observeMarkerHeadPosition
When you observe, you get callbacks whenever the screen or buffer
position changes, and you get the new and old position in both 
coordinate types.
2013-02-04 11:32:47 -07:00
Nathan Sobo
44e48d42ea Add Buffer.observeMarkerRange 2013-02-04 11:27:39 -07:00
Justin Palmer
8474caa8d8 move generic status bar styles to main bundle, kill dupe cod 2013-02-04 10:03:52 -08:00
Justin Palmer
3fcb7888cc share fuzzy-finder styles between dark and light 2013-02-04 09:39:55 -08:00
Justin Palmer
e796616921 merge dev, fix conflicts 2013-02-04 09:00:09 -08:00
Justin Palmer
7d00623313 move generic tab styles to main bundle 2013-02-04 08:52:39 -08:00
Justin Palmer
1affefb196 move generic command-panel styles to main bundle 2013-02-04 08:36:27 -08:00
Justin Palmer
4bfd73966d move generic tree-view styles to the main bundle 2013-02-04 08:28:58 -08:00
Justin Palmer
ffa3518cb3 kill grammar-view.css, uses overlay and select list defaults 2013-02-04 08:14:52 -08:00
Justin Palmer
05b1a1a64d move notification.css to main bundle 2013-02-03 14:39:09 -08:00
Justin Palmer
44d4efdc10 move common overlay and popover css to static directory 2013-02-03 14:33:54 -08:00
Jon Rohan
3cf07d29f3 Changing the if-focused event binding to blur. 2013-02-03 09:01:27 -08:00
Nathan Sobo
df4ea9293d Build DisplayBufferMarker object to help track marker screen positions
There are 3 failures, which I think are attributable to the fact that
I'm not emitting events from the when the selection tail changes, and
I'm not emitting redundant events when the head is changed to the
same position it was previously, whereas before I wasn't guarding
against redundant events.
2013-02-02 21:11:42 -07:00
Nathan Sobo
bd96db781e Pass old/new buffer and screen positions to marker position observers
This is needed by the snippets package, which needs to know where the
cursor was previously when it moves to decide whether to cancel the
current snippet.
2013-02-02 18:00:35 -07:00
Nathan Sobo
d144dd4efe Merge branch 'dev' into better-anchors 2013-02-02 17:03:57 -07:00
Nathan Sobo
94f1630152 Bind window focus and focusout events separately to fix spec 2013-02-02 17:02:07 -07:00
Nathan Sobo
abafb541df Merge remote-tracking branch 'origin/dev' into better-anchors 2013-02-02 16:47:09 -07:00
Nathan Sobo
f6ea6a39d9 Remove anchorPoint state from EditSession 2013-02-02 16:46:25 -07:00
Nathan Sobo
80b39ae263 Replace mentions of 'anchor' with 'tail' in selection and its spec 2013-02-02 16:44:13 -07:00
Nathan Sobo
e53403718a Tell marker head observers if a move was caused by a buffer change
This is used by cursor to only autoscroll when the marker head is
explicitly moved, so that passive movements caused by buffer insertions
don't trigger autoscrolling.
2013-02-02 16:17:14 -07:00
Nathan Sobo
bd1a100d17 Always wrap marker screen positions at soft newlines 2013-02-02 15:59:08 -07:00
Nathan Sobo
cb6de5b2a4 Honor autoscroll option when setting a selection's buffer range
If we pass an explicit autoscroll option when selection, we don't want
to autoscroll the cursor. If the option is true, we'll autoscroll to
the middle of the selection. If the option is false, we don't want any
autoscrolling, including to the cursor. The cursor should only autoscroll
when the option is undefined.
2013-02-02 15:17:24 -07:00
Nathan Sobo
4a191586db Ensure we don't try to draw a destroyed selection on editor refresh
Destroying the cursor will cause a redraw, which causes a problem when
we execute it synchronously in specs because destroying the cursor also
destroys the marker associated with the selection. Here we remove the
selection first to avoid this problem.
2013-02-02 15:10:01 -07:00
Nathan Sobo
3d8406f5a3 Clip screen positions before translating to buffer positions 2013-02-02 15:07:17 -07:00
Nathan Sobo
752383651d Don't add bufferChange to DisplayBuffer change events 2013-02-02 15:01:42 -07:00
Nathan Sobo
5e56206fcc This never should have been checked in. 2013-02-02 15:00:54 -07:00