Commit Graph

48 Commits

Author SHA1 Message Date
Kevin Sawicki
f868c0cd4f Add line diff decorations to editor gutter
Added, modified, and deleted lines will now highlighted
in the gutter for files already checked in to the repository.
2013-04-10 12:17:01 -07:00
probablycorey
d3920cdc05 Click and drag on the gutter selects lines correctly
Closes #352
2013-03-29 17:58:27 -07:00
Corey Johnson
ec4bb162c3 Add editor.showLineNumbers config option
Also adds toggle-line-numbers command. Closes #377
2013-03-25 10:38:06 -07:00
Kevin Sawicki & Nathan Sobo
e23edd02fd Use flexbox to position editor's gutter and scroll view
This removes the need to compute the width of the gutter based
on the line count in the editor and also removes the need to
set the scroll view's left position manually.
2013-03-22 12:47:56 -07:00
Kevin Sawicki
8b7e3c1092 Remove unused imports 2013-03-04 21:43:35 -08:00
Kevin Sawicki
d27bbee37d Support selecting editor lines from the gutter
Mouse events that occur in the gutter are forwarded to the
rendered lines with the y-coordinate translated to be the
leftmost pixel of the editor to simulate the event originating
from column 0 of the current line row.

Closes #287
2013-02-19 18:16:29 -08:00
Kevin Sawicki
8dbcefa932 Style color of folded line numbers 2013-01-30 11:50:23 -08:00
Kevin Sawicki
7e95bf96a5 Don't highlight ending line if it ends at column 0 2013-01-05 19:45:45 -08:00
Nathan Sobo
1762ae2744 Rename 'selection-change' to 'selection:changed' 2013-01-04 13:48:49 -07:00
Nathan Sobo
f4f3002e6d Rename Cursor and CursorView events to passive-voice scheme
Any events emitted from DOM nodes should be prefixed with an identifier
for the node that emits them. This eliminates the possibility of ambiguity
when the events bubble up the DOM away from their emitter.
2013-01-02 13:48:11 -07:00
Kevin Sawicki
ff3b04e01e Support clicking line numbers in gutter
Clicking moves the cursor to the start of the
row and shift-clicking selects to the start of
the row
2012-12-22 23:40:23 -08:00
Kevin Sawicki
b59bd7a099 Check selection being empty before comparing highlighted rows 2012-12-22 22:16:38 -08:00
Kevin Sawicki
905002cd58 Highlight foreground of selected line numbers
Previously no gutter highlight was displayed unless
the selection was empty.

Now there is a separate CSS class for no selection
that changes the background color independently
from the foreground color.
2012-12-22 22:06:46 -08:00
Nathan Sobo
4684bc5942 Redraw gutter when switching to a shorter buffer
This ensures that we don't leave too many line numbers on the screen for the current file.
2012-12-04 13:25:13 -07:00
Nathan Sobo
3eeb4435a5 Re-render the gutter on changes if the screen or buffer delta are != 0
Basically, we don't re-render the gutter for single-line edits. Every other kind of change does re-render it however.
2012-11-14 13:13:23 -07:00
Nathan Sobo
b686d89d18 Fix bugs in optimization of cursor line highlighting in the gutter 2012-11-05 11:05:30 -07:00
Nathan Sobo
f76c9d5597 Don't update the highlighted line number if it's already highlighted 2012-11-03 14:12:40 -06:00
Nathan Sobo
045cdda41d Fix cursor line highlight style 2012-11-02 12:16:03 -06:00
Nathan Sobo
c6075b0fa6 Optimize highlighting of the current line in the gutter 2012-11-01 17:37:50 -06:00
Nathan Sobo
733264dc91 Don't highlight gutter lines when there's a multi-column selection 2012-10-29 16:42:51 -06:00
Kevin Sawicki
b7f32036c2 Change editor-selection-change event name to selection-change 2012-10-01 15:44:58 -07:00
Kevin Sawicki
edfd61c702 Remove unneeded class addition 2012-10-01 15:44:58 -07:00
Kevin Sawicki
c7361d487f Update cursor line when selection screen range changes 2012-10-01 15:44:58 -07:00
Kevin Sawicki
f2306f444a 💄 2012-10-01 15:44:58 -07:00
Corey Johnson
d5b1146b9b Only call gutter.afterAttach once 2012-10-01 15:44:57 -07:00
Kevin Sawicki
a4ad5829a5 Disable gutter background highlight on multiline selections 2012-10-01 15:44:57 -07:00
Kevin Sawicki
2de14a701f Set width to 0 on tester element 2012-10-01 15:44:57 -07:00
Corey Johnson & Kevin Sawicki
b1138601fc Use gutter number padding when calculating gutter width 2012-10-01 15:44:57 -07:00
Corey Johnson & Kevin Sawicki
e15694bb41 No longer cache cursorScreenRow in gutter highlighting 2012-10-01 15:44:57 -07:00
Corey Johnson & Kevin Sawicki
2863d92ce3 Use screen position for gutter highlighting 2012-10-01 15:44:57 -07:00
Kevin Sawicki
f2cc859a4c Always store cursor row as a buffer row
Previously the buffer vs. screen row difference
was causing the highlight to not always be present
2012-09-28 11:52:40 -07:00
Kevin Sawicki
6b8963781b Add cursor class if row is already selected 2012-09-28 11:30:56 -07:00
Kevin Sawicki
02768fa68d Refer to instance cursorRow variable 2012-09-28 10:30:13 -07:00
Kevin Sawicki
c2417bfc46 Initialize firstScreenRow to -1 2012-09-28 09:54:30 -07:00
Kevin Sawicki
02fa815459 Highlight the line number of the current cursor row 2012-09-28 09:52:34 -07:00
Nathan Sobo
5f253d78e9 Optimization: Use absolute positioning instead of flexbox in editor
Flexbox was causing layouts and repaints to cover the entire scroll view instead of just the edited line. This cuts down on DOM manipulation cost significantly.
2012-09-25 14:58:31 -06:00
Corey Johnson
3b9310ebe4 Gutter width is sized to fit the width of the largest line number 2012-08-31 13:33:59 -07:00
Nathan Sobo
c3e748a17c WIP: Use rake to start compiling resources (like require.coffee) 2012-08-26 16:29:46 -05:00
Nathan Sobo
c2c8724ad0 Initial commit 2012-08-10 13:32:19 -06:00
Nathan Sobo
f253820250 💄 Use more delegated (editor -> buffer) methods 2012-07-04 12:58:00 -06:00
Nathan Sobo
c90c2e80d6 Replace @buffer reference on Editor with @getBuffer method 2012-07-04 12:34:44 -06:00
Nathan Sobo
3ee7c0dc0f "Scroll" gutter by relatively positioning its line numbers
This matches how we scroll lines, and eliminates opportunities for the gutter to get out of sync with the lines. If that happened, it would probably be a bug, but this at least eliminates one source of confusion when debugging.
2012-07-03 11:09:34 -06:00
Corey Johnson & Nathan Sobo
db69ee5627 Calculate gutter dimensions when editor's dimensions are calculated 2012-06-15 17:30:10 -07:00
Corey Johnson & Nathan Sobo
86316c2115 Use last buffer row instead of last screen row to calculate gutter width. 2012-06-02 09:24:27 -07:00
Corey Johnson
0e09659d79 Gutter adjusts its width to account for the width of the last line number 2012-05-17 10:16:20 -07:00
Corey Johnson
b35a2502c6 Gutter line numbers are rendered similarly to the scroll view's lines 2012-05-14 12:32:53 -07:00
Corey Johnson
5e4aef95d0 Only visible lines numbers are rendered by the gutter 2012-05-14 09:53:58 -07:00
Corey Johnson
1efb712fd3 Rename App.coffee to Atom.coffee. This also required moving src/atom,spec/atom to src/app,spec/app 2012-04-03 10:33:24 -07:00