Commit Graph

351 Commits

Author SHA1 Message Date
Antonio Scandurra
7c33b9bf41 🎨 Rename to softWrapHangingIndent 2015-03-18 14:18:27 +01:00
Antonio Scandurra
67b1d7890b Add soft-wrap hanging indentation spaces 2015-03-17 22:05:43 +01:00
Antonio Scandurra
f4b791d33b Use screenPosition to select above and below 2015-03-13 10:57:45 +01:00
Antonio Scandurra
3b5a0b292d 📝 Better and consistent naming across specs and docs 2015-03-12 12:32:59 +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
79c16a0d00 Use softWrapAtNewLines in moveDown and moveUp
/cc: @nathansobo
2015-02-19 20:01:37 +01:00
Antonio Scandurra
85e202ee0a Get rid of wrapAtPhantomTokens 2015-02-19 16:23:51 +01:00
Antonio Scandurra
e5eaa25381 Wrap at phantom tokens only when moving cursor left
This prevents a weird behavior that affects selection. Before this commit, when
moving the cursor down, if it was inside a real (soft|hard)-tab of a soft
wrapped line, it would reach the end of the line rather than the beginning of
the next wrapped line.

/cc: @nathansobo
2015-02-18 18:58:43 +01:00
Antonio Scandurra
62434d9ad5 Move findWrapColumn into TokenizedLine
* 🐎 Check `isSoftWrapped` only once when updating screen lines
2015-02-18 10:05:48 +01:00
Antonio Scandurra
b0c670b80a Better naming
...thanks @nathansobo
2015-02-18 09:52:23 +01:00
Antonio Scandurra
38118b66cb Do not rely on text anymore, check phantom tokens instead 2015-02-16 15:49:00 +01:00
Antonio Scandurra
131048af65 Use intention-revealing method names 2015-02-16 15:48:59 +01:00
Antonio Scandurra
abd143a255 Extract phantom token recognition into TokenizedLine 2015-02-16 14:33:37 +01:00
Antonio Scandurra
469876161a Improve TokenizedLine#clipScreenColumn 2015-02-16 12:53:09 +01:00
Antonio Scandurra
5ce01118be Cover edge cases 2015-02-16 12:30:00 +01:00
Antonio Scandurra
fb21cf6123 Wrap appropriately 2015-02-15 12:33:34 +01:00
Antonio Scandurra
7f1bb69580 Initial attempt 2015-02-14 19:04:53 +01:00
Kevin Sawicki
582b819efa Remove unused guid dependency 2015-02-12 16:30:32 -08:00
Nathan Sobo
3656d4cca6 Pass options in DisplayBuffer::screenRangeForBufferRange 2015-02-04 08:42:34 -07:00
Nathan Sobo
5d2efc0469 Deprecate TextEditor::getGutterDecorations
Forgot to rename it when we renamed decorations of type ‘gutter’ to
‘line-number’. It’s not used in core or any packages at the time of
this commit.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:22 -07:00
Nathan Sobo
8c574bfd30 Rename 'gutter' decorations to 'line-number' decorations 2015-01-14 19:49:46 -07:00
Max Brunsfeld
a1b4820c04 Revert "Revert "Merge pull request #4631""
This reverts commit dc2a453986.

Conflicts:
	spec/config-spec.coffee
	src/config.coffee
2014-12-23 09:26:40 -08:00
Max Brunsfeld
dc2a453986 Revert "Merge pull request #4631 from atom/mb-new-config-api"
This reverts commit 5147fb6a8b, reversing
changes made to 9bbbb58084.
2014-12-16 15:27:39 -08:00
Max Brunsfeld
2cea51b50e Take 'scope' option in Config::onDidChange
Deprecate passing the scope as an optional first argument
2014-12-16 14:00:57 -08:00
Max Brunsfeld
4e4794f3fd Take 'scope' option in Config::observe
Deprecate using the scope as an optional first argument
2014-12-16 14:00:57 -08:00
Nathan Sobo
c58606907a Make scope a trailing option to Config::get 2014-12-16 14:00:56 -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
dd63d47c11 Add getters for decoration types in addition to ‘overlay’ 2014-12-02 15:59:12 -07:00
Nathan Sobo
1d6087fcd3 Add TextEditor::getDecorations and ::getOverlayDecorations
Required for autocomplete upgrades.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-26 12:17:26 -07:00
Nathan Sobo
6e55c80d3c Dispose of ::scopedConfigSubscriptions when DisplayBuffer is destroyed 2014-11-07 10:09:55 -07:00
Nathan Sobo
0bcfa591f6 Always throw exceptions when translating rows on destroyed DisplayBuffer
Previously we only threw exceptions on non-release builds, but we
haven’t seen bundled packages cause issues in a while. Time to see what
third party packages cause problems.

Refs #3192
2014-11-06 12:56:01 -07:00
Kevin Sawicki
edec6b9b0a 🐎 Use cached pair character information
Tokenized lines break out atomic tokens so trust the hasPairCharacter
value on the token instead of rechecking it.
2014-10-28 18:15:13 -07:00
Nathan Sobo
2965398062 Throw on non-release builds if translating positions on destroyed editor
It’s possible that bundled packages stray into this corner case, so I’d
like us to catch and fix misbehaving packages before exposing users to 
any exceptions. Once we go one release with this turned on, we can
enable the exception for all builds.
2014-10-27 07:38:18 -06:00
Kevin Sawicki
06698c880f Access value on token 2014-10-24 13:31:43 -07:00
Kevin Sawicki
05dc9aad89 💄 2014-10-24 13:31:43 -07:00
Kevin Sawicki
e5660e5e83 🐎 Only use String::substr for pair chars 2014-10-24 13:31:43 -07:00
Kevin Sawicki
e928447eab Stored paired characters in width cache
Previously characters were treated individually even when multiple
characters would render as a single character on screen.
2014-10-24 13:31:43 -07:00
Ben Ogle
16ad957609 scopeDescriptor -> scopes
Now that we have a real ScopeDescriptor object, 
these should change back!
2014-10-21 11:38:43 -07:00
Ben Ogle
ce2959c0b9 Return ScopeDescriptor objects 2014-10-20 17:49:02 -07:00
Kevin Sawicki
8c136b18c2 Set targetLeft to Infinity when past last row 2014-10-17 14:00:25 -07:00
Kevin Sawicki
f81bc4b870 Never break when past the last row 2014-10-17 14:00:25 -07:00
Adam Boesch
111b956f93 Fix cursor not being able to move within the last line of text. 2014-10-17 14:00:25 -07:00
Adam Boesch
88a95ad06b Fix cursor so clicking the below the last line of text puts the cursor at
the end of the last line.
2014-10-17 14:00:25 -07:00
Ben Ogle
c0091b4601 scopes -> scopeDescriptor
!!!
2014-10-13 16:30:41 -07:00