Commit Graph

607 Commits

Author SHA1 Message Date
Nathan Sobo
50f11f1a4c Remove fixed editor subview from root view. 2012-03-20 16:55:33 -06:00
Nathan Sobo
8ea4b4eb72 File finder opens selected file in the most recent pane.
Only editors inside #root-view #panes are tracked as the most recent active editor. Otherwise the file finder tries to open the selected file in its own mini editor.
2012-03-20 15:51:22 -06:00
Nathan Sobo
965e66ffd4 Focus most-recently active editor pane when file finder closes. 2012-03-20 15:11:34 -06:00
Nathan Sobo
adf8d5df9d Un-f 2012-03-20 13:10:07 -06:00
Nathan Sobo
55efb65500 Merge branch 'master' of github.com:github/atom 2012-03-20 13:09:48 -06:00
Nathan Sobo
4748b4e09b Remove row/columns from split pane layout when they become empty.
This fixes layout issues when closing split panes.
2012-03-20 13:09:35 -06:00
Nathan Sobo
285c04ea62 WIP: Split panes can be closed with meta-w
Still some issues… view gets screwed up after closing panes in certain layout arrangements.
2012-03-20 12:29:47 -06:00
Corey Johnson
99e3074c25 Previously focused element regains focus when file finder is removed 2012-03-20 11:05:57 -07:00
Nathan Sobo
e74f0e66ac Fix specs I broke with CSS changes. 2012-03-19 17:18:48 -06:00
Nathan Sobo
81e5a10ddd Perform vim-style editor pane splitting
Using percentage dimensions to absolutely position the panes on screen where they need to be located. Flexbox would have been nice, but unfortunately I could not work around what seem to be bugs (or at least major inconveniences) in its current implementation.
2012-03-19 16:48:13 -06:00
Nathan Sobo
5b145f64c2 Add vertical splitting. Still some issues with some nested arrangements. 2012-03-19 12:15:37 -06:00
Nathan Sobo
509bac15b6 Cursor is colored / blinks on on focused editor pane 2012-03-19 09:31:03 -06:00
Corey Johnson & Nathan Sobo
1437858241 Implement split-left 2012-03-19 09:22:13 -06:00
Corey Johnson & Nathan Sobo
9bd6751a46 Don't move the cursor on buffer change unless the editor is focused
Add a boolean isFocused flag to editor that is assigned when the hidden input gains / loses focus. This makes it easier in specs because we can treat the editor as if its focused without having to add it to the DOM. It's also a bit more abstract.
2012-03-19 09:04:39 -06:00
Corey Johnson & Nathan Sobo
2903126047 When editor is split, set same cursor position on new editor and focus it. 2012-03-19 08:48:16 -06:00
Corey Johnson & Nathan Sobo
8add398e9c Merge branch 'master' of github.com:github/atom 2012-03-19 08:34:53 -06:00
Corey Johnson & Nathan Sobo
2e42df3401 WIP: alt-meta-right splits editor pane to the right 2012-03-19 08:34:37 -06:00
Corey Johnson & Nathan Sobo
f8b6bf0de6 Folds can end on the penultimate screen line of a wrapped buffer line 2012-03-16 16:26:31 -07:00
Corey Johnson & Nathan Sobo
b31bef4ea0 When updating folds, don't modify the array over which we're iterating 2012-03-16 16:31:52 -06:00
Corey Johnson & Nathan Sobo
67d017f3f4 Fix bug where destroying a fold on last screen line of wrapped line caused an artifact. 2012-03-16 16:11:44 -06:00
Corey Johnson & Nathan Sobo
7336e8313c Folds can be created on the penultimate screen line of a wrapped buffer line 2012-03-16 14:35:07 -07:00
Corey Johnson & Nathan Sobo
45c825e76c Report proper screen ranges on change events for folds created on wrapped lines 2012-03-16 13:33:11 -07:00
Corey Johnson & Nathan Sobo
fd5439f357 Simplify layout and prevent scrollbar flash when toggling file finder. 2012-03-15 17:18:26 -06:00
Nathan Sobo
0efee25ded Cleanup keybindings after app spec. 2012-03-15 16:22:02 -06:00
Nathan Sobo
6bdba313d1 Don't add to the same window to the atom.windows array twice 2012-03-15 16:10:55 -06:00
Nathan Sobo
60056e57fb Use an editor in the file finder instead of an input element. 2012-03-15 13:41:37 -06:00
Corey Johnson
a559e52352 Extract jasmine code into jasmine-helper 2012-03-15 10:46:40 -07:00
Corey Johnson
6b4f3b0386 Use --headless arg to enable console reporter and exit on finish. 2012-03-15 10:24:57 -07:00
Corey Johnson
80641636f9 rake tasks use console reporter 2012-03-15 10:15:06 -07:00
Corey Johnson
ef9673a145 jasmine-atom-reporter doesn't output any console data 2012-03-15 08:55:09 -07:00
Corey Johnson
5c2b8b8ed6 this commit fixes the previous failure 2012-03-14 16:40:44 -07:00
Corey Johnson
8bff0d91f7 this commit should fail 2012-03-14 16:39:48 -07:00
Corey Johnson
154fa2fa92 Editor.save spec removes test files in afterEach method 2012-03-14 14:38:03 -07:00
Corey Johnson
117d9287e0 Allow AtomReporter to output text to console. 2012-03-14 10:48:53 -07:00
Corey Johnson
638c0c625b Rename TrivialReporter AtomReporter 2012-03-14 09:59:31 -07:00
Nathan Sobo
5bf9925d0a Unsubscribe from Buffer when an Editor is removed from the DOM. 2012-03-13 19:20:40 -06:00
Nathan Sobo
eb92966acd Fully unsubscribe from previous buffer when setting a new buffer 2012-03-13 19:05:48 -06:00
Nathan Sobo
5e5a5bdfa5 Add EventEmitter.subscriptionCount 2012-03-13 19:05:24 -06:00
Nathan Sobo
e1283e1788 Add event namespacing to EventEmitter. 2012-03-13 18:17:43 -06:00
Nathan Sobo
da3e1d4553 Every Buffer gets its own UndoManager. 2012-03-13 16:24:12 -06:00
Nathan Sobo
7d2d0f2037 Add a drop shadow to gutter when horizontal scroller is scrolled right. 2012-03-13 16:09:11 -06:00
Nathan Sobo
5709b0d152 Now we can force line wrapping in specs without editor being on the DOM. 2012-03-13 15:56:24 -06:00
Nathan Sobo
06a3f3d376 Fix exception when auto-indenting after fold placeholder.
Propagate state when splitting and concatenating screen line fragments, because we were passing an undefined state to the auto-indenter.
2012-03-13 15:50:43 -06:00
Nathan Sobo
c102711336 💄 2012-03-13 15:33:04 -06:00
Nathan Sobo
826bf6ec61 Editor recalls cursor position and scroll state when a previously edited buffer is re-assigned. 2012-03-13 15:25:20 -06:00
Nathan Sobo
a96e09f6d1 When soft wrap is on, don't position hidden input beyond width of horizontal scroller. 2012-03-13 12:14:08 -06:00
Nathan Sobo
8d432c02c1 Fix bug where text typed into empty buffer was on the wrong line. 2012-03-13 12:12:52 -06:00
Nathan Sobo
fa971d1e75 Render multiple lines in a single fragment 2012-03-12 16:40:14 -06:00
Nathan Sobo
86cc45f4da Add Editor.spliceLineELements 2012-03-12 14:21:00 -06:00
Corey Johnson
8e97fbd5ed document.title is set as the window title 2012-03-09 11:02:08 -08:00
Nathan Sobo
5c23509f90 Use type-explicit copy methods instead of _.clone when we know the type 2012-03-08 19:32:18 -07:00
Corey Johnson & Nathan Sobo
60affb5d55 Defer cursor auto-scrolling until next tick.
Reading the DOM causes a reflow, which slows down character insertion.
2012-03-08 14:04:54 -08:00
Nathan Sobo
07b9b42360 Only append a non-breaking space if a line contains no normal characters 2012-03-08 12:59:38 -07:00
Nathan Sobo
6d303aad18 Add a horizontal-scroller to address selection issues when scrolled right
The lines element is now display: table and contained inside of the
scroller. This means the lines element always expands to contain all
lines, which allows absolute positioning inside of it to be relative to
the entire scroll contents, not just to the currently visible area.
2012-03-08 11:23:05 -07:00
Corey Johnson
423a4dc17d Ensure editor and cursor methods explain if they act on buffer or screen lines 2012-03-07 16:23:23 -08:00
Nathan Sobo
8e4a6f65f7 Translate clicks to screen positions correctly when lines are scrolled right 2012-03-07 17:22:13 -07:00
Nathan Sobo
acb6c94ebb Make cursor and selection children of editor.lines to fix positioning when scrolled 2012-03-07 17:10:24 -07:00
Corey Johnson
ac77b7af87 Outdent and indent use bufferRow and screenRow in the appropriate places 2012-03-07 15:22:41 -08:00
Nathan Sobo
65920fdc25 Rename GlobalKeymap to Keymap 2012-03-07 14:45:26 -07:00
Nathan Sobo
62319113c1 Meta-w closes specs window 2012-03-07 14:27:21 -07:00
Corey Johnson
f6414c543c Add save command and keyboard shortcuts to editor. 2012-03-07 12:43:29 -08:00
Corey Johnson
fabe8fd609 Update test to use meta-/ instead of meta-s 2012-03-07 12:43:09 -08:00
Corey Johnson
c258c2847e Fix bug introduced when I resolved a conflict resolution. 2012-03-07 11:42:39 -08:00
Corey Johnson
29c697faaa Disable auto-scroll and make overflow-x hidden when soft-wrap is enabled 2012-03-07 11:29:33 -08:00
Nathan Sobo
461dd5cd37 Gutter renders correctly with line wrapping and folds 2012-03-07 12:19:30 -07:00
Nathan Sobo
20deb80d9f Give specs window a keymap with the default bindings 2012-03-07 11:04:41 -07:00
Nathan Sobo
43653d7f03 Merge remote-tracking branch 'origin/master' into gutter
Conflicts:
	src/atom/highlighter.coffee
2012-03-07 10:42:21 -07:00
Nathan Sobo
47ee8d599d Rename input/output to buffer/screen in LineMap
Now that we don't have two translation steps, it's not a lie to refer
to the coordinate spaces being translated by the line map as buffer and
screen
2012-03-06 19:20:28 -07:00
Nathan Sobo
da6a708b46 Remove LineWrapper and LineFolder
They are supplanted by Renderer
2012-03-06 19:16:50 -07:00
Nathan Sobo
55a5f1b30e Install Renderer in Editor instead of LineWrapper & LineFolder 2012-03-06 19:15:13 -07:00
Nathan Sobo
a5b4c0af2f Add Renderer.clipScreenPosition 2012-03-06 18:27:24 -07:00
Nathan Sobo
fbd4b7e990 Renderer can place a fold placeholder directly before a soft-wrap 2012-03-06 18:27:06 -07:00
Corey Johnson
0703578820 autoIndent is enabled by default. 2012-03-06 16:34:59 -08:00
Corey Johnson
0737529f07 Auto-outdent maintains proper cursor positon. 2012-03-06 16:34:43 -08:00
Corey Johnson
a1a5d9ac75 Add additional auto-indent test 2012-03-06 15:34:39 -08:00
Nathan Sobo
cb23fdbf92 Add spec for position translation with folds + line wrapping 2012-03-06 15:51:04 -07:00
Nathan Sobo
7e4aae7b4f Add position translation methods to Renderer 2012-03-06 15:33:29 -07:00
Nathan Sobo
8b7638998c Add spec for a fold causing a line to unwrap 2012-03-06 15:13:51 -07:00
Corey Johnson
668022fb3b Outdent works with Ace's Mode classes 2012-03-06 11:14:50 -08:00
Nathan Sobo
03d5509cca Renderer handles buffer change events for wrapping & folding 2012-03-06 12:11:21 -07:00
Nathan Sobo
c61510ce99 Ensure line wrapping interacts cleanly with folding 2012-03-05 19:15:03 -07:00
Nathan Sobo
ed13a27821 Add specs for more fold corner cases. 2012-03-05 17:46:55 -07:00
Nathan Sobo
59bcb27079 WIP: Start handling nested folds. 2012-03-05 17:29:12 -07:00
Nathan Sobo
d02817af21 Add spec for single-line folds 2012-03-05 17:09:03 -07:00
Nathan Sobo
764c827134 WIP: Add fold handling to renderer… still needs refinement. 2012-03-05 17:03:06 -07:00
Corey Johnson & Nathan Sobo
53fc625534 Inserting a newline indents the cursor (based on information from previous line) 2012-03-05 15:51:56 -08:00
Nathan Sobo
955bb383dd WIP: Start on Renderer, which combines LineWrapper and LineFolder 2012-03-05 16:07:22 -07:00
Nathan Sobo
fc7a13ce05 Rename Buffer.getLine to lineForRow 2012-03-05 16:06:27 -07:00
Nathan Sobo
95db96b238 Selection rendering accounts for the presence of gutter 2012-03-05 11:17:46 -07:00
Corey Johnson & Nathan Sobo
5a4f4955b2 Set LineWrapper.maxLength based on lines width, not editor with.
Because there's a gutter now that doesn't count.
2012-03-02 17:09:45 -08:00
Corey Johnson & Nathan Sobo
e7f7e121f7 Gutter updates line numbers when buffer lines are inserted/removed 2012-03-02 16:24:03 -08:00
Corey Johnson & Nathan Sobo
696948cc9b Gutter is renders line numbers when buffer is assigned. 2012-03-02 16:13:29 -08:00
Corey Johnson & Nathan Sobo
b3c4fd5cce Add a nonfunctional gutter to editor layout. 2012-03-02 15:42:04 -08:00
Nathan Sobo
98defa865c Cursor screen position is updated when lines are rewrapped. 2012-03-01 18:00:41 -07:00
Nathan Sobo
697ad6570f Don't make assumptions about the character width in specs 2012-03-01 17:31:53 -07:00
Corey Johnson & Nathan Sobo
ebca007ca4 Merge branch 'chrome' 2012-03-01 16:24:01 -08:00
Corey Johnson & Nathan Sobo
f894f11e5f remove references to native 2012-03-01 16:22:05 -08:00
Corey Johnson
e874512284 Move atom.native to $native 2012-03-01 15:44:36 -08:00
Nathan Sobo
c218a10b6b Don't split a fold placeholder when line wrapping. 2012-03-01 16:38:38 -07:00
Nathan Sobo
c2b16ffbf9 Don't raise an exception when folding an empty range 2012-03-01 13:04:32 -07:00
Nathan Sobo
eeae6c4ee2 Corretly select word and line w/ mouse with wraps and folds 2012-03-01 12:44:26 -07:00
Nathan Sobo
eaf76798ae Eliminate weird behavior with wrapping + folding 2012-03-01 11:52:37 -07:00
Nathan Sobo
eb0df2f21d Fix bug in LineMap.spliceByDelta with multi-fragment screen lines
If the row following a row being replaced had multiple fragments, some
of these fragments would be accidentally deleted.
2012-03-01 11:52:27 -07:00
Nathan Sobo
32a6a2cd7f Refer to "buffer" and "screen" coordinate spaces as "input" and "output"
Since we compose the line wrapper and the line folder together, the
line map is not always translating between screen and buffer coordinate
spaces. It's translating one step in the chain, with output closer to
the screen and input closer to the buffer.
2012-02-29 18:39:45 -07:00
Nathan Sobo
f394716508 Implement clipScreenPosition in terms of translatePosition 2012-02-29 16:47:56 -07:00
Corey Johnson & Nathan Sobo
ffeaf7ed17 Remove menu code and tests 2012-02-29 13:47:48 -08:00
Corey Johnson & Nathan Sobo
bce834aea0 Chrome has a different default charWidth 2012-02-29 13:27:12 -08:00
Nathan Sobo
78c2ff7801 Express LineMap insertion in terms of spliceByDelta 2012-02-29 13:57:57 -07:00
Corey Johnson & Nathan Sobo
632a2cb64a Stop listening or trigger events from App
It causes DOM errors when you reload.
2012-02-29 12:04:41 -08:00
Corey Johnson & Nathan Sobo
be463abe42 Move keymap from app to window 2012-02-29 11:33:15 -08:00
Nathan Sobo
634b90d17a Remove unused eagerWrap option from position translation 2012-02-29 12:19:16 -07:00
Nathan Sobo
69531282bf Remove ability to pass single fragments to LineMap.insertAtBufferRow 2012-02-29 12:00:36 -07:00
Nathan Sobo
7f13f9b946 Folds can start at the same position as their nested folds 2012-02-29 11:47:55 -07:00
Nathan Sobo
20dff5e79d Can start folds earlier on the same line as other folds. 2012-02-29 11:41:53 -07:00
Nathan Sobo
0510989e1c 💄 2012-02-28 22:46:32 -07:00
Nathan Sobo
f785b6168d Correctly handle folds that end at the start of a line
The falsyness of 0 was again biting us
2012-02-28 22:46:26 -07:00
Nathan Sobo
adea60dd4d Folds starting on the first line of the buffer can be unfolded 2012-02-28 22:36:29 -07:00
Nathan Sobo
156cfabbf1 LineMap.spliceScreenRow can replace multiple fragments at row 0
Subtle bug where the falsiness of 0 was causing line fragments on the
0th row to be skipped
2012-02-28 22:36:12 -07:00
Nathan Sobo
478971f18f Folds containing nested folds can be unfolded
There are still problems with nested folds that start on the same line.
2012-02-28 22:10:52 -07:00
Nathan Sobo
cf850b8e7e Move the cursor to start of folded range on unfold 2012-02-28 19:53:02 -07:00
Nathan Sobo
17e78f41ae Clicking a fold placeholder removes the associated fold
There are some problems with nested folds that still need to be ironed
out.
2012-02-28 19:46:41 -07:00
Nathan Sobo
da53eeb80d Folds can start at the beginning of a line 2012-02-28 19:02:26 -07:00
Corey Johnson & Nathan Sobo
c84320b536 window-bootstrap is called when a file is opened. 2012-02-28 17:24:58 -08:00
Corey Johnson & Nathan Sobo
4b8bf90a20 Merge remote-tracking branch 'origin/folding' into chrome 2012-02-28 16:07:35 -08:00
Corey Johnson & Nathan Sobo
b37b45b4b1 atom variable holds all global state and is shared across contexts. 2012-02-28 13:14:35 -08:00
Nathan Sobo
65c7a6126e Style the fold placeholder. 2012-02-28 12:27:35 -07:00
Corey Johnson & Nathan Sobo
6e46b97a5c Cursor moves correctly between wrapped lines
Added explicit options for controlling line wrapping, and skipping of
atomic tokens to the LineWrap.clipScreenPosition. These are used when
moving right to wrap to the next line.
2012-02-27 16:56:02 -07:00
Corey Johnson
e689d78231 Merge branch 'master' into chrome 2012-02-27 14:09:24 -08:00
Corey Johnson
0845fc15c8 Ignore menu items for now. 2012-02-27 13:57:52 -08:00
Corey Johnson
71cab248cf rename listFiles to list 2012-02-27 13:42:54 -08:00
Nathan Sobo
f2f401e5a1 Rely on clipScreenPosition in vertical movement methods
Before, we were manually clipping the position of the cursor in
vertical movement methods. Now we can just increment / decrement the
row and the position will be clipped when it is assigned.

Also, changed the definition of clip screen position to always 0 out
the column when the row is negative.
2012-02-27 13:16:21 -07:00
Nathan Sobo
f24a045e11 Cursor can move to last row when lines are wrapped 2012-02-27 13:07:59 -07:00
Nathan Sobo
22305f350f Skip fold placeholders when moving right
This relies on a new `eagerWrap` option to clipScreenPosition which
will wrap positions inside of atomic line fragments (which is what fold
placeholders are) to the end of the fragment rather than the beginning.
It also wraps positions beyond the end of a hard line to the next line,
which means Cursor.moveRight just has to increment the column, then
call clipPosition with eager wrap set to true to get all the correct
behavior.
2012-02-27 12:45:26 -07:00
Corey Johnson
8cbf4331e4 Remove references to OSX from fs.coffee and make fs specs pass. 2012-02-27 11:38:25 -08:00
Nathan Sobo
c2cba8bdcd Add failing spec for rightward movement over folds. 2012-02-27 11:22:20 -07:00
Nathan Sobo
8e107359f3 Changes correctly update cursor position when there are folds 2012-02-24 22:08:34 -07:00
Nathan Sobo
0bc510ab58 Properly translate positions when wrapper and folder are composed
The key was in LineMap.linesForScreenRows. For each screen line, it
concatenates all line fragments (if there are indeed more than 1) that
traverse that line to return a single line fragment representing the
line. The key was to update the buffer delta for that fragment to
always be 1,0. Because the wrapper is treating the folder as if it's
the buffer, the lines it stores in its map need to traverse only a
single "buffer" line (that's a single line after folds are taken into
account). We may need better language than "screen" and "buffer"
because the wrapper treats the folder as the "buffer" but that's
confusing because it isn't.
2012-02-24 21:56:18 -07:00
Nathan Sobo
17205cae3f WIP: Working on position translation. Pretty broken right now.
The layered relationship between the line wrapper and the folder is
still not quite ironed out yet. The editor behaves pretty erratically
when text is folded.
2012-02-24 21:05:49 -07:00
Nathan Sobo
33ff32f9a4 Add clipScreenPosition to LineFolder & LineMap 2012-02-24 15:35:28 -07:00
Nathan Sobo
b8ef7685de LineWrapper translates positions correctly with respect to folding. 2012-02-24 14:20:06 -07:00
Nathan Sobo
63be776837 LineFolder emits 'fold' and 'unfold' events 2012-02-24 14:18:55 -07:00
Nathan Sobo
c8c7033550 Rename Cursor.set/getPosition to set/getScreenPosition
Now that buffer positions don't always line up with screen positions, it's important that it's clear which one we're talking about.
2012-02-24 11:53:18 -07:00
Nathan Sobo
dfcf4a1629 Alt-meta-f folds the current selection 2012-02-24 11:30:32 -07:00
Nathan Sobo
0bdc45037f Install the LineFolder into the editor
LineWrapper now takes a LineFolder instead of a Highlighter. It's a
cascade of processing steps.
2012-02-23 22:19:42 -07:00
Nathan Sobo
8eed1a4c94 💄 2012-02-23 22:18:27 -07:00
Nathan Sobo
c0d0768df8 A change to a range surrounding a fold removes the fold 2012-02-23 22:12:21 -07:00
Nathan Sobo
422df7989a Handle changes inside of folds.
Don't emit an event since nothing changes (since it's all folded). But update the position of the fold's end marker so when it's unfolded, things render correctly.
2012-02-23 17:28:55 -07:00
Nathan Sobo
de5eab13d2 Insertions at beginning/end of a fold are considered to be outside it.
Also added a spec where text is changed on a line in between two
placeholders and handled correctly.
2012-02-23 17:08:54 -07:00
Nathan Sobo
d229585cd4 Handle changes to unfolded text directly preceding a fold placeholder 2012-02-23 16:32:57 -07:00
Nathan Sobo
16a2fd0bb3 WIP: Start handling buffer updates w/ LineFolder
Still a ways to go here, but folds are moved correctly when there are
buffer updates. Many unfinished specs.
2012-02-23 16:12:22 -07:00