Commit Graph

4298 Commits

Author SHA1 Message Date
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
271af5dd99 Add Editor::setSelectedScreenRanges() 2014-08-28 17:28:24 -07:00
Ben Ogle
7ca5ece68a Add methods to be symmetrical with selections
* getCursorsOrderedByBufferPosition
* getCursorBufferPositions
* getCursorScreenPositions
2014-08-28 16:06:44 -07:00
Ben Ogle
370ad23f7c Remove Cursor from ::moveCursor* methods 2014-08-28 15:25:12 -07:00
Kevin Sawicki
e8cd59eaef Waits for reloaded event from ThemeManager
Previously disabling a theme wouldn't wait for the full reload
to finish since and the spec would intermittently fail because
the promise was fulfilled after the spec completed and the
subscription was leaked.
2014-08-26 14:23:20 -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
cef24a3979 Remove the react editor options 2014-08-25 12:15:34 -07: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
Ben Ogle
431fab1a43 Remove the editor-view 2014-08-25 12:05:10 -07:00
Ben Ogle
f8026bb005 Require the react-editor-view where we require the editor-view 2014-08-25 12:02:38 -07:00
Ben Ogle
c3c91ae6c3 Only emit the marker-created event when the marker exists
This caused problems in the case of find-and-replace:select-all with 
multiple editors into the same file. 

* a marker is created on the TextBuffer capturing the selection
* DisplayBuffer:create-marker is fired from the first DisplayBuffer. 
The marker is turned into a selection which is merged into the current 
selection, deleting the marker that was created.
* DisplayBuffer::handleBufferMarkerCreated is called on the second
DisplayBuffer. The marker has been destroyed at this point, so it emits 
DisplayBuffer:create-marker with undefined. 
* ERROR>

Closes #3364
2014-08-25 11:42:44 -07:00
Kevin Sawicki
ecf237697b Add react editor view spec for data grammar attrs 2014-08-25 10:22:44 -07:00
Thomas Johansen
4dc89f1b1e 🐛 Fix incorrect assertions 2014-08-24 14:14:26 +02:00
Thomas Johansen
dc55d42491 Add test to verify implementation 2014-08-24 10:17:26 +02: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
26d696a93d Add classes to the workspace for themes
Fixes #3097
2014-08-21 11:53:10 -07: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
5cb084d568 Fix editor:move-to-first-character-of-line with leading hard tabs
Fixes #3314
2014-08-19 11:50:04 -06:00
Kevin Sawicki
0eaec57f7b Merge pull request #3116 from maschs/ms-srcLint
coffeelint!
2014-08-15 13:52:15 -07:00
Nathan Sobo
6c52bcf20c Assign ::firstNonWhitespace/TrailingWhitespaceIndex in Token::split
Fixes #3277
2014-08-15 12:58:27 -06:00
Ben Ogle
919f541685 Merge pull request #3261 from atom/bo-default-react-mini
Default to the react mini editors
2014-08-15 11:16:28 -07:00
Nathan Sobo
2bd8456923 Preserve invisibles in editor model across serialization
Fixes #3281
2014-08-15 08:18:53 -06:00
Maximilian Schüßler
cbe5593381 Do not use "-> return" to mark empty function 2014-08-14 19:42:50 +02:00
Maximilian Schüßler
32e59ce238 Cleanup code according to coffeelint 2014-08-14 19:41:49 +02:00
Kevin Sawicki
776e431cc5 confirmCheckoutHead -> confirmCheckoutHeadRevision 2014-08-13 19:02:09 -07:00
Kevin Sawicki
00170804e5 Remove spec now covered in git spec 2014-08-13 18:51:19 -07:00
Kevin Sawicki
3ce641f53b Move checkout head editor specs to git spec 2014-08-13 18:51:19 -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
986753981d Use config defaults to assign default invisible characters 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
7b55946abf Make Editor::moveCursorToFirstCharacterOfLine work with invisible chars 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
742ec6df0d Determine the endOfLineInvisibles for each TokenizedLine 2014-08-13 16:31:39 -06:00
Nathan Sobo
864f9bc2b4 Preserve hasLeading/TrailingWhitespace when copying lines w/ invisibles
This fixes the styling of the leading whitespace of folded lines
2014-08-13 16:31:39 -06:00
Nathan Sobo
73896d100e Add specs for firstNonWhitespaceIndex and firstTrailingWhitespaceIndex 2014-08-13 16:31:39 -06:00
Nathan Sobo
193001d793 Assign invisibles via config in editor-view-spec 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
Nathan Sobo
2daf70f0e5 Handle invisibles at the token level to fix char width measurement
Fixes #3188
2014-08-13 16:31:39 -06:00
Kevin Sawicki
fca9ed07e6 Merge pull request #3169 from lee-dohm/ld-checkout-head
Add confirmation dialog to checkoutHead
2014-08-13 15:24:06 -07:00
Ben Ogle
e725a8ffeb Default to on in the specs 2014-08-13 14:51:05 -07:00
Ben Ogle
449da91216 Add toShow matcher 2014-08-13 13:42:46 -07:00
Ben Ogle
96804096e9 Fix specs 2014-08-12 15:44:58 -07:00
Ben Ogle
722d8cb48b Need to return a range when the text is inserted 2014-08-12 15:30:19 -07:00
Ben Ogle
b037395551 Add will-insert-text and did-insert-text to insertText() 2014-08-12 15:28:26 -07:00
Ben Ogle
7de2ad34aa Remove opaque backgrounds on mini editors
Fixes #3239
2014-08-12 14:53:09 -07:00