Previously, we were not including the text when serializing an
unmodified buffer. We would use the absence of the text field to
determine that the buffer was previously unmodified when deserializing.
The problem is that text now stores the markers associated with the
buffer, and we want to retain those across serialization regardless of
the modified status. So now I include the text always, along with an
isModified flag which if true, will tell to reload the buffer if it
has changed since we last serialized it. Reloading a buffer should
probably do a diff-and-patch in the future rather than replacing the
contents outright, so that we always preserve markers as best as we can.
1. Core specs located in spec/
2. Internal package specs in src/packages
3. Bundled package specs in node_modules
4. User package specs in ~/.atom/packages
These were previously throwing an error from the call to
statSync().
Now statSync() is wrapped in a try block and only performed when
lstatSync() reports a symbolic link.
Let's not ship with TextMate theme support. Our .less theme files are
easier to read and write than TextMate themes. If we want to use
TextMate themes we should write a script that converts them to the
Atom .less version.
Closes#629
You can call this method with a selector and a position and get the range
of any matching scope containing the given position, or a falsy value
if the scope does not match at that position.
This event was previously not being fired when splitting panes
since the constructor pushing the edit session directly to the
project's array.
Closes#684
Add the TextMate "completions" preferences available as "editor.completions"
and add all completions matching the current scope of the cursor position
when building the autocomplete word list.
Closes#676
Previously dashes were only interpreted as negation which
wasn't correct.
Segments should be able to contain a dash as long as it isn't at
the very beginning of the segment.
Also: Add an Environment spec helper class that swaps out global
variables to simulate running code in different environments for the
replication specs.
TextBuffers now maintain a reference to their containing project to
make it easier to test replication of buffers between environments
without worrying about the value of the `project` global.
We're also starting the process of moving the `git` global into Project
as the `Project.repository` property.
The project contains the only reference to the buffer that belongs to
the edit session in the serialized pane. If we tear down the pane then
the edit session is destroyed and the buffer is removed. So we have to
serialize and restore the project to its previous state once we finish
tearing down the view.
Everything from RootView to Pane needs to return a serialized clone of
its state, so we don't accidentally further mutate the serialized state
in tests.
Previously, we kept display buffer attributes in the edit session's
serialized state, then recreated a fresh display buffer each time when
deserializing edit sessions. Now that DisplayBuffer and TokenizedBuffer
are serializable, we can just include them directly when serializing
the edit session.
We want to be able to use the copy independently, which means we
should not use EditSession@deserialize to create it because that will
tie us to the same selection markers.
This prevents selection markers created by different edit sessions
from being shared. Otherwise every edit session for a buffer would be
forced to have the same selection/cursor state.
This removes the noise from the setup and compare lines that occur in
jasmine.js and only displays the lines that are generated from within
the failing spec.
Since there can be multiple edit sessions per buffer, it doesn't make
sense to serialize the buffer multiple times. Previously, we were
de-duplicating buffers in the deserialize method itself, but this won't
work now that we want to replicate buffers.
Previously viewForItem() would create a new view each time it was called
with an item whose view did not implement setModel() even if a view for that
item already existed in the pane.
Now a WeakMap is used to map items to their view so they can be reused
and cleaned up even when the view does not implement setModel().
Use event.which if it is lower than the parsed key identifier.
This is the case when a non-English keyboard language is selected and
a physical English keyboard is being used.
This allows keybindings to still work even when the physical key pressed
is different than the key it maps to for the currently selected language.
Closes#585
We're using Peer.js to stream changes to shared telepath documents
between participants.
We're replacing the rootView of joiners in a somewhat hacky way,
but replication of pane splits and items is fully tested.
Previously the score for two grammars matching on path
was equal and so the first one would be selected.
Now the longer match will have a higher score and will be selected
over other grammars with shorter fileType match lengths.
Closes#602
Previously the display buffer markers would still fire events
even after a display buffer was destroyed since they were not
being unsubscribed from their underlying buffer marker which
could still fire events in the case of an editor split on the
same buffer.
Closes#593
Previously the indentation guide level for empty lines was
derived by only looking after the empty line which caused gaps
in certain cases.
Now the indentation for an empty line is the higher value of the
previous non-empty line indentation and the following non-empty
line indentation.
Closes#588
Previously on zero length matches the last two rules were compared
and if they had the same scope name then the last rule was popped
and the remaining line was tokenized using the current scope stack
to prevent infinite parsing loops.
This caused nested method calls in Java to not tokenize correctly
since method rules were sequential in the stack but did not constitute
an infinite loop of zero matches since the stack was currently decreasing.
Now the last two rules are only compared when the stack size is increasing
to prevent this false positive.
Closes#587