Commit Graph

300 Commits

Author SHA1 Message Date
Ben Ogle
8448b265d5 Merge pull request #3549 from atom/bo-visibility-split
Add sections and split methods into essential / extended API
2014-09-17 16:51:50 -07:00
Kevin Sawicki
36f60c517e Assert other whitespace class is not present 2014-09-17 09:50:55 -07:00
Kevin Sawicki
348f865cab Add spec for all whitespace lines 2014-09-17 09:47:49 -07:00
Kevin Sawicki
18f54e6780 💄 Put leading spec first 2014-09-17 09:42:31 -07:00
Kevin Sawicki
b281737838 Add leading/trailing classes to hard tab tokens
Previously the leading-whitespace and trailing-whitespace classes
were never added to tokens that were hard tabs.
2014-09-17 09:42:31 -07:00
Ben Ogle
f12b70e3b7 Editor::onDidChangeScreenLines -> onDidChange 2014-09-16 10:51:32 -07:00
Ben Ogle
8aa1784c4a Add Editor::onDidChangeScreenLines 2014-09-08 16:04:43 -07:00
Ben Ogle
aeffef30c6 Directly subscribe to the decorations in EditorComponent 2014-09-05 16:49:30 -07:00
Nathan Sobo
965afc2c37 Rename softWrap to softWrapped
Our new pattern for booleans is to have ::set and ::is, and that means
the property name needs to be in passive voice for ::is to make sense.
This is in preparation for adding a new change observation method.

* ::setSoftWrapped
* ::isSoftWrapped
* ::toggleSoftWrapped
2014-09-05 11:39:33 -07:00
Ivan Zuzak
af2f155082 Merge branch 'master' into iz-gutter-click-select-line 2014-09-04 16:22:51 +02:00
Ben Ogle
c0c941b8db lineForBufferRow -> lineTextForBufferRow 2014-09-03 14:42:46 -07:00
Ben Ogle
e3a0339fe3 Editor::lineForScreenRow -> ::tokenizedLineForScreenRow 2014-09-03 14:42:46 -07:00
Ivan Zuzak
7f14965ca8 Support selecting multiple rows with meta-click 2014-09-01 17:42:55 +02:00
Ivan Zuzak
8c36d2673b Select row when clicking the gutter 2014-08-30 20:20:09 +02:00
Ben Ogle
08388d87c0 Remove getSelectionAtIndex
We’re going to eventually get rid of the clone in 
getSelections / getCursors freeze those properties 
and return them directly. Then they can operate 
on the list garbage free.
2014-08-28 18:16:33 -07:00
Ben Ogle
9c53d6f014 Deprecate getCursor() 2014-08-28 18:10:18 -07:00
Ben Ogle
2fced0c1bc Deprecate getSelection 2014-08-28 17:51:16 -07:00
Ben Ogle
370ad23f7c Remove Cursor from ::moveCursor* methods 2014-08-28 15:25:12 -07:00
Nathan Sobo
3371ceadf3 Add regression coverage for remeasuring characters w/ requested update
The problem here is that the lines in the editor no longer reflect the
lines on screen, but we're looking for line nodes corresponding to the
editor's current contents.
2014-08-25 18:16:38 -06:00
Ben Ogle
3d2d8c491f rename react-editor-view -> editor-view 2014-08-25 12:07:48 -07:00
Ben Ogle
97bcdcc9b0 Rename ReactEditorView -> EditorView 2014-08-25 12:05:55 -07:00
Kevin Sawicki
ecf237697b Add react editor view spec for data grammar attrs 2014-08-25 10:22:44 -07:00
Nathan Sobo
a71a524ec7 Rework DOM measurement to try to prevent measurement errors
* Simplify scrollbar refresh and measurement by using imperative DOM
  manipulation instead of React to hide/show scrollbars.
* Rename `::performInitialMeasurement` to `::becameVisible`
* Break `::checkForVisibilityChange` out of `::pollDOM` and use it in
  to check for the element becoming visible in `componentWillUpdate`.
* Don't rely on stored visibility state anywhere. Always check again.
  This could potentially be cached for an update cycle but being wrong
  about this is disastrous so I'm being conservative.
2014-08-21 17:50:46 -06:00
Ben Ogle
30aa47026d Do not move cursor when interacting with horiz scrollbar
Fix #3284
2014-08-21 10:40:16 -07:00
Nathan Sobo
20daed176b Don't show invisibles in mini editors
This moves observation of the config keys to Editor, which assigns the
invisibles hash or null on the TokenizedBuffer via the DisplayBuffer to
control whether we render invisibles or not.
2014-08-13 16:32:14 -06:00
Nathan Sobo
d37cfb9042 Assign default invisible character glyphs via config defaults
This commit also extends config.get to merge default values into the
returned object if both the assigned and default values are objects.
This allows 'atom.invisibles' to be treated as an object that always has
the default values filled in.
2014-08-13 16:32:13 -06:00
Nathan Sobo
970bde9361 Run animation frame after toggling invisibles in EditorComponent spec 2014-08-13 16:31:40 -06:00
Nathan Sobo
c74f6bb615 Remove handling of invisibles from EditorComponent 2014-08-13 16:31:40 -06:00
Nathan Sobo
63f2ab3088 Render end-of-line invisibles based on state of TokenizedLine 2014-08-13 16:31:39 -06:00
Nathan Sobo
052f9580f2 Render correct classes on leading/trailing whitespace spans 2014-08-13 16:31:39 -06:00
Ben Ogle
7de2ad34aa Remove opaque backgrounds on mini editors
Fixes #3239
2014-08-12 14:53:09 -07:00
Nathan Sobo
a9bd061144 Un-f 2014-07-29 16:52:21 -06:00
Nathan Sobo
837eaccd16 Remove extra nextAnimationFrame call 2014-07-28 21:53:18 -06:00
Nathan Sobo
eebbb99fc8 Handle editor font config options with a global stylesheet
Previously, each editor observed font-related config values on its own
and applied inline styles to honor them. This made it difficult to style
the editor like a normal element with CSS.

Moving this to a global stylesheet that targets editors via the .editor
selector means that the font size setting can be overridden in specific
contexts, such as when using mini editors.
2014-07-28 21:00:15 -06:00
Nathan Sobo
393552a4b6 Take cursors off the GPU and position them on the lines layer
The compositor overhead is not worth it.
2014-07-27 11:47:33 -06:00
Nathan Sobo
444c18be34 Stop polling when an update is pending 2014-07-27 11:46:22 -06:00
Nathan Sobo
dca096b8e3 Use requestAnimationFrame to batch updates in Chrome 35
In Chrome 31, setImmediate was yielding better behavior. But now Chrome
35 seems to behave more smoothly when we use requestAnimationFrame, and
the delay for keystrokes is non-existent.
2014-07-27 11:46:22 -06:00
Nathan Sobo
7738eeeacc Give the line-numbers div an opaque background for better GPU perf
We sample both the background color of the editor and the gutter. If the
gutter has an actual background color, we use it. Otherwise we fall back
to the same background as the editor.
2014-07-24 17:23:04 -07:00
Nathan Sobo
c6116468e4 Apply background color of root editor node to lines as an inline style
This ensures lines have an opaque background that matches whatever the
editor is styled as, but avoids the need to apply the .editor-colors
class to the .lines div. That approach fell down when people were
setting the background color via means other than .editor-colors, such
as styling mini editors via the .editor.mini selector in the settings
view.
2014-07-24 16:54:01 -07:00
Nathan Sobo
2a2d0b60f7 💄 2014-07-24 16:41:25 -07:00
Ben Ogle
00275d95ec Merge pull request #3044 from atom/bo-h-scrollbar
Horizontal scrollbar no longer covers the gutter
2014-07-23 16:35:02 -07:00
Ben Ogle
242df788e6 Remove unnecessary scrollbar specs 2014-07-23 16:25:24 -07:00
Ben Ogle
3295b9b0dd Romove runSetImmediateCallbacks() in many cases
This is because of the removal of the gutter measurement. When there 
was measurement, every load of the editor would measure and request at 
least one render based on the reset of the gutter width. These 
specs don’t need to call runSetImmediateCallbacks() as they either 
don’t do anything to cause a render or they render immediately
(in the case of updated options).

In some cases, we need to make sure nothing happened, so I added a
hasSetImmediateCallbacks() function, which is used in specs where 
nothing should have happened.
2014-07-23 16:25:10 -07:00
Ben Ogle
ffb041a160 Only render an nbsp on empty lines when no eol character defined
Fixes #3053
2014-07-23 09:30:52 -07:00
Ben Ogle
361f8ec770 Add specs for toggling the gutter when the editor is hidden 2014-07-22 18:26:58 -07:00
Ben Ogle
48a5123202 💄 Move logic into measureGutterIfNeeded 2014-07-22 18:26:58 -07:00
Ben Ogle
0f1d155685 Move gutterWidth into state; add specs for scrollbar position 2014-07-22 18:26:58 -07:00
Ben Ogle
17364cd528 Take the scrollbar width into account in specs 2014-07-22 11:54:26 -07:00
Nathan Sobo
5871bee791 Make spec assertions insensitive to scrollbars on Windows 2014-07-22 10:16:43 -07:00
Nathan Sobo
43c9e21f1d Make setEditorHeightInLines/WidthInChars spec helpers work with React
Fixes #3019
2014-07-21 15:04:44 -07:00