Commit Graph

7591 Commits

Author SHA1 Message Date
probablycorey
49aeef99b6 Add config option editor.normalizeIndentOnPaste 2013-05-13 14:28:16 -07:00
probablycorey
8e37d2ada6 Turn auto-indent on for all 'newline' specs 2013-05-13 14:28:16 -07:00
probablycorey
7513fe9c69 Set editor.autoIndent to true in specs 2013-05-13 14:28:16 -07:00
probablycorey
34d3091fc9 Remove console.log 2013-05-13 14:28:16 -07:00
probablycorey
992f520698 Normalize pasted text when there is an indent basis 2013-05-13 14:28:16 -07:00
probablycorey
b23e1d3d52 In specs, use local copyText function to put text on the pasteboard 2013-05-13 14:28:16 -07:00
probablycorey
dd53539799 Moving auto-indent specs to appropriate places 2013-05-13 14:28:15 -07:00
probablycorey
93b1ce53c0 Rename autoDecreaseIndentForRow to autoDecreaseIndentForBufferRow 2013-05-13 14:28:15 -07:00
probablycorey
e70d6d1f8f Remove unused method autoIncreaseIndentForBufferRow 2013-05-13 14:28:15 -07:00
probablycorey
c34db290e4 Only indent the line following a '\n' not the line preceding it 2013-05-13 14:28:15 -07:00
probablycorey
9d2b7875b9 💄 2013-05-13 14:28:15 -07:00
probablycorey
1f025817f1 Rename autoIndentNewlines to autoIndentNewline 2013-05-13 14:28:15 -07:00
probablycorey
38d4e3a097 Move all auto-indent specs to the auto-indent describe block 2013-05-13 14:28:15 -07:00
probablycorey
c03d44da00 Add autoIndentNewline and autoDecreaseIndent options to insertText
insertText now takes these options:
* autoIndent will auto indent all inserted text based
* autoIndentNewline will indent a line when a '\n' is inserted
* autoDecreaseIndent will decrease the indent if the line matches a 
decreaseIndent pattern (such as a `}` in javavascript)
2013-05-13 14:28:15 -07:00
probablycorey
537c507efe Use suggested indent when auto indenting a buffer row 2013-05-13 14:28:15 -07:00
probablycorey
0fbd08f1ab Allow suggested indent level to be less than the current indent level 2013-05-13 14:28:15 -07:00
probablycorey
0f469a3269 Add Range.getRows 2013-05-13 14:28:15 -07:00
probablycorey
9713bc8c02 💄 2013-05-13 14:28:15 -07:00
probablycorey
7f0b2c54f3 editor.autoIndentOnPaste will auto indent every pasted line
I've removed normalizeLines and its tests. They will be added back in
a later commit.
2013-05-13 14:28:14 -07:00
probablycorey
e9fd61a1ea Remove unused indent methods from Selection 2013-05-13 14:28:14 -07:00
probablycorey
33c95d1a58 Rename insideExistingLine to isCursorInsideExistingLine 2013-05-13 14:28:14 -07:00
probablycorey
c5aa670569 Document methods as internal 2013-05-13 14:28:14 -07:00
probablycorey
533b11f991 💄 2013-05-13 14:28:14 -07:00
Kevin Sawicki
ebb68c3386 Mention new icon 2013-05-13 09:33:17 -07:00
Nathan Sobo
c876876d5e Upgrade the icon 2013-05-11 10:35:45 -06:00
Nathan Sobo
7dde2fec55 Fix wrap guide spec again. Previously it only passed w/ a wide window. 2013-05-11 09:08:10 -06:00
Nathan Sobo
49cf92c2a2 Fix perf regression: Don't update line numbers for single line changes 2013-05-10 19:39:33 -06:00
Nathan Sobo
60319c30ac Fix wrap guide specs after panes css change 2013-05-10 18:30:01 -06:00
Nathan Sobo
191e8ab240 Fix perf regression caused by flex-flow: column on pane item views
For some reason, having flex-flow column on the pane item views
container was forcing the entire view to be repainted on cursor
movement and line edits. Allowing the container to flow row-wise and
setting the min-height to 0 instead of min-content-height achieves
the same layout effect without the huge repaint cost. Flexbox is a
fragile bitch.
2013-05-10 18:19:41 -06:00
Nathan Sobo
b4dec8ccbb In Editor.updateRenderedLines, cap renderFrom to the last screen row
If we remove a large number of screen lines when we are scrolled down,
the current @firstRenderedScreenRow may end up being larger than the
number of screen rows we now have. Setting renderFrom to the
@firstRenderedScreenRow in this case was causing the renderFrom to be
larger than the renderTo, which was causing problems downstream with
the new mapping code.
2013-05-10 13:20:43 -06:00
Nathan Sobo
7d28edc116 Rename ScreenLine -> TokenizedLine
Now that ScreenLines don't contain the bufferRows property, which was
essential to the functioning of the LineMap, they're just containers
for tokens. Since they're stored in the TokenizedBuffer in a form that
doesn't necessarily match what ends up on screen, it makes more sense
to call them tokenized lines. A tokenized line is a screen line if it's
in the `.screenLines` array of the DisplayBuffer, but "screenness" is
not an inherent property, so it shouldn't be in the name of the class.
2013-05-10 13:20:43 -06:00
Nathan Sobo
4d314f99ac Eliminate ScreenLine.bufferRows property
Previously, we used bufferRows to determine how many buffer rows were
spanned by the screen line in the event it was folded. Now that we have
RowMap, screen lines don't need to serve this purpose. We still need
to know if a screen line is wrapped, which we solve via setting the
lineEnd property to null for a soft-wrapped screen line.
2013-05-10 13:20:43 -06:00
Nathan Sobo
1d146640e5 Break some methods out of DisplayBuffer.updateScreenLines 2013-05-10 13:20:43 -06:00
Nathan Sobo
b4c95d4fc9 Merge adjacent isomorphic regions after adding new regions 2013-05-10 13:20:42 -06:00
Nathan Sobo
d9c258f27e Handle new regions overlapping screen wise but not buffer wise 2013-05-10 13:20:42 -06:00
Nathan Sobo
4a56cc3693 Kick docs threshold down again because I removed public methods 2013-05-10 13:20:42 -06:00
Nathan Sobo
8b149ff827 Delete LineMap 2013-05-10 13:20:42 -06:00
Nathan Sobo
f3145e671a Declare screenLines ivar in DisplayBuffer 2013-05-10 13:20:42 -06:00
Nathan Sobo
d3cb001d65 Use RowMap instead of LineMap in DisplayBuffer 2013-05-10 13:20:42 -06:00
Nathan Sobo
16da9b0506 Document RowMap 2013-05-10 13:20:42 -06:00
Nathan Sobo
d7914d2c54 Ensure row map applies negative deltas only after the given start row 2013-05-10 13:20:42 -06:00
Nathan Sobo
9849c62d80 Properly handle regions that straddle existing regions
When we're creating folds that contain other folds, we'll need the
region based on the new fold's row mapping to overwrite the regions
from the old folds. This commit ensures that the new region cleanly
slots in, replacing any regions it completely contains and splitting
regions that it only partially overlaps.
2013-05-10 13:20:42 -06:00
Nathan Sobo
3c630fb7f4 Rename mapping -> region within RowMap 2013-05-10 13:20:42 -06:00
Nathan Sobo
55f0b6a1f8 Replace existing regions when inserting a mapping that surrounds them 2013-05-10 13:20:42 -06:00
Nathan Sobo
1b21fdda3b Don't throw errors when applying screen deltas after the last mapping 2013-05-10 13:20:41 -06:00
Nathan Sobo
c17d6ba487 Adjust multiple mappings if needed when applying screen deltas
If there are multiple mappings following the start row of the delta
that span fewer screen rows than the delta, we collapse mappings to 0
screen rows until we have removed the number of rows specified by the
delta.

Expanding positive deltas expands the first mapping following the
start row as it did previously.
2013-05-10 13:20:41 -06:00
Nathan Sobo
c6ff7e8934 Inserting a mapping within an existing mapping preserves its shape
Inserting a mapping should never change the position of any existing
mappings on screen or in the buffer. It's simply a statement about a
range of rows in the buffer mapping to a range of existing rows on
screen, but shouldn't add or remove any rows. Adding and removing rows
on screen or in the buffer is the job of the applyBufferDelta and
applyScreenDelta methods.
2013-05-10 13:20:41 -06:00
Nathan Sobo
1895e8143d Allow the screen row count of N-screen:1-buffer mappings to be updated 2013-05-10 13:20:41 -06:00
Nathan Sobo
5c74a02688 Add row map specs for mappings of N screen rows to 1 buffer row 2013-05-10 13:20:41 -06:00
Nathan Sobo
2f900e11ed Add RowMap.bufferRowRangeForScreenRow 2013-05-10 13:20:41 -06:00