Sebastian Pfitzner
0f9234ce22
Add textEditors.getActiveTextEditor() method ( #12804 )
...
* add textEditors.getActiveTextEditor()
Co-authored-by: sadick254 <sadickjunior@gmail.com>
2021-01-27 09:54:04 +03:00
sadick254
c859f2067f
Refactor test from async to sync
...
Reason for change: This test has been flaky on our CI due to its async
nature.
The expectation is for .build to construct TextEditor with the right
params.
We don't have to load the correct language package for this test. We can
load a dummy languageMode and assert that the correct grammar is set on
TextEditor
2020-09-18 20:01:55 +03:00
Rafael Oleza
7f3f040628
Reformat all JS files using prettier
2019-05-31 18:33:56 +02:00
Antonio Scandurra
c8b96ea899
Use the new getActivatePromise
method in TextEditorRegistry tests
2019-05-18 17:01:08 +02:00
Rafael Oleza
a93808d1a8
Always use global it, beforeEach and afterEach methods
2019-02-28 20:39:21 +01:00
Rafael Oleza
6c46cf9243
Fix remaining linter issues
2019-02-28 19:30:03 +01:00
Rafael Oleza
d7d6d0838f
Remove unused vars from specs
2019-02-28 19:30:03 +01:00
Rafael Oleza
c35ec012b4
Run prettier on spec/ folder
2019-02-28 19:30:03 +01:00
Max Brunsfeld
4d3a9ec17b
Update TextEditorRegistry spec to expect sync updates
2018-08-24 10:37:06 -07:00
Max Brunsfeld
d1283fa69f
Fix TreeSitterLanguageMode.isRowCommented
2018-08-24 09:34:58 -07:00
David Wilson
dbd4a0a4c0
Preserve TextEditor settings when language mode changes
...
This change fixes #13829 which reports that the `softWrapped` setting of
an untitled TextEditor is lost when the buffer is saved to a file. This
is caused by logic that updates TextEditor settings when the buffer's
language mode changes.
The fix is to preserve any TextEditor settings that would not change when
switching between the previous and current language mode of the buffer.
2018-01-12 13:51:35 -08:00
Max Brunsfeld
607ed74e7b
Rename TokenizedBuffer to TextMateLanguageMode
2017-11-28 16:57:06 -08:00
Max Brunsfeld
e08091f193
Make assignLanguageMode take a language id instead of a language name
2017-11-28 11:14:29 -08:00
Max Brunsfeld
d52c4bc33b
Serialize the grammar registry
2017-11-20 14:50:00 -08:00
Max Brunsfeld
f6c2e0eba4
Allow setting the null language mode w/ assignLanguageMode(buffer, null)
2017-11-20 09:48:00 -08:00
Max Brunsfeld
351f96d5dd
Iterate on GrammarRegistry APIs
...
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-11-06 09:36:06 -08:00
wpowell-oss
0b55d4e144
maxScreenLineLength rebased to github
2017-09-12 14:38:29 +12:00
Damien Guard
af66c5efaa
Fix two more tests
2017-09-08 19:00:26 -07:00
Antonio Scandurra
001fef4a05
Don't activate scrollPastEnd for autoHeight editors
2017-05-05 09:30:08 +02:00
Andres Suarez
1ee9d7b0f9
Add showCursorOnSelection config
2017-01-20 08:53:28 -05:00
Antonio Scandurra
66510ae545
Handle null grammars consistently, building placeholder lines on-demand
...
Previously we were treating the local `NullGrammar` differently from
`atom.grammars.nullGrammar`. These two grammars are conceptually the
same, as the former was created to support editors creation without a
grammar registry.
To keep backwards-compatibility, we also build placeholder lines
on-demand when calling `TokenizedBuffer.prototype.tokenizedLineForRow`.
This ensure that packages relying on the internals of `TokenizedBuffer`
to retrieve syntactic boundaries won't break when the null grammar is
used or large file mode is on.
2016-10-12 09:04:41 +02:00
Antonio Scandurra
18ddcf902b
Statically assign a clipboard instance to the TextEditor
class
2016-10-07 18:21:09 +02:00
Max Brunsfeld
e6cac10a23
Always return Disposable from maintain{Config,Grammar}
2016-10-05 12:03:53 -07:00
Damien Guard
9451ca0254
Fix show/hide line numbers in editor
2016-08-30 13:20:17 -07:00
Max Brunsfeld
c5a6e9c697
Merge branch 'master' into ns-mb-detangle-editor
2016-08-16 09:11:11 -07:00
Max Brunsfeld
4bcdbf4d2f
Don't have registry update any editors before initial packages are loaded
2016-08-15 15:29:27 -07:00
Max Brunsfeld
bf644d1a6b
Remove some unnecessary TextEditor accessor methods
2016-08-12 14:31:07 -07:00
Max Brunsfeld
09d232ba41
Introduce TextEditorRegistry::build
...
This way, we can construct text editors with the right parameters from the start
2016-08-12 12:21:51 -07:00
Max Brunsfeld
0a1834079f
Rename getSoftWrapIndentLength -> getSoftWrapHangingIndentLength
2016-08-11 16:38:34 -07:00
Max Brunsfeld
684952458f
Remove new TextEditor setters; just use update
2016-08-11 15:34:54 -07:00
Max Brunsfeld
6d4e0f9b0a
🚱 Stop maintaining destroyed editors' grammar and config
2016-08-10 13:54:37 -07:00
Max Brunsfeld
e8c834e483
Serialize & deserialize the TextEditorRegistry in AtomEnvironment
2016-08-08 15:38:17 -07:00
Max Brunsfeld
53574288ae
Fix editor leaks in TextEditorRegistry
2016-08-08 15:02:01 -07:00
Max Brunsfeld
eb9d89f8c8
Observe grammar changes on editors in maintainConfig
2016-08-08 12:10:56 -07:00
Max Brunsfeld
e2e245aca1
Make TextEditorRegistry.setGrammarOverride take a scope name
...
Also, clear the stored grammar score for that editor when setting an override.
2016-07-29 13:40:29 -07:00
Max Brunsfeld
16c80f6eaf
WIP - add local null grammar
2016-07-28 14:47:26 -07:00
Max Brunsfeld
ab30ecf994
Manage scroll sensitivity setting in TextEditorRegistry
...
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-07-27 15:39:03 -07:00
Max Brunsfeld
3d796df401
Stop using GrammarRegistry in TextEditor
2016-07-27 14:09:17 -07:00
Max Brunsfeld
e6c83521c9
Move grammar serialization logic to TextEditorRegistry
2016-07-27 13:10:23 -07:00
Max Brunsfeld
a44d5833a8
Move grammar override logic into TextEditorRegistry
...
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-07-26 15:00:20 -07:00
Max Brunsfeld
20b54505f3
Move logic for assigning grammars to editors into TextEditorRegistry
2016-07-26 10:50:57 -07:00
Max Brunsfeld
4eb2f6631a
👕 Fix lint errors
2016-07-15 13:32:23 -07:00
Max Brunsfeld
58ec44f8ec
Move handling of nonWordCharacters setting into TextEditorRegistry
2016-07-12 11:30:41 -07:00
Max Brunsfeld
5167dbca6f
Move handling of undoGroupingInterval to TextEditorRegistry
2016-07-11 17:47:40 -07:00
Max Brunsfeld
9ab474a673
Move handling of scrollPastEnd setting to TextEditorRegistry
2016-07-11 17:41:06 -07:00
Max Brunsfeld
7a50aa9f9f
Move handling of auto indent settings to TextEditorRegistry
2016-07-11 17:37:51 -07:00
Max Brunsfeld
6f764f86cf
Move handling of backUpBeforeSaving to TextEditorRegistry
2016-07-11 17:16:41 -07:00
Max Brunsfeld
66c56d2a72
TextEditorRegistry: test skipping comments when guessing soft tabs
2016-07-11 17:02:03 -07:00
Max Brunsfeld
f327a4f95d
Test that maintainConfig uses scoped settings
2016-07-11 13:50:38 -07:00
Max Brunsfeld
5acab853cd
Remove all config observation from text editor
2016-07-11 12:43:18 -07:00