Commit Graph

2599 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
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
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
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
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
533b11f991 💄 2013-05-13 14:28:14 -07: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
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
d3cb001d65 Use RowMap instead of LineMap in DisplayBuffer 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
Nathan Sobo
32b40fe1ad Eliminate dummy implementation of bufferRowRangeForScreenRow 2013-05-10 13:20:41 -06:00
Nathan Sobo
9a12b170f6 Allow insertion of multiple buffer row range mappings 2013-05-10 13:20:41 -06:00
Nathan Sobo
9f4b594bd0 Start on RowMap 2013-05-10 13:20:41 -06:00
Nathan Sobo
b4206d3202 Merge branch 'master' into know-when-to-foldem
Conflicts:
	src/app/edit-session.coffee
2013-05-06 08:35:13 -06:00
Nathan Sobo
e8e0d5dd02 Fix regression: folds can be destroyed by clicking them 2013-05-06 08:27:43 -06:00
Nathan Sobo
3e937e9811 Merge remote-tracking branch 'origin/master' into know-when-to-foldem
Conflicts:
	src/app/buffer-marker.coffee
	src/app/cursor.coffee
	src/app/display-buffer-marker.coffee
	src/app/display-buffer.coffee
	src/app/edit-session.coffee
	src/app/fold.coffee
	src/app/line-map.coffee
	src/app/range.coffee
	src/app/selection.coffee
	src/app/text-buffer.coffee
2013-05-03 18:29:52 -06:00
Garen Torikian
252682dd99 Syntax highlight based entirely on editor colors 2013-05-03 16:57:42 -07:00
Garen Torikian
95e14486af Fix specs for testing highlighted lines 2013-05-03 16:57:42 -07:00
Garen Torikian
dd041945d2 Transform specs to something useful 2013-05-03 16:57:41 -07:00
Nathan Sobo
ebfd8ca4c3 Give docs errors a better failure message 2013-05-03 17:34:48 -06:00
Corey Johnson & Nathan Sobo
da938d8212 Fix edit session specs concerning delete/backspace + folds 2013-05-03 17:24:08 -06:00
probablycorey
c13b291c64 Update config panel spec 2013-05-02 12:05:56 -07:00
probablycorey
70191ea368 Don't store config values that equal their default config value
If 'foo' has not been set and has a default value of 1, 
config.set('foo', 1) will not store the 1.

If 'foo' has been set to X and has a default value of 1, 
config.set('foo', 1) will remove 'foo' from config
2013-05-02 12:05:56 -07:00
Kevin Sawicki
10ca03f238 Don't show indent guide in truly trailing whitespace
Lines that are all whitespace are considered trailing
whitespace and should display the indent guide.

But lines with leading and trailing whitespace should never
have the indent guide rendered in the trailing area.
2013-05-02 11:44:49 -07:00
Kevin Sawicki
ee621bcace Bind link click handler in window.handleEvents() 2013-05-01 22:18:39 -07:00
Kevin Sawicki
4dce9d659f Open http/https links in an external browser
Listen for all links being clicked and open any http/https
hrefs by spawning a call to the 'open' command.

Closes #531
2013-05-01 21:36:36 -07:00
Kevin Sawicki
35cf96e15f Render empty line invisibles at correct position
End of line invisibles are not rendered at the correct
position for empty lines instead of always after the
last indent guide span.

Closes #456
2013-05-01 20:54:09 -07:00
Nathan Sobo
69300e0766 Make Buffer.transact restore marker ranges on undo/redo of transaction
We no longer need to restore selection ranges before and after
transactions now because selections are based on markers so they go
along for the ride for free. This allows us to delegate directly to
Buffer.transact from EditSession.
2013-05-01 18:38:40 -06:00
Nathan Sobo
988f4da6e1 Always restore marker ranges on undo/redo, even for valid markers 2013-05-01 17:32:39 -06:00
Nathan Sobo
f48ee846e9 💄 2013-05-01 17:23:21 -06:00
Nathan Sobo
a9c599abeb Isolate folds on a per-display-buffer basis
Creating a fold in one pane now has no effect on an edit session
for the same buffer in another pane. Before they were polluting each
other by sharing the same fold markers.
2013-05-01 16:24:32 -06:00