Commit Graph

8486 Commits

Author SHA1 Message Date
Corey Johnson
3f549bbada Merge pull request #2477 from atom/ns-react-remove-scroll-view-component
Merge EditorScrollViewComponent into EditorComponent
2014-06-02 08:02:49 -07:00
Nathan Sobo
1187d50b81 Fix inequality in LinesComponent::shouldComponentUpdate
Change objects from the display-buffer are currently end-row inclusive.
I'd like to fix this, but not until we switch editors.
2014-06-02 19:17:30 +09:00
Nathan Sobo
afe386ce40 💄 EditorComponent method order 2014-06-01 18:31:47 +09:00
Nathan Sobo
d31669c67f Merge EditorScrollViewComponent into Editor
I don't think that this component was really carrying its weight. Its
render function basically passed through directly to other components
that updated between renders, but didn't contain any content on its
own that actually changed after the first render.

React components seem to carry overhead, so I want every component we
use to count. Also, I'm considering circumventing some of React's
standard update logic for performance reasons, and making the structure
more shallow will help with that.
2014-06-01 15:24:59 +09:00
Nathan Sobo
2548891b99 Clear the mousewheelScreenRow even if the event does not cause scrolling
If a mousewheel event is triggered when the editor can't be scrolled,
we still want to clear the mouseWheelScreenRow. This is typically done
when we stop scrolling, but if we never start scrolling it will never
happen. This commit adds another timeout to cover that case.
2014-05-31 18:36:59 +09:00
Nathan Sobo
0043072ecf Only preserve mouseWheelScreenRow if it's out of the rendered row range
Fixes #2429, #2443

Otherwise, it's possible to duplicate lines. If a line is in the
rendered row range and it's not in the set of lines returned by the
editor, we should remove it no matter what. Line preservation is only
intended for lines that are out of view.
2014-05-31 08:56:57 +09:00
Nathan Sobo
89c57b6d52 Only set the mouseWheelScreenRow when scrolling vertically
When we handle a mousewheel event targeting a line or line number, we
assign the mousewheelScreenRow to prevent the removal of the target
node, which interferes with velocity scrolling.

However, the ::mousewheelScreenRow is only cleared 100ms after we stop
scrolling vertically. This means that if we're only scrolling
horizontally, it's never cleared. This causes the line node associated
with this screen row to hang around longer until the mousewheel screen
row is cleared again, which is not what we want.

This commit only assigns the ::mousewheelScreenRow when scrolling
vertically, so we can be sure it will be cleared.
2014-05-31 08:56:57 +09:00
Nathan Sobo
f2a08cd178 Update the lines and gutter when the mouseWheelScreenRow changes 2014-05-31 08:56:56 +09:00
Nathan Sobo
df524e4803 Fix bug in LinesCompoent::shouldComponentUpdate 2014-05-31 08:56:32 +09:00
probablycorey
2df2254227 Remove trailing semi-colon
I drank too much javascript today…
2014-05-30 15:10:44 -07:00
probablycorey
f4d256eef2 Use buffer row data attribute to find gutter lines 2014-05-30 15:05:15 -07:00
probablycorey
cb109dc09f Add buffer-row data to gutter-component 2014-05-30 15:04:50 -07:00
Corey Johnson
d2d63d3241 Merge pull request #2431 from atom/cj-add-tokenized-event
Use tokenized event to determine tab style
2014-05-29 15:19:14 -07:00
Corey Johnson
4840987082 Add overlayer class to ReactEditorView
Closed #2442
2014-05-29 15:16:48 -07:00
Corey Johnson
40a2ed3703 Merge pull request #2364 from themaninthesuitcase/cp-projectRelativeTabPath
Update getLongTitle to be project relative
2014-05-29 09:51:45 -07:00
probablycorey
7f57a094f6 Determine softTab state after the buffer is tokenized. 2014-05-28 16:31:00 -07:00
probablycorey
89dc5f26ad Only emit the tokenized event after the first full tokenization 2014-05-28 15:56:08 -07:00
probablycorey
c56ac70181 Add tokenized event to tokenized buffer 2014-05-28 14:53:38 -07:00
Chris Pearson
61cb22840e Update getLongTitle to fall back to basename
Update getLongTitle to fall back to basename when the relative path
resolves to a blank string.
2014-05-28 15:12:51 +01:00
Kevin Sawicki
4f2d935a1d Reload grammar on path changed in TokenizedBuffer 2014-05-27 12:58:17 -07:00
Kevin Sawicki
b19126024a 💄 2014-05-27 12:58:17 -07:00
Kevin Sawicki
56eb1fc6e4 Reload grammar before emitting events 2014-05-27 12:58:17 -07:00
Kevin Sawicki
07a2a6710d Reload grammar in editor when path changes 2014-05-27 12:58:17 -07:00
Nathan Sobo
6448258f4e Add shims to support find-and-replace marker views 2014-05-27 12:11:01 -06:00
Maximilian Schüßler
7e5d554bd8 Fix example in editor-view.coffee 2014-05-25 21:27:21 +02:00
Kevin Sawicki
ac70bfc456 Don't parse line and column if path to open exists
This previously prevented file containing a colon from being open
from the command line.

Closes #2376
2014-05-23 15:32:55 -07:00
Kevin Sawicki
fd0f323666 Open directory path instead of project path
This ensures that the repository opened is always project’s
path instead of the potentially non-existent path or file
specified to Project::setPath
2014-05-23 15:05:04 -07:00
Nathan Sobo
0e31557abf Only measure character widths when editor is visible 2014-05-23 15:59:44 -06:00
Nathan Sobo
5b149bd41a Merge pull request #2370 from atom/ns-react-fix-scroll-corruption
Prevent React editor's scroll view from being auto-scrolled by Chromium
2014-05-23 12:54:15 -06:00
Corey Johnson
3784b77b95 Merge remote-tracking branch 'origin/master' into cj-paragraph-test 2014-05-23 09:23:30 -07:00
Corey Johnson
7f418e2de4 Add move by paragraph commands 2014-05-23 09:13:44 -07:00
karlin
64470a3c7d add moveToBeginningOf{Next,Previous}Paragraph for cursor and wrappers for editor 2014-05-23 00:51:01 -04:00
Nathan Sobo
fae035731f Prevent autoscrolling scroll-view when cursor is at end of longest line
If the longest line is longer than the width of the scroll view, we need
to allow 2px horizontally to prevent the hidden input from
autoscrolling.
2014-05-22 20:18:34 -06:00
Nathan Sobo
446a48ca00 Position hidden input at 0,0 unless cursor is focused
The editor's scroll view is getting autoscrolled when the editor is
focused, so we won't position the hidden input until after the editor
is focused, and will always return it to 0,0 when the editor is blurred.
2014-05-22 20:13:50 -06:00
Nathan Sobo
ce9b34c9eb Warn when scroll view gets accidentally scrolled and fix it
I want this code to go away once we track down the causes of any
unwanted autoscrolling by the browser
2014-05-22 19:53:14 -06:00
Corey Johnson
d1ed176550 Merge pull request #2368 from atom/iz-scrollview-support-for-core-move-up-down
Support core:move-up and core:move-down in ScrollView
2014-05-22 16:41:50 -07:00
Nathan Sobo
9c066d93fa Run react perf in scroll benchmark if NODE_ENV isn't production 2014-05-22 16:01:48 -06:00
Nathan Sobo
e754689014 Add displayName to ScrollbarComponent and ScrollbarCornerComponent 2014-05-22 16:01:48 -06:00
Ivan Zuzak
de96de2de1 Support core:move-up/down in ScrollView
Closes #1828
2014-05-22 23:58:50 +02:00
Kevin Sawicki
16df6a32d6 📝 Use TomDoc in Atom class 2014-05-22 14:06:17 -07:00
Chris Pearson
a337384e7b Update getLongTitle to be project relative 2014-05-22 21:49:49 +01:00
Kevin Sawicki
cdb6de05b3 Update broken Keymap class reference 2014-05-22 13:27:45 -07:00
Nathan Sobo
fe31d2d28a Add scrolling benchmark to React editor 2014-05-22 13:25:47 -06:00
Nathan Sobo
875cfefd36 Merge branch 'master' into ns-ks-react-dont-measure-when-hidden
Conflicts:
	spec/editor-component-spec.coffee
	src/editor-component.coffee
	src/editor-scroll-view-component.coffee
	src/lines-component.coffee
2014-05-22 10:48:21 -06:00
Nathan Sobo
b6fb996ceb Merge pull request #2327 from atom/ns-react-fork
Use Atom-specific fork of React allowing selection restoration opt out
2014-05-22 10:41:26 -06:00
Kevin Sawicki & Nathan Sobo
0951305962 Wire editor.lineHeight config value 2014-05-22 10:17:22 -06:00
Kevin Sawicki & Nathan Sobo
8ffcdad89a Re-measure the line height in pixels when the CSS line-height changes 2014-05-22 10:17:21 -06:00
Kevin Sawicki & Nathan Sobo
9e3ce09658 Rename lineHeight to lineHeightInPixels to distinguish from CSS value
CSS has a line-height property with values like '1.3', but we also have
a measured pixel value for line height. It's important to keep these
separate conceptually.
2014-05-22 10:17:12 -06:00
Kevin Sawicki & Nathan Sobo
45eeee9aea Ensure .lines div is always at least the height of the scroll view
This ensures that the wrap guide extends the entire height of the
editor.
2014-05-21 19:07:03 -06:00
Kevin Sawicki & Nathan Sobo
9cbc693c77 Avoid measuring lineHeight/defaultCharWidth on show unless needed
We only need to re-measure if the fontSize, fontFamily, or lineHeight
changed while the editor was hidden.
2014-05-21 17:35:57 -06:00