Commit Graph

118 Commits

Author SHA1 Message Date
Machiste Quintana
d5bcc0433d WIP: 👕 Fix linter errors 2015-05-22 16:29:12 -04:00
Nathan Sobo
865015e47d Correctly compute bufferDelta for last soft wrap line segment
Fixes #6885
2015-05-21 19:56:53 +02:00
Max Brunsfeld
2bfbb7619e Fix bug w/ markers mutated inside of change listeners 2015-05-19 17:48:53 -07:00
Max Brunsfeld
a1cc35b270 Fix DisplayBuffer spec
Marker updates now happen after all buffer changes
2015-05-19 15:18:20 -07:00
Jess Lin
cdca9c3ef1 [Gutter] Fix coffeescript style issues 2015-04-22 07:29:00 -07:00
Jess Lin
58d6712b0e [Gutter] Augment Decoration to discern the line-number gutter from custom gutters 2015-04-22 07:28:57 -07:00
Jesse Grosjean
409775b53e Improved specs for clipping pixel positions above/below display buffer 2015-04-01 12:39:22 -04:00
Jesse Grosjean
b067a6175f add screenPositionForPixelPosition spec 2015-03-30 13:52:28 -04:00
Nikolaus Wittenstein
b28ee92896 Add tests for DisplayBuffer::screenPositionForBufferPosition around soft tabs
This makes sure that a buffer position in the middle of a soft tab will
correctly clip to the closest edge by default.
2015-03-29 19:43:25 -04:00
Nikolaus Wittenstein
5a3f2035a1 Replace skipAtomicTokens with clip
When clipping a screen position, callers used to have to pick between
clipping to the left edge or the right edge when the position was in the
middle of an atomic token. This change allows them to choose the closest
edge, and makes this the default.

This makes selecting hard tabs (or any other atomic tokens) work in a
similar manner as in other text editors; that is, when clicking near
the middle of a tab, the insertion point will move to the closest edge
rather than the left edge.
2015-03-29 19:43:25 -04:00
Nikolaus Wittenstein
372fb49c88 TokenizedLine::screenColumnForBufferColumn calculates more accurately
screenColumnForBufferColumn used to break only if the current column
was strictly greater than the target column. This commit changes it so
it breaks when greater or equal, which is how bufferColumnForScreenColumn
works.

This also adds some unit tests for screenColumnForBufferColumn's
interactions with hard tab characters.
2015-03-29 19:43:25 -04:00
Nathan Sobo
10458a5b45 Always autoscroll when the range of the last selection changes
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-03-26 15:30:53 -06:00
Max Brunsfeld
2f5d975338 Remove autoscroll-related legacy editor view support
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-03-26 11:12:37 -07:00
Nathan Sobo
2bfd30c832 Revert "Revert "Don't soft-wrap on indentation"" 2015-03-19 14:37:39 -06:00
Nathan Sobo
6345799cf3 Revert "Don't soft-wrap on indentation" 2015-03-19 12:47:58 -06:00
Antonio Scandurra
56020b11b0 🐛 Avoid soft-wrapping on indentation 2015-03-19 11:36:55 +01:00
Antonio Scandurra
fbfe19825b Even more descriptive specs 2015-03-18 18:00:31 +01:00
Antonio Scandurra
8559526215 Write a more comprehensive spec 2015-03-18 17:42:25 +01:00
Antonio Scandurra
7c33b9bf41 🎨 Rename to softWrapHangingIndent 2015-03-18 14:18:27 +01:00
Antonio Scandurra
f0b9bb7ce3 Show indent guides on hanging indentation too 2015-03-18 11:17:34 +01:00
Antonio Scandurra
6ac8af2a6e Check leading spaces as well 2015-03-17 22:58:14 +01:00
Antonio Scandurra
6d39bd3657 Verify that hanging indentation is tokenized 2015-03-17 22:21:07 +01:00
Antonio Scandurra
3b5a0b292d 📝 Better and consistent naming across specs and docs 2015-03-12 12:32:59 +01:00
Antonio Scandurra
faa2944232 Cover edge case scenario
...where buffer rows are less than rows fitting on screen
2015-03-12 10:33:19 +01:00
Antonio Scandurra
912dd732a9 🎨 Uniform new tests structure 2015-03-12 10:17:26 +01:00
Antonio Scandurra
9f1bb82451 Adjust DisplayBuffer#getVisibleRowRange logic
This fixes #4596, where the calculation returned a wrong range.

* 📝 State clearly that we'll return a closed interval in docs
*  Write tests to ensure a correct behavior
2015-03-12 10:08:02 +01:00
Antonio Scandurra
efefc0dc66 DisplayBuffer#getEditorWidthInChars must always be >= 0 2015-02-27 00:55:03 +01:00
Nathan Sobo
c9ce9f41c2 Merge pull request #5567 from as-cii/indent-soft-wrap
Indent soft wrap
2015-02-25 19:06:35 -07:00
Nathan Sobo
5fdb3cde08 Fix ::longestScreenRow update for changes directly above longest line
Fixes #5716
2015-02-24 11:36:01 -07:00
Antonio Scandurra
0258531a3c Use softWrapIndentation name consistently 2015-02-20 10:28:27 +01:00
Antonio Scandurra
ab5c79d009 Revert softWrapAtNewline attempt
...now we use `skipSoftWrapIndentation: true` when moving up and down.
2015-02-20 10:02:34 +01:00
Antonio Scandurra
ed77358515 Show guide on soft wrapped lines with indentation
* Rename phantomToken to softWrapIndent and use it consistently
* Build multiple softWrapIndent tokens in order to show guides
* Memoize softWrapIndentTokens and softWrapIndentDelta
2015-02-20 09:29:37 +01:00
Antonio Scandurra
59cc10a1ee Bring in @nathansobo PR changes
...as they were needed to pass specs
2015-02-19 21:09:06 +01:00
Antonio Scandurra
79c16a0d00 Use softWrapAtNewLines in moveDown and moveUp
/cc: @nathansobo
2015-02-19 20:01:37 +01:00
Antonio Scandurra
67ef17e0c8 💚 Fix soft wrapping scroll spec 2015-02-19 16:23:59 +01:00
Antonio Scandurra
85e202ee0a Get rid of wrapAtPhantomTokens 2015-02-19 16:23:51 +01:00
Antonio Scandurra
8184ad9a77 Ensure phantom tabs are correctly tokenized 2015-02-18 21:31:00 +01:00
Antonio Scandurra
bef1e862cc Fix failing specs (and add new ones)
When fixing failing specs, I adapted existing expectations to match the "soft
wrap indenting" behaviour: this means that there's no need to write a new spec
for it.
2015-02-18 21:20:04 +01:00
Nathan Sobo
8c574bfd30 Rename 'gutter' decorations to 'line-number' decorations 2015-01-14 19:49:46 -07:00
Max Brunsfeld
0d5a707ffb Fix folding with splits
Fixes #4099

Signed-off-by: Nathan Sobo <nathan@github.com>
2015-01-14 09:43:20 -08:00
Nathan Sobo
7422f4378e Add property filters to TextEditor::getDecorations methods
This makes it much easier to write tests that inspect the state of
decorations.
2014-12-10 19:11:50 -07:00
Nathan Sobo
4d796f614c Update Tokenized/DisplayBuffer prior to TextBuffer::onDidChange handlers
Fixes #3789
2014-10-27 13:56:23 -06:00
Lee Dohm
00baedbdf9 Add specs for editor.scrollPastEnd behavior 2014-09-25 23:05:47 -07:00
Ben Ogle
9af2325f17 Rename DisplayBufferMarker -> Marker
Gnar!! 😎
2014-09-18 13:53:12 -07:00
Ben Ogle
cef8b95ef3 Deprecate s|getAttributes for s|getProperties 2014-09-18 13:53:12 -07:00
Ben Ogle
e6dbea09fe Add onDidCreateMarker and onDidUpdateMarkers 2014-09-05 17:26:14 -07:00
Ben Ogle
7ae25d34e7 Decoration Params -> Properties 2014-09-05 16:20:42 -07:00
Ben Ogle
e6e6028683 Deprecate decoration events 2014-09-05 15:14:27 -07:00
Ben Ogle
6e8a626de2 Add ::onDidChangeSoftWrapped to DisplayBuffer and Editor 2014-09-05 13:41:46 -07:00
Ben Ogle
21e4d8a064 Add DisplayBuffer::onDidChange 2014-09-05 13:30:59 -07:00