mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Merge branch 'master' into mb-tree-sitter-parsers
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
language: python
|
||||
|
||||
python:
|
||||
- "2.7.13"
|
||||
|
||||
git:
|
||||
depth: 10
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
"autocomplete-html": "0.8.4",
|
||||
"autocomplete-plus": "2.39.1",
|
||||
"autocomplete-snippets": "1.11.2",
|
||||
"autoflow": "0.29.0",
|
||||
"autoflow": "0.29.1",
|
||||
"autosave": "0.24.6",
|
||||
"background-tips": "0.27.1",
|
||||
"bookmarks": "0.45.1",
|
||||
@@ -110,7 +110,7 @@
|
||||
"exception-reporting": "0.42.0",
|
||||
"find-and-replace": "0.215.0",
|
||||
"fuzzy-finder": "1.7.4",
|
||||
"github": "0.9.0",
|
||||
"github": "0.9.1",
|
||||
"git-diff": "1.3.7",
|
||||
"go-to-line": "0.32.1",
|
||||
"grammar-selector": "0.49.9",
|
||||
@@ -124,8 +124,8 @@
|
||||
"notifications": "0.70.2",
|
||||
"open-on-github": "1.3.1",
|
||||
"package-generator": "1.3.0",
|
||||
"settings-view": "0.253.1",
|
||||
"snippets": "1.1.10",
|
||||
"settings-view": "0.253.2",
|
||||
"snippets": "1.1.11",
|
||||
"spell-check": "0.72.4",
|
||||
"status-bar": "1.8.15",
|
||||
"styleguide": "0.49.10",
|
||||
|
||||
@@ -86,23 +86,6 @@ describe('TextEditor', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('when the editor is readonly', () => {
|
||||
it('overrides TextBuffer.isModified to return false', async () => {
|
||||
const editor = await atom.workspace.open(null, {readOnly: true})
|
||||
editor.setText('I am altering the buffer, pray I do not alter it any further')
|
||||
expect(editor.isModified()).toBe(false)
|
||||
editor.setReadOnly(false)
|
||||
expect(editor.isModified()).toBe(true)
|
||||
})
|
||||
it('clears the readonly status when saved', async () => {
|
||||
const editor = await atom.workspace.open(null, {readOnly: true})
|
||||
editor.setText('I am altering the buffer, pray I do not alter it any further')
|
||||
expect(editor.isReadOnly()).toBe(true)
|
||||
await editor.saveAs(temp.openSync('was-readonly').path)
|
||||
expect(editor.isReadOnly()).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('.copy()', () => {
|
||||
it('returns a different editor with the same initial state', () => {
|
||||
expect(editor.getAutoHeight()).toBeFalsy()
|
||||
|
||||
@@ -823,7 +823,7 @@ class TextEditorComponent {
|
||||
|
||||
const oldClassList = this.classList
|
||||
const newClassList = ['editor']
|
||||
if (this.focused && this.isInputEnabled()) newClassList.push('is-focused')
|
||||
if (this.focused) newClassList.push('is-focused')
|
||||
if (model.isMini()) newClassList.push('mini')
|
||||
for (var i = 0; i < model.selections.length; i++) {
|
||||
if (!model.selections[i].isEmpty()) {
|
||||
|
||||
@@ -407,7 +407,6 @@ class TextEditor {
|
||||
if (this.component != null) {
|
||||
this.component.scheduleUpdate()
|
||||
}
|
||||
this.buffer.emitModifiedStatusChanged(this.isModified())
|
||||
}
|
||||
break
|
||||
|
||||
@@ -568,11 +567,6 @@ class TextEditor {
|
||||
this.disposables.add(this.buffer.onDidChangeModified(() => {
|
||||
if (!this.hasTerminatedPendingState && this.buffer.isModified()) this.terminatePendingState()
|
||||
}))
|
||||
this.disposables.add(this.buffer.onDidSave(() => {
|
||||
if (this.isReadOnly()) {
|
||||
this.setReadOnly(false)
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
terminatePendingState () {
|
||||
@@ -1129,7 +1123,7 @@ class TextEditor {
|
||||
setEncoding (encoding) { this.buffer.setEncoding(encoding) }
|
||||
|
||||
// Essential: Returns {Boolean} `true` if this editor has been modified.
|
||||
isModified () { return this.isReadOnly() ? false : this.buffer.isModified() }
|
||||
isModified () { return this.buffer.isModified() }
|
||||
|
||||
// Essential: Returns {Boolean} `true` if this editor has no content.
|
||||
isEmpty () { return this.buffer.isEmpty() }
|
||||
|
||||
Reference in New Issue
Block a user