Commit Graph

2743 Commits

Author SHA1 Message Date
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
probablycorey
0be166bb59 Remove the bottomPaddingInLines from editor 2013-05-01 13:54:37 -07:00
probablycorey
cb2d24baca Listen for clicks outside of the render lines on the underlayer 2013-05-01 13:54:37 -07:00
Kevin Sawicki
536beb0d40 Support setting number fields to 0
Previously entering 0 would end up as '0' in the config
value instead of as a numeric value.
2013-04-30 23:10:22 -07:00
Kevin Sawicki
334c4095bb Write empty object values on same line as keys 2013-04-30 22:43:51 -07:00
Kevin Sawicki
986e5f9c7a Default to 80 when editor.preferredLineLength <= 0
Previously any non-null value would be used as the target
column in the wrap guide and autoflow packages when really
80 should have been used if the value was non-postive.

Now config.getPositiveInt() is called with a default value
of 80 if the current value isn't already positive.
2013-04-30 22:37:02 -07:00
Kevin Sawicki
f417e898f6 Only call save on active item when it exists
Closes #529
2013-04-30 22:02:46 -07:00
Kevin Sawicki
047d9525e7 Ignore first modified event in config editor
This event comes from initially setting the text for the current
config value on the editor and was causing the config to be
immediately saved multiple times when opened.
2013-04-30 21:55:43 -07:00
Kevin Sawicki
ca7da8a0da Don't set un-parseable numbers to 0 in the config
Previously if an integer or float field was empty it would
default to zero instead of undefined which made it inconsistent
with string value fields.

Now the config value is only set as a Number when it can be
parsed as one.
2013-04-30 21:36:27 -07:00
Nathan Sobo
693c4f8270 Preserve folds when restoring selections on undo/redo 2013-04-30 18:39:54 -06:00
Nathan Sobo
df08c14aef Restore markers before triggering buffer events
This allows folds to be restored on undo/redo
2013-04-30 18:21:37 -06:00
Nathan Sobo
9086171f45 💄 2013-04-30 18:14:13 -06:00
Nathan Sobo
9aec992693 Hold marker [in]validation events until after buffer change events
For a while, the goal has been to prevent marker update events from
firing until after the buffer change event. But at the same time, we
want all the markers to be updated when the buffer change fires. This
commit irons out some issues for markers that are invalidated or
revalidated by the change, making their behavior consistent with the
rest of marker updates.
2013-04-30 17:37:28 -06:00
Nathan Sobo
2e77f0ed7d Eliminate special behavior for changes straddling start / end of folds
Previously, we were attempting to preserve the fold and adjust in an
intuitive way in the face of changes that straddled the beginning or
the end of the fold. That added complexity… we would have to add a new
marker invalidation strategy to support it and I'm not convinced it's
actually a big deal to destroy folds in the face of straddling changes.
So that's what we do now.
2013-04-30 14:28:42 -06:00
probablycorey
af5392b8ac Add extra padding to the bottom of an editor's vertical scrollbar
This gives us some space when we scroll to the bottom of a file.
Similar to how MacVim works when using the mouse.

Closes #464
2013-04-30 11:52:28 -07:00
probablycorey
471ac4976f Test correct editor in font size spec 2013-04-30 11:52:28 -07:00
probablycorey
16c892caa6 Update click and drag spec
Stop relying on setInterval to trigger the scroll events in the spec. Instead simulate the mouse moving at the top of the screen. I found 
testing the setInterval approach required so much mocking that it 
wasn't worth it.
2013-04-30 11:52:28 -07:00
Nathan Sobo
9f8a07fc27 Fix some edit session specs. The remaining failures are less trivial. 2013-04-30 04:43:28 -06:00
Nathan Sobo
1f9e33d995 WIP: Base folds on markers.
Still a couple of specs failing on this for changes that straddle the
start / end of a fold. We need a new marker invalidation strategy for
these cases.
2013-04-30 04:30:08 -06:00
Nathan Sobo
32178541fe Emit 'destroyed' events from display buffer markers 2013-04-29 21:01:48 -06:00
Nathan Sobo
51e915c423 Replace marker 'observe' methods w/ ordinary 'changed' event 2013-04-29 21:01:48 -06:00
Nathan Sobo
4ca00f7347 Simplify marker events
Instead of marker-added and marker-removed events which are emitted
when markers are created/invalidated/revalidated/destroyed, we now
just have marker-created events that are triggered *only* when markers
are created for the first time. The marker itself emits a 'destroyed'
event when it is destroyed. The marker already notifies observers when
its validation status changes, so that's covered.
2013-04-29 21:01:48 -06:00
Nathan Sobo
b2d34d93ab Emit 'marker-added/removed' events on DisplayBuffer 2013-04-29 21:01:48 -06:00
Nathan Sobo
3a39c92ae4 Emit 'marker-added/removed' events when buffer marker validity changes 2013-04-29 21:01:48 -06:00
Nathan Sobo
883127f0d6 Emit 'marker-added/removed' when buffer markers are created/destroyed 2013-04-29 21:01:48 -06:00
Nathan Sobo
3b52cd018b Reduce documentation threshold
I deleted a bunch of documented methods. I haven't added any new
undocumented methods, but now there are fewer overall documented
methods, which is breaking the docs threshold spec. I don't think it
makes sense to start documenting non-related methods in this branch
right now.
2013-04-29 21:01:48 -06:00
Nathan Sobo
2d1cb8b519 Fix selection spec to to check marker destruction properly 2013-04-29 21:01:47 -06:00
Nathan Sobo
caf34d6a3a EditSession.selectMarker checks if the marker is valid
Also, it returns the selected range if it's valid, and otherwise
returns a falsy value. This has more utility than just true/false.
2013-04-29 21:01:47 -06:00
Nathan Sobo
d466abdc64 Fix DisplayBuffer spec 2013-04-29 21:01:47 -06:00
Nathan Sobo
f4be899ae9 Switch EditSession over to object-oriented markers API 2013-04-29 21:01:47 -06:00
Nathan Sobo
5403bc647a Convert display buffer markers to object-oriented API 2013-04-29 21:01:47 -06:00
Nathan Sobo
482eb6c0de Give TextBuffer an object-oriented marker interface
The previous API revolved around methods on TextBuffer for querying
and manipulating markers based on their id. Now marker creation
methods return marker objects. These are still retrievable by id so
they can be dealt with across serialization boundaries in the future,
but you deal with them directly as objects.
2013-04-29 21:01:47 -06:00
Nathan Sobo
e02e4cd975 Add DisplayBuffer.findMarker[s] 2013-04-29 21:01:47 -06:00
Nathan Sobo
64aaf670ed Add startRow and endRow special attributes to TextBuffer.findMarker[s] 2013-04-29 21:01:46 -06:00
Nathan Sobo
0f0480b79f Add Buffer.findMarker[s], which returns marker[s] matching attributes 2013-04-29 21:01:46 -06:00
Nathan Sobo
df6feab346 Add Range.compare 2013-04-29 21:01:46 -06:00
Corey Johnson
9180060920 Revert "Listen for mouse events on scrollView instead of renderedLines"
You can't listen on scroll view because that makes
it impossible to scroll using the scrollbar

Opens #464

This reverts commit fdae5fd89c.
2013-04-29 15:07:38 -07:00
Corey Johnson
fdae5fd89c Listen for mouse events on scrollView instead of renderedLines
It was not possible to click on the lower part of the last line
when the editor was scrollable and listening for mousedown events on renderedLines.

Closes #464
2013-04-29 14:59:23 -07:00
Corey Johnson
8e218de3e7 💄 2013-04-29 14:59:23 -07:00
Corey Johnson & Kevin Sawicki
0d8a6782b3 Stop tokenizing line when the same rule is pushed more than once
Previously Rails classes would infinitly loop if the Ruby on Rails
grammar was loaded but the Ruby grammar had not been. This occurred
because a rule was continually pushing itself on the stack but never
advancing.

Now if the position does not advance and the last two rules in the
stack have the same scope the last rule is popped and the entire line
is tokenized with the current scopes.

Closes #524 #486
2013-04-29 12:10:40 -07:00
Kevin Sawicki
5a84814e27 Undasherize the namespace when no event exists
This would present the new-window event as "New Window"
instead of "New-window".
2013-04-29 10:49:31 -07:00
Kevin Sawicki
df6809e705 Bind meta-N to open a new untitled editor 2013-04-29 10:27:39 -07:00
Kevin Sawicki
c54766a08a Don't show indent guide in mini editor 2013-04-26 17:31:54 -07:00
probablycorey
9f85ba4f7d Empty editors trigger config to delete the associated config key 2013-04-26 15:36:58 -07:00
Corey Johnson & Nathan Sobo
1b98bf706e Setting value to null/undefined removes key from config 2013-04-26 15:36:58 -07:00
Corey Johnson & Nathan Sobo
c923b561e2 💄 2013-04-26 15:36:57 -07:00
probablycorey
ecad6bc2a8 Don't allow float or int Editor's to have NaN as a value 2013-04-26 15:36:57 -07:00
probablycorey
cedea831f7 Config panel handles binding for Editors 2013-04-26 15:36:57 -07:00
Nathan Sobo
232978ea9d Themes can be disabled by clicking their 'x' icon in the enabled list 2013-04-26 15:36:14 -07:00
Nathan Sobo
ad0bcc3851 Update enabled themes list when config key is updated 2013-04-26 15:36:13 -07:00
Nathan Sobo
b110f430ee Update 'config.themes' config key when enabled themes list is sorted 2013-04-26 15:36:13 -07:00
Nathan Sobo
0d520e9930 Add a package config panel with the list of enabled packages 2013-04-26 15:36:13 -07:00
Nathan Sobo
b70ff1b164 Don't assign window.jQuery in jasmine-jquery.js helper
I wrap it in a function wrapper to ensure that the assignment
`var jQuery` doesn't end up assigning a window global.
2013-04-26 15:36:13 -07:00
Nathan Sobo
5a291e8188 Use bootstrap stacked nav-pills for panels menu in config window 2013-04-26 15:36:12 -07:00
Nathan Sobo
c90579956f Un-f 2013-04-26 15:36:11 -07:00
Nathan Sobo
495230435f Allow packages to be enabled / disabled from general config panel 2013-04-26 15:36:11 -07:00
Nathan Sobo
f0cddf9f32 Serialize the state of the config window on refresh 2013-04-26 15:36:11 -07:00
Nathan Sobo
422d89a7ed Handle checkbox fields in config panel 2013-04-26 15:34:48 -07:00
Nathan Sobo
5e0dd80366 Remove overkill assertions 2013-04-26 15:34:48 -07:00
Nathan Sobo
bb287cb465 Add ConfigPanel superclass that can bind fields to config values
When you give a config field a `name` attribute based on a config key
path, such as 'editor.fontSize', it is automatically kept in sync with
the config value. You can also specify a `type` attribute of 'int' or
'float' to automatically convert the field value to a numeric type.
Specifying a type of 'string' is optional to signal no conversion.
2013-04-26 15:32:47 -07:00
Nathan Sobo
252159afcf Add super basic styling to config view and 2 non-functional panels 2013-04-26 15:32:47 -07:00
Nathan Sobo
6c43fd5c9d Set up dev tools event handler when binding default keys 2013-04-26 15:32:47 -07:00
Nathan Sobo
2f60ffcfce Add ability to add panels to the config view 2013-04-26 15:32:47 -07:00
Nathan Sobo
8980a97895 Add atom.activatePackageConfig, which is called in config windows
This calls an optional `activateConfig` method on the package's main
module, which allows it to add a configuration interface to the
`configView`.
2013-04-26 15:32:47 -07:00
Nathan Sobo
9d2d3d5c00 Rename window methods to distinguish editor window from config window 2013-04-26 15:32:46 -07:00
Nathan Sobo
f62e81bca8 Add config.observeUserConfig 2013-04-26 15:32:46 -07:00
Nathan Sobo
ab1b90804e Add specs for successful calls to .loadUserConfig 2013-04-26 15:31:18 -07:00
Nathan Sobo
9fe264ded4 💄 2013-04-26 15:31:18 -07:00
Nathan Sobo
3a05731f2d Eliminate EditSession references from tokenized-buffer-spec 2013-04-25 17:16:51 -06:00
Nathan Sobo
9c7ff78fc8 Move language-specific integration tests to text-mate-grammar-spec 2013-04-25 17:15:27 -06:00
Nathan Sobo
4fdc9fba63 Eliminate EditSession dependencies in DisplayBuffer spec 2013-04-25 16:18:39 -06:00
Nathan Sobo
0d78098dbf Make TokenizedBuffer select its own grammar, not LanguageMode
This is part of an effort to disentangle LanguageMode, DisplayBuffer,
and TokenizedBuffer. It should be easy to create a DisplayBuffer
without creating an EditSession… let's get the dependencies flowing
in a single direction.
2013-04-25 15:13:00 -06:00
Nathan Sobo
0f623b3d08 Move structural folding logic to LanguageMode
DisplayBuffer should just focus on providing basic support for folding.
Scanning the structure of the code, looking at scopes, etc is more the
domain of the LanguageMode object.
2013-04-25 14:06:53 -06:00
Nathan Sobo
60f945aafd Move structural folding specs to edit-session-spec
Structural folding should really be handled at the edit session level
so that the DisplayBuffer doesn't need access to the LanguageMode. It
should only be concerned with the raw ability to create folds.
2013-04-25 14:06:53 -06:00
Nathan Sobo
ca3b0c97da 💄 getter renames 2013-04-25 14:06:52 -06:00
Kevin Sawicki
875555d933 Rename invisible class to invisible-character
Bootstrap defines this class with visibility: hidden
which we don't want since invisible characters should
be visible.
2013-04-25 10:02:33 -07:00
Kevin Sawicki
2803da2f8b Replace offsUtilscreen with offscreen 2013-04-24 17:59:50 -07:00
Kevin Sawicki
4e8c6e29ad Use @ instead of this. 2013-04-24 17:57:59 -07:00
Corey Johnson & Nathan Sobo
24ce415283 Move event listener calls from resetDisplay to edit
Fixes #140
2013-04-24 11:41:56 -07:00
probablycorey
9cc4c2e5de Allow off to be called before on without error
Previously calling `something.off 'event-name', handler` would throw
an error unless `on` was called first.
2013-04-24 11:41:56 -07:00
Kevin Sawicki
b65e1485a7 Copy folders to ~/.atom directory asynchronously 2013-04-24 10:12:30 -07:00
Kevin Sawicki
2f5a99fac2 Install atom command asynchronously 2013-04-24 10:12:29 -07:00
Corey Johnson & Nathan Sobo
9f235103f8 Add _.spliceWithArray to avoid stack overflows when splicing huge arrays 2013-04-23 11:16:55 -07:00
Kevin Sawicki & Nathan Sobo
125c41a2e2 Support space-separated event names in EventEmitter.on()/off() 2013-04-23 08:39:26 -07:00
Kevin Sawicki & Nathan Sobo
b9ad462c69 Retokenize when grammar with matching injection selector is updated 2013-04-23 08:39:26 -07:00
Kevin Sawicki & Nathan Sobo
0d35943386 Retokenize when grammar with matching injection selector is loaded 2013-04-23 08:39:26 -07:00
Kevin Sawicki
f0cf337857 Support grammars with an injectionSelector
These grammars can now contribute rules to other grammars when
their selector matches the current scope stack.
2013-04-23 08:39:26 -07:00
Kevin Sawicki
63d665e2cb Replace capture groups in pattern names with match 2013-04-23 08:39:25 -07:00
Nathan Sobo
35f0b7b49e Fix #505. Update grammars if any included grammars are updated. 2013-04-22 11:34:03 -06:00
Nathan Sobo
444325893b Allow subscribers to unsubscribe on a per-object basis
This makes use of the new ES6 WeakMap feature, which allows for a hash
map that's keyed by object.
2013-04-22 11:34:03 -06:00
Nathan Sobo
93910201b0 Re-tokenize buffer when its grammar is updated
This can happen if a grammar that the grammar includes is added or
removed from the syntax global.
2013-04-22 11:34:03 -06:00
Nathan Sobo
9204836d70 Update grammars when grammars they include are added/removed
If the Ruby on Rails grammar depends on HTML, but it isn't loaded, its
syntax highlighting won't include HTMl tokens. If we later load HTML,
we should update any buffer with the Rails grammar to reflect the
change. This commit changes grammars to memoize their initial rule and
repository. If an included grammar is added or removed, we clear the
memoized rules and emit a 'grammar-updated' event. Any tokenized
buffer that points to this grammar can then retokenize to reflect the
newly available/unavailable included grammar.
2013-04-22 11:33:59 -06:00
Kevin Sawicki
62c94959e1 Move injections spec to TextMateGrammar spec
This spec was previously in the TokenizeBuffer spec which
required having a PHP fixture and setting up an edit session
to verify a line could be tokenized which was unnecessary.
2013-04-19 10:58:35 -07:00
Kevin Sawicki & Nathan Sobo
1f4febcfaf Ignore child captures of captures with patterns 2013-04-19 10:58:35 -07:00
Kevin Sawicki
c63834924a Support patterns included in captures
Previously only the capture's name was considered when processing
tokens for capture indices.

Now the capture's patterns are matched against the captured region
if they exist.
2013-04-19 10:58:35 -07:00
Kevin Sawicki
9489ec6787 Add specs for & selectors 2013-04-19 10:58:35 -07:00
Kevin Sawicki & Nathan Sobo
1dffb9237a Use the earliest result when both injection and non-injection patterns match 2013-04-19 10:58:34 -07:00
Kevin Sawicki
c2eca1ff99 Add initial support for injection grammars
Build scope selectors and patterns when setting up the grammar
for all entries under the grammar's injection object.

Include the injection patterns in the scanner when the injection's
scope selector matches the current rule stack.
2013-04-19 10:58:34 -07:00
Kevin Sawicki
beeaa01d22 Support space-separated scopes in selector parser 2013-04-19 10:58:33 -07:00
Kevin Sawicki
3e5448b698 Add initial TextMate scope selector parser 2013-04-19 10:58:33 -07:00
Kevin Sawicki
4b48e07f83 Specify cwd instead of cd'ing 2013-04-18 20:41:17 -07:00
Kevin Sawicki
b5474790cb Remove unused imports 2013-04-18 20:18:37 -07:00
Garen Torikian
42290e87f8 80 is good. 2013-04-18 18:51:46 -07:00
Garen Torikian
cabee75f8a 💄 2013-04-18 15:02:22 -07:00
Garen Torikian
0acccc383e Remove test for folder not documented 2013-04-18 13:24:55 -07:00
Garen Torikian
130baf2235 Merge branch 'master' into api/docs 2013-04-17 16:08:18 -07:00
Nathan Sobo
fff4531663 Fix select-list auto-scrolling specs 2013-04-15 20:45:55 -06:00
Nathan Sobo
bc03810589 Set height on image view, not parent
Setting the height of the parent caused #jasmine-content to be tall
for the remainder of the specs
2013-04-15 20:45:55 -06:00
Nathan Sobo
d82daeccee Fix jasmine styling 2013-04-15 20:45:55 -06:00
Garen Torikian
4c56e8bb57 Merge branch 'master' into api/docs 2013-04-14 09:43:06 -07:00
Kevin Sawicki
7b42e975fb Include hidden files when running nak 2013-04-12 11:48:44 -07:00
Kevin Sawicki
4e59605728 Don't bubble move-to-top/bottom events
This will cause the editor to scroll as well when a select
list is a child of an editor such as in the autocomplete view.
2013-04-11 10:39:19 -07:00
Garen Torikian
e0e4936756 Update spec 2013-04-11 02:14:24 -05:00
Kevin Sawicki
1ae878c000 Fire will-be-removed event from beforeRemove() 2013-04-10 17:43:26 -07:00
Garen Torikian
1142ae89aa Update spec 2013-04-10 18:02:13 -05:00
Garen Torikian
9432f9703e Merge master 2013-04-10 15:05:21 -05:00
Garen Torikian
756bb5604f Add API doc spec 2013-04-09 18:03:29 -05:00
Kevin Sawicki
53c3fa8ac8 Bind meta-< to scroll to cursor location 2013-04-09 14:33:36 -07:00
Kevin Sawicki
efb4bdd028 Remove duplicate RootView.eachPane(callback) 2013-04-09 13:36:52 -07:00
Mutwin Kraus
c91de1e515 Merge remote-tracking branch 'origin/master' into vim-core-changes
Conflicts:
	src/app/pane.coffee
2013-04-09 18:52:36 +02:00
Cheng Zhao
3c4966f6a3 Open the file dragged to window. 2013-04-09 15:37:30 +08:00
Kevin Sawicki
09b7fe72eb Detach instead of remove when moved item is the view
Moving an item that extended the jQuery object between panes
was previously wiping out all jQuery data since remove() was being
called on the view item instead of detach().
2013-04-08 18:22:58 -07:00
Kevin Sawicki
d1c9d0ea68 Focus pane after reopening it
Previously the reopened item would not have focus if it was
reopened into a newly appended pane.
2013-04-08 16:54:05 -07:00
Kevin Sawicki
2f67312a80 Don't prompt to save if buffer is opened elsewhere
This corrects a regression where closing an edit session that
is opened somewhere else should not prompt to save since it
won't be lost if closed immediately since it is still open in
another pane.
2013-04-08 16:30:35 -07:00
Kevin Sawicki
7a709b05f3 Support zooming images in/out and resetting 2013-04-08 15:36:43 -07:00
Kevin Sawicki
6ce3f87448 Add initial image viewer
An image session will be opened by project.buildEditSession()
for known image extensions.

Closes #203
2013-04-08 15:36:35 -07:00
Kevin Sawicki
e3b381f638 Add RootView.eachPane(callback) 2013-04-08 13:04:50 -07:00
Kevin Sawicki
c7175c7e5f Return top and left values of 0 when not visible 2013-04-08 13:03:19 -07:00
Kevin Sawicki
b7b4dcda24 Schedule redraw when updating an invisible editor
The redrawOnReattach flag will now be set when update
display is called on an invisible editor so that if the
editor is detached or hidden before the next update was
processed it will be performed when reattached.
2013-04-08 12:50:05 -07:00
Kevin Sawicki
503b1231db Redraw editor when it becomes the active view
Start watching for when the editor becomes the active view
once it is attached and redraw it when it does.
2013-04-08 12:00:25 -07:00
Mutwin Kraus
9041c56ef3 Spec for selectToBeginningOfNextWord 2013-04-08 14:19:28 +02:00
Mutwin Kraus
2445829f83 Specs for moveCursorToBeginningOfNextWord 2013-04-08 14:15:25 +02:00
Cheng Zhao
e0865e8c38 Use node-pathwatcher. 2013-04-07 16:35:35 +08:00
Nathan Sobo
abc5ed5190 Add editor:add-selection-above command 2013-04-05 14:52:35 -06:00
Nathan Sobo
37e16bb163 Clear multiple selections on escape
The binding uses the `!important` selector to ensure that the editor
always gets a chance to clear multiple selections before other bindings
for escape are processed.
2013-04-05 14:52:35 -06:00
Nathan Sobo
7018f33ad7 Allow !important flag in keymap selectors 2013-04-05 14:52:35 -06:00
Nathan Sobo
2efed9f42c Add EditSession.consolidateSelections() 2013-04-05 14:52:30 -06:00
Nathan Sobo
bd58834e7d Merge goal ranges when merging selections 2013-04-05 14:17:21 -06:00
Nathan Sobo
be009e87c2 Skip empty lines when adding selections below empty selections
Unless the selection's column is 0
2013-04-05 14:17:21 -06:00
Nathan Sobo
393cba4d42 Don't skip shorter lines when the adding empty selection below 2013-04-05 14:17:21 -06:00
Nathan Sobo
131df22c11 Skip lines that are too-short when adding non-empty selection below 2013-04-05 14:17:21 -06:00
Nathan Sobo
40d7fcf32c 🙊 2013-04-05 14:17:21 -06:00
Nathan Sobo
f22461e5e8 Clear goal range when selection is modified
Just like the cursor clears its goal column when it is moved in any
way other than vertically, the selection clears its goal range (the
range it will attempt to use when adding a selection below) when it
is changed in any way.
2013-04-05 14:17:20 -06:00
Nathan Sobo
f6bfab5dd7 Don't freak when selections are added & removed before display update
Previously, if a selection was added and removed before the editor got
a chance to update its display, it would try to add a selection view
for the destroyed selection. Now we check the new selections and
cursors to make sure they aren't destroyed before we add views for
them.
2013-04-05 14:17:20 -06:00
Nathan Sobo
31579703f0 Ensure new non-empty selections have an invisible cursor. 2013-04-05 14:17:20 -06:00
Nathan Sobo
af923cca9b Preserve original selection's range when adding selection's below
Just like the cursor tries to stay in its "goal column" when moving
vertically, here we try to keep the same selection even when adding
across shorter lines.
2013-04-05 14:17:20 -06:00
Nathan Sobo
26e53584c1 Add 'editor:add-selection-below' command
It still needs work, but the basic idea is for every selection to
add another another selection over the same column range of the line
below.
2013-04-05 14:17:20 -06:00
Kevin Sawicki
30fb637f86 Add spec for excluding ignored files from Project.scan() 2013-04-05 08:45:00 -07:00
Kevin Sawicki
84107317bb Support opening non-existent files from the CLI
This required changing text-buffer to support having a
path but not underlying file that exists yet.

Now calling RootView.open() with a non-existed path will
open a dirty empty editor to the path and the file will be
created on first save.
2013-04-04 17:08:05 -07:00
Kevin Sawicki
e442dfff11 Support joining editor lines with ctrl-J
This can be used with or without a selection to join one
or more lines with the line below it separated by a space.

Refs #134
2013-04-04 11:07:59 -07:00
Kevin Sawicki
9773751e79 Delete left when meta-backspacing at start of line
Previously EditSession.backspaceToBeginningOfLine() would do nothing
if at the beginning of the line.

Now it selects left and does a delete so it can be used to delete
multiple lines continuously without having to move the cursor.

Refs #134
2013-04-04 09:25:35 -07:00
Corey Johnson & Nathan Sobo
2973a81293 Don't assign text grammar by default. Just use the null grammar. 2013-04-03 18:34:54 -06:00
Corey Johnson & Nathan Sobo
1b56cfb270 LanguageMode switches to a better-matching grammar when it is added 2013-04-03 18:34:54 -06:00
Corey Johnson & Nathan Sobo
16b53d3183 Eliminate syntax.grammarsByFileType hash 2013-04-03 18:34:53 -06:00
Corey Johnson & Nathan Sobo
05d6adc6c7 Change syntax.selectGrammar to choose the highest-scoring grammar
This sets us up to switch to a grammar when it is loaded if it is a
better match for the current file.
2013-04-03 18:34:53 -06:00
Nathan Sobo
ed1c5d3417 Localize grammar reloading / setting to LanguageMode
Previously, logic associated with swapping grammars was a bit
scattered. Now grammar reloading / assignment methods delegate to
LanguageMode directly, and it emits a 'grammar-changed' event when
the grammar changes. Now EditSession and TokenizedBuffer listen for
this event and perform necessary actions for grammar change.
2013-04-03 18:34:53 -06:00
Kevin Sawicki
4f8d51450a Add missing space in expected string 2013-04-03 16:01:17 -07:00