Commit Graph

134 Commits

Author SHA1 Message Date
Nathan Sobo
388763e7cd Wait to measure characters if editor is hidden
Also, when characters *are* measured, request a display update
2014-06-19 04:19:51 -06:00
Nathan Sobo
17f9cc49f2 Honor the center: true option in scrollTo* methods
Fixes #2648
2014-06-18 21:48:14 -06:00
Ben Ogle
4308ce7bb0 Warnings when you pass in a bs marker 2014-06-17 17:08:53 -07:00
Nathan Sobo
2fffbba503 Eliminate Decoration class and use plain objects instead 2014-06-17 17:35:56 -06:00
Nathan Sobo
2c04bff0fa Only return decorations for markers intersecting the screen row range
This relies on a fix to the interval-skip-list provided with the upgrade
to text-buffer@2.4.0.
2014-06-16 15:36:09 -07:00
Ben Ogle
2d4360dcf0 Decorations can now only be attached to markers.
The basics work. It will render them on the gutter.
2014-06-16 15:36:08 -07:00
Ben Ogle & Nathan Sobo
7142022f05 Add intersection support to DisplayBuffer::findMarkers 2014-06-16 15:36:08 -07:00
Ben Ogle & Nathan Sobo
25520a4cad Add containedInScreenRange to DisplayBuffer::findMarkers 2014-06-16 15:36:08 -07:00
Ben Ogle & Nathan Sobo
56da6399b8 Add startScreenRow and endScreenRow to DisplayBuffer::findMarkers 2014-06-16 15:36:08 -07:00
Ben Ogle & Nathan Sobo
a7379b067a Use ::getMarker for fold decorations instead of new DisplayBufferMarker 2014-06-16 15:36:07 -07:00
Nathan Sobo
7c1a4a9e08 Don't clip range start/end in DisplayBuffer::pixelRectForScreenRange
Fixes #2583

This prevents the cursor from having 0 width inside atomic tokens.
2014-06-11 11:40:57 -06:00
Nathan Sobo
b73d267a5f Merge branch 'master' into cj-add-react-editor-shims 2014-06-11 07:34:41 -06:00
Nathan Sobo
7040906473 Ignore null bytes when measuring character widths in React editor
Fixes #2391
2014-06-11 07:18:52 -06:00
probablycorey
9e7e77bdf8 Merge remote-tracking branch 'origin/master' into cj-add-react-editor-shims
Conflicts:
	src/gutter-component.coffee
2014-06-10 15:42:23 -07:00
Ben Ogle
31b4b7a372 Speed up decoration removal and use less temp objects. 2014-06-09 14:04:24 -07:00
Ben Ogle
312901ff68 Use decorations for folds.
They are more efficient when re-rendering.
2014-06-09 14:04:24 -07:00
Ben Ogle
346b6007ca Allow for typeless decorations that apply to everything
If you are querying for `type: ‘gutter’` it will return the typeless 
decorations as well.
2014-06-09 14:04:24 -07:00
Ben Ogle
049531e495 Add comment 2014-06-09 14:04:23 -07:00
Ben Ogle
e8594ccec4 💄 Change var names for consistency 2014-06-09 14:04:23 -07:00
Ben Ogle
02594e3f7a 💄 Use for loops 2014-06-09 14:04:23 -07:00
Ben Ogle
86d7a45a78 Remove the comment about overlap
Turns out it’s already dealing with overlap by not emitting events
when there is an overlap.
2014-06-09 14:04:22 -07:00
Ben Ogle
a229d696d5 Add addDecorationForBufferRowRange and related remove 2014-06-09 14:04:22 -07:00
Ben Ogle
ef6ca3853d 💄 2014-06-09 14:04:22 -07:00
Ben Ogle
9e86d5f5f1 💄 Clean up based on feedback 2014-06-09 14:04:22 -07:00
Ben Ogle
6ce859774a Name changes 2014-06-09 14:04:22 -07:00
Ben Ogle
9ee54801a2 Implement removeDecorationsForMarker 2014-06-09 14:04:22 -07:00
Ben Ogle
732e23b8ea Add initial addDecorationForMarker() 2014-06-09 14:04:22 -07:00
Ben Ogle
eb59196c02 Rendering decorations works well.
Also specs.
2014-06-09 14:04:22 -07:00
Ben Ogle
142eedd705 Renders decoration changes. 2014-06-09 14:04:22 -07:00
Ben Ogle
77d269c6d9 Beginning of decorations 2014-06-09 14:04:22 -07:00
Nathan Sobo
f103e72c01 Remove exceptions related to unassigned lineHeight
These exceptions break specs when simulateDomAttachment is used. They
were only present to ensure correct sequencing during development of the
react editor, so it's safe to remove them for now.
2014-06-04 21:05:29 +09:00
probablycorey
7f57a094f6 Determine softTab state after the buffer is tokenized. 2014-05-28 16:31:00 -07: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
Nathan Sobo
7d8256d343 Drop lineOverdraw and scroll-view-content div 2014-05-16 15:31:11 -06:00
Nathan Sobo
bf9f8597a7 Give each line its own layer on the GPU 2014-05-16 15:31:11 -06:00
Nathan Sobo
308960309d Overdraw lines to discourage Blink from repainting the entire editor 2014-05-16 15:31:11 -06:00
Nathan Sobo
ce5c29fb47 Base the visible lines on the height instead of the clientHeight
Because overlay scrollbars are invisible unless scrolling and even
regular scrollbars can be transparent.
2014-05-09 11:33:04 -06:00
Nathan Sobo
dbd271f70a Don't obscure last character of long lines with vertical scrollbar
This entailed quite a few changes to dial in scrollbars. The scrollbars
are now adjusted in size to account for the width of the opposite
scrollbar. If the width or height are not explicitly constrained and we
are scrollable in the opposite direction that is constrained, we account
for the width of the opposite scrollbar in assigning a natural height
or width based on the content.
2014-05-09 11:33:04 -06:00
Nathan Sobo
e412371b88 Remove logging 2014-05-09 11:33:03 -06:00
Nathan Sobo
7b4bc16531 Fix specs that broke when accounting for horizontal scrollbar height 2014-05-09 11:33:03 -06:00
Nathan Sobo
e6df30e94c Respect horizontal scrollbar when rendering the vertical, and vice versa
We set overflow to hidden in the opposite scroll direction only if we
can't actually scroll in that direction, causing the white square where
neither scrollbar overlaps to appear at the lower right corner.
2014-05-09 11:33:03 -06:00
Nathan Sobo
d9ba9262bf Update scrollTop to valid position when scrollbar disappears 2014-05-09 11:33:03 -06:00
Nathan Sobo
c4be32a5dd Revert "Revert "Don't obscure the last line of the editor with the horizontal scrollbar""
This reverts commit 1d634e471e.
2014-05-09 11:33:03 -06:00
Nathan Sobo
1d634e471e Revert "Don't obscure the last line of the editor with the horizontal scrollbar"
This reverts commit babbdbf9e5.
2014-04-23 14:03:33 -06:00
Nathan Sobo
babbdbf9e5 Don't obscure the last line of the editor with the horizontal scrollbar
This assumes the scrollbar is 15px high, which is incorrect when using
overlay scrollbars or when the scrollbar is styled to have a different
height. We'll need to measure it in a subsequent commit.
2014-04-23 13:59:35 -06:00
Nathan Sobo
f53d489abb Add DisplayBuffer::scrollToScreen/BufferPosition
Also add delegators in Editor and ReactEditorView
2014-04-22 17:10:23 -06:00
Nathan Sobo
fdccc0bcc2 Measure DOM dimensions before rendering elements that depend on them
This commit breaks the initial render of the editor component into two
stages.

The first stage just renders the shell of the editor so the height,
width, line height, and default character width can be measured. Nothing
that depends on these values is rendered on the first render pass.

Once the editor component is mounted, all these values are measured and
we force another update, which fills in the lines, line numbers,
selections, etc.

We also refrain from assigning an explicit height and width on the
model if these values aren't explicitly styled in the DOM, and just
assume the editor will stretch to accommodate its contents.
2014-04-22 17:10:21 -06:00
Nathan Sobo
a0ff6f5325 Handle 'autoscroll' option in model when setting selected buffer range 2014-04-22 17:09:45 -06:00
Nathan Sobo
4b9871fa13 Enable advanced scroll management only when editor is used by react view
This preserves the original behavior of the editor model with respect
to scroll position and autoscroll unless it's being used by the react
component, which flips the ::manageScrollPosition flag to true.
2014-04-22 17:09:41 -06:00
Nathan Sobo
9a3f8022ad Add shims to get bracket matcher working 2014-04-22 17:09:40 -06:00