65 Commits

Author SHA1 Message Date
Machiste Quintana
5d2392ea67 👕 Fix new coffeelint errors 2015-04-06 23:59:54 -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
Kevin Sawicki
ec0681ed36 Merge pull request #6038 from atom/ks-remove-unwanted-loop-returns
Remove unwanted loop returns
2015-03-19 14:16:26 -07:00
Nathan Sobo
2bfd30c832 Revert "Revert "Don't soft-wrap on indentation"" 2015-03-19 14:37:39 -06:00
Kevin Sawicki
d9a5aff919 Add explicit return after for loop 2015-03-19 11:48:40 -07:00
Nathan Sobo
6345799cf3 Revert "Don't soft-wrap on indentation" 2015-03-19 12:47:58 -06:00
Antonio Scandurra
0e0eeb3426 🔥 Delete TokenizedLine#isColumnOutsideIndentation 2015-03-19 12:23:10 +01:00
Antonio Scandurra
03b526a76b 🎨 Use only @firstNonWhitespaceIndex 2015-03-19 11:52:10 +01:00
Antonio Scandurra
56020b11b0 🐛 Avoid soft-wrapping on indentation 2015-03-19 11:36:55 +01:00
Antonio Scandurra
522e82ebf1 🎨 Refactor buildSoftWrapIndentationTokens
...as suggested by @nathansobo 
2015-03-18 18:07:07 +01:00
Antonio Scandurra
f5e1e40edd Avoid named parameter to save an allocation 2015-03-18 17:44:35 +01:00
Antonio Scandurra
7c33b9bf41 🎨 Rename to softWrapHangingIndent 2015-03-18 14:18:27 +01:00
Antonio Scandurra
ae2c92a1dc 📝 2015-03-18 11:29:39 +01:00
Antonio Scandurra
f0b9bb7ce3 Show indent guides on hanging indentation too 2015-03-18 11:17:34 +01:00
Antonio Scandurra
6d39bd3657 Verify that hanging indentation is tokenized 2015-03-17 22:21:07 +01:00
Antonio Scandurra
67b1d7890b Add soft-wrap hanging indentation spaces 2015-03-17 22:05:43 +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
0bf0c0527f Don’t tokenize spaces preceding combining chars as leading whitespace
Fixes #5349
2015-02-24 12:10:25 -07:00
Antonio Scandurra
0b777e3ccc Take into account odd spaces as well 2015-02-20 12:32:30 +01:00
Antonio Scandurra
0258531a3c Use softWrapIndentation name consistently 2015-02-20 10:28:27 +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
d3b7ea475f Rename phantomTab to indentToken 2015-02-19 18:58:38 +01:00
Antonio Scandurra
ac6a7bb47f Rename to Token#buildSoftWrapIndentToken 2015-02-19 18:06:20 +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
88ca44d53b Use guard clauses, instead of crappy ANDs 2015-02-16 17:56:36 +01:00
Antonio Scandurra
e62e26a3c2 Wrap on words, not chars 2015-02-16 17:45:57 +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
46fca8360b Use @tabLength instead of an arbitrary value 2015-02-16 11:58:21 +01:00
Antonio Scandurra
7f1bb69580 Initial attempt 2015-02-14 19:04:53 +01:00
Nathan Sobo
0081fa283e Cache .foldable on tokenized lines based on block comments
Still need to handle indentation
2015-02-06 14:53:07 -07:00
Jason Woods
2e72790e72 🐛 Fix ident guides missing on whitespace only lines with invis chars 2015-02-01 18:13:39 +00: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
c0091b4601 scopes -> scopeDescriptor
!!!
2014-10-13 16:30:41 -07:00
Nathan Sobo
6c52bcf20c Assign ::firstNonWhitespace/TrailingWhitespaceIndex in Token::split
Fixes #3277
2014-08-15 12:58:27 -06:00
Nathan Sobo
c74f6bb615 Remove handling of invisibles from EditorComponent 2014-08-13 16:31:40 -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
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
Ben Ogle
d97eacc2f9 Add isOnlyWhitespace() 2014-07-01 10:54:36 -07:00
Kevin Sawicki
a497b0f90f 💄 Use trailing for loop 2014-06-18 16:42:36 -07:00
Kevin Sawicki
ec8805e99e Merge branch 'master' of https://github.com/a-m-s/atom into ks-align-hard-tabs
Conflicts:
	src/tokenized-line.coffee
2014-06-18 16:09:07 -07:00
Nathan Sobo
0ad26c337a Don't use _.pluck when building TokenizedLines 2014-05-19 22:20:57 -06:00
Andrew Stubbs
1fe6c498ac Make hard tabs align to columns. 2014-05-14 13:31:03 +01:00
Nathan Sobo
28dd7d4acd Treat all whitespace lines as not having leading whitespace
Instead it's treated as all trailing whitespace, as it was originally.
2014-04-22 17:09:41 -06:00