Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
3d5f9ec
[spell-check] Allow the user to whitelist sections of a buffer…
savetheclocktower Dec 1, 2024
bc3ceae
Fix Linux trash error message
mauricioszabo Dec 4, 2024
bcb9a2d
Fix `package-keymap-view` compatibility check
confused-Techie Dec 13, 2024
d624d26
Rename function to match expectations. Flip all boolean logic
confused-Techie Dec 13, 2024
d754ed7
Merge pull request #1151 from pulsar-edit/fix-error-msg
confused-Techie Dec 16, 2024
aee35aa
Tree-sitter rolling fixes, 1.124 edition (#1148)
savetheclocktower Dec 16, 2024
7ab0460
Merge pull request #1161 from pulsar-edit/settings-view/keymap-platfo…
confused-Techie Dec 16, 2024
f695ec4
Update changelog notes
confused-Techie Dec 16, 2024
8d6e677
[spell-check] Add `source comment` to default `grammars` setting
savetheclocktower Dec 16, 2024
b04e997
Merge pull request #1147 from savetheclocktower/spell-check-scope-gra…
confused-Techie Dec 16, 2024
5e5889a
Add new PR to changelog
confused-Techie Dec 16, 2024
d8c0585
Merge pull request #1164 from pulsar-edit/1.124.0-changelog
confused-Techie Dec 16, 2024
c3a4a9d
CI: Add linux build dependencies for Linux 'test bins' job
DeeDeeG Dec 16, 2024
b3a6042
Changelog: Add PR 1165 (deps fix for Linux CI)
DeeDeeG Dec 16, 2024
82955a6
Merge pull request #1165 from pulsar-edit/install-missing-deps-for-te…
confused-Techie Dec 16, 2024
6675e9b
Update Version
Dec 16, 2024
c971c1b
Add back build identifier
Dec 16, 2024
a5fccfc
Merge pull request #1166 from pulsar-edit/v1.124.0-release
confused-Techie Dec 16, 2024
bcf7f48
Expose `dbPromise` in `StateStore`
confused-Techie Dec 18, 2024
4788055
Add specs
confused-Techie Dec 20, 2024
a1af458
CI: Retry on timeout when building macOS bins
DeeDeeG Dec 30, 2024
e46ba9a
Merge pull request #1171 from pulsar-edit/expose-database-dbPromise-m…
confused-Techie Dec 30, 2024
1be24bb
Only remove items from PATH on uninstall, not upgrade
confused-Techie Jan 5, 2025
316dfd1
[spell-check] Fixes for a possible patch release (#1173)
savetheclocktower Jan 7, 2025
64ec928
[pulsar-updater] Don't prompt to update on non-default release channe…
savetheclocktower Jan 7, 2025
aadf72b
CI: Reduce macOS bins timeout to 31 minutes
DeeDeeG Jan 7, 2025
039c758
CI: No dpkg shenanigans for package tests workflow (#1188)
DeeDeeG Jan 12, 2025
360dbb7
Merge branch 'master' into fix-windows-path-addition
confused-Techie Jan 12, 2025
1ec04f6
Attempt to install dependency on new Ubuntu CI images (#1192)
savetheclocktower Jan 13, 2025
d90260e
Install dependencies for CI documentation job (#1193)
savetheclocktower Jan 13, 2025
b7b82ba
Merge pull request #1178 from pulsar-edit/CI-retry-on-timeout-when-bu…
DeeDeeG Jan 15, 2025
ebed0ba
Merge pull request #1183 from pulsar-edit/fix-windows-path-addition
confused-Techie Jan 17, 2025
ec55082
Tree-sitter rolling fixes, 1.125 (or 1.124.1) edition (#1172)
savetheclocktower Jan 17, 2025
5b5dc96
Changelog: Add entries for PRs since 1.124.0
DeeDeeG Jan 22, 2025
df9fa49
Merge pull request #1199 from pulsar-edit/changelog-1.125.0
DeeDeeG Jan 22, 2025
7450e0c
Update Version
Jan 22, 2025
23794c4
Add back build identifier
Jan 22, 2025
3cf2e03
Merge pull request #1201 from pulsar-edit/v1.125.0-release
confused-Techie Jan 24, 2025
ac1414a
Remove `core.allowWindowTransparency` from the config schema… (#1206)
savetheclocktower Feb 10, 2025
5a0cee0
CI: Run apt-get update before installing Pulsar (for package tests)
DeeDeeG Feb 10, 2025
e9e25fa
Merge pull request #1209 from pulsar-edit/CI-apt-get-install-before-i…
DeeDeeG Feb 10, 2025
2214519
[language-php] Fold on array literals
savetheclocktower Feb 9, 2025
360025e
Specify a `PYTHON` env var on Windows so it doesn't get confused (#1220)
savetheclocktower Feb 16, 2025
fb0ed66
Merge pull request #1207 from pulsar-edit/tree-sitter-126
DeeDeeG Feb 18, 2025
acb5581
ppm: Bump ppm to commit 6981ce79e0efdd9bae1fac9bd1
DeeDeeG Feb 18, 2025
5f6a1d7
CI: Compile newer Python for Debian Docker image
DeeDeeG Feb 18, 2025
881bef3
Merge pull request #1223 from pulsar-edit/bump-ppm-Feb-2025
DeeDeeG Feb 19, 2025
d2c9bd5
CI: Update Rolling token for Cirrus CI
DeeDeeG Feb 19, 2025
6942472
Merge pull request #1226 from pulsar-edit/Cirrus-rolling-token-update…
DeeDeeG Feb 19, 2025
b5da98a
CI: Compile and install newer Python for ARM Linux Cirrus
DeeDeeG Mar 2, 2025
a32576c
CI: Install Python setuptools on ARM Linux Cirrus
DeeDeeG Mar 2, 2025
052aa8c
Merge pull request #1237 from pulsar-edit/compile-newer-Python-for-Ci…
DeeDeeG Mar 3, 2025
e83cd03
Changelog: Add changelog entries for 1.126.0
DeeDeeG Feb 26, 2025
4568c12
Changelog: Tweak entries (implement review feedback)
DeeDeeG Mar 4, 2025
0809c52
Merge pull request #1232 from pulsar-edit/Changelog-Pulsar-1.126.0
DeeDeeG Mar 4, 2025
808e3af
Update Version
Mar 4, 2025
9675339
Add back build identifier
Mar 5, 2025
397d66b
Merge pull request #1238 from pulsar-edit/v1.126.0-release
DeeDeeG Mar 6, 2025
708a540
Update jasmine to 2.x (#990)
kiskoza Mar 7, 2025
619ae10
GH Action Documentation
savetheclocktower Mar 7, 2025
4ffe10d
Adding wayland parameters to pulsar.sh script
mauricioszabo Mar 17, 2025
76ffb12
Changelog update
mauricioszabo Mar 17, 2025
90f12d9
Removed duplicated condition
mauricioszabo Mar 19, 2025
eccee53
Refactored to EXTRA_ARGS
mauricioszabo Mar 19, 2025
a74eda7
Merge pull request #1246 from pulsar-edit/wayland-pulsar-script
mauricioszabo Mar 19, 2025
d7b638e
Tree-sitter rolling fixes, 1.127 edition (#1240)
savetheclocktower Mar 24, 2025
194ce77
GH Action Documentation
savetheclocktower Mar 24, 2025
e483c45
ppm: Update ppm to commit a6f843f0381f64cb5865efc7
DeeDeeG Mar 24, 2025
4939501
Merge pull request #1252 from pulsar-edit/upate-ppm-late-march-2025
DeeDeeG Mar 24, 2025
090c368
Changelog: Update changelog for Pulsar 1.127.0
DeeDeeG Mar 25, 2025
a852d09
Changelog: Apply review suggestion
DeeDeeG Mar 26, 2025
0b05270
Merge pull request #1254 from pulsar-edit/Changelog-Regular-release-1…
DeeDeeG Mar 26, 2025
7e52810
meta: Update editor version to 1.127.0
DeeDeeG Mar 26, 2025
aa753c4
meta: Add back "-dev" to the version string
DeeDeeG Mar 27, 2025
e0845d7
Revert "Wayland pulsar script" (#1261)
mauricioszabo Mar 27, 2025
d981004
Merge pull request #1257 from pulsar-edit/v1.127.0-release
DeeDeeG Mar 29, 2025
c1f0cdc
Changelog: Add changelog entries for hotfix v1.127.1
DeeDeeG Mar 29, 2025
62d16f6
meta: Update version to "v1.127.1" for hotfix release
DeeDeeG Mar 29, 2025
d0cded6
meta: Add back "-dev" to version string
DeeDeeG Mar 30, 2025
1bdcb9b
Merge pull request #1262 from pulsar-edit/v1.127.1-release
DeeDeeG Mar 30, 2025
0c4ed41
Merge remote-tracking branch 'origin/master' into updated-latest-elec…
mauricioszabo Apr 25, 2025
8a29334
Lockfile update
mauricioszabo Apr 25, 2025
c6ee0c1
Fixed merge
mauricioszabo Apr 25, 2025
ea36799
More merge problems fixed
mauricioszabo Apr 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,35 @@ arm_linux_task:
libnss3
wget
xvfb
libncursesw5-dev
libssl-dev
libsqlite3-dev
tk-dev
libgdbm-dev
libc6-dev
libbz2-dev
libffi-dev
zlib1g-dev
- gem install dotenv -v '~> 2.8'
- gem install fpm
- git submodule init
- git submodule update
- sed -i -e "s/[0-9]*-dev/`date -u +%Y%m%d%H`-next/g" package.json
python_fetch_and_build_cache:
fingerprint_script: echo "${CIRRUS_OS}-$(uname -prsv)-Python-${PYTHON_VERSION}.9"
folder: Python-${PYTHON_VERSION}.9
populate_script:
- wget "https://www.python.org/ftp/python/${PYTHON_VERSION}.9/Python-${PYTHON_VERSION}.9.tgz"
- echo "45313e4c5f0e8acdec9580161d565cf5fea578e3eabf25df7cc6355bf4afa1ee Python-${PYTHON_VERSION}.9.tgz" | sha256sum --check
- tar xzf "Python-${PYTHON_VERSION}.9.tgz"
- cd "Python-${PYTHON_VERSION}.9"
- ./configure --enable-optimizations
- make
upload_caches:
- python_fetch_and_build
install_python_script:
- cd "Python-${PYTHON_VERSION}.9" && make install
- python3 -m pip install setuptools
install_script:
- yarn install --ignore-engines || yarn install --ignore-engines
build_script:
Expand Down Expand Up @@ -135,7 +159,7 @@ silicon_mac_task:
APPLEID: ENCRYPTED[549ce052bd5666dba5245f4180bf93b74ed206fe5e6e7c8f67a8596d3767c1f682b84e347b326ac318c62a07c8844a57]
APPLEID_PASSWORD: ENCRYPTED[774c3307fd3b62660ecf5beb8537a24498c76e8d90d7f28e5bc816742fd8954a34ffed13f9aa2d1faf66ce08b4496e6f]
TEAM_ID: ENCRYPTED[11f3fedfbaf4aff1859bf6c105f0437ace23d84f5420a2c1cea884fbfa43b115b7834a463516d50cb276d4c4d9128b49]
ROLLING_UPLOAD_TOKEN: ENCRYPTED[41b279482c1b61c9129e410233cc5cd71bbfd60e33d03cefae451aff6bc9915d1706a6e8fefd0e0f9041a4bd287c84be] # <-- This is the Electron Next Bins token! Careful when resolving merge conflicts to not overrite to/from master. master branch keeps its token, updated-latest-electron branch keeps this one!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mauricioszabo, can you revert the change on this line? Per the comment, this upload token should remain distinct on the updated-latest-electron branch.

ROLLING_UPLOAD_TOKEN: ENCRYPTED[9cfac7b7c2b28c0979ddd587f7cda3ed1bbe893bbf7ec1d8df9808ef24cdb53c17c1edc572ee249d83c65529cea18a30]
prepare_script:
- brew update
- brew uninstall node@20
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
steps:
- name: Install build dependencies - Linux
if: ${{ runner.os == 'Linux' }}
run: apt-get update && apt-get install -y git python3 python3-pip make gcc g++ libx11-dev libxkbfile-dev pkg-config libsecret-1-dev rpm xvfb ffmpeg zstd wget squashfs-tools
libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev # <-- Python-related stuff on this line
run: apt-get update && apt-get install -y git make gcc g++ libx11-dev libxkbfile-dev pkg-config libsecret-1-dev rpm xvfb ffmpeg zstd wget squashfs-tools
libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev # <-- Python-related stuff on this line

- name: Restore Compiled Python from Cache - Linux
if: ${{ runner.os == 'Linux' }}
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@

- Added a Jasmine 2-based test runner, migrated core editor tests to use it. Packages bundled into the core editor can migrate their tests to use this as well, over time. The Jasmine 1 test runner remains available.
- Adding `--enable-features=UseOzonePlatform` and `--ozone-platform=wayland` as parameters when running under Wayland on Linux (avoids using xwayland, which causes rendering problems on some systems, especially with NVidia)
## 1.127.1

- Hotfix: Reverted a Wayland-related change that Linux users reported issues with on Electron 12.

### Pulsar

- Revert "Wayland pulsar script" [@mauricioszabo](https://github.com/pulsar-edit/pulsar/pull/1261)

## 1.127.0

- Added a Jasmine 2-based test runner, migrated core editor tests to use it. Packages bundled into the core editor can migrate their tests to use this as well, over time. The Jasmine 1 test runner remains available.
- Added `--enable-features=UseOzonePlatform` and `--ozone-platform=wayland` as parameters when running under Wayland on Linux (avoids using xwayland, which causes rendering problems on some systems, especially with NVidia)
- Many Tree-sitter/parser/grammar improvements.
- Updated to `web-tree-sitter` version `0.25.3`.
- Fixed a bug preventing folds from updating after code changes in some scenarios.
Expand Down
6 changes: 3 additions & 3 deletions docs/Pulsar-API-Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ style: Exclusively used for the <code>style</code> attribute</p>
<dt><a href="#renderMarkdown">renderMarkdown(content, givenOpts)</a> ⇒ <code>string</code></dt>
<dd><p>Takes a Markdown document and renders it as HTML.</p>
</dd>
<dt><a href="#beforeEach">beforeEach()</a></dt>
<dt><a href="#conditionPromise">conditionPromise()</a></dt>
<dd></dd>
<dt><a href="#beforeEach">beforeEach()</a></dt>
<dd></dd>
Expand Down Expand Up @@ -631,9 +631,9 @@ This file aims to run some short simple tests against `update.js`. Focusing
## path
**Kind**: global constant
**Babel**:
<a name="beforeEach"></a>
<a name="conditionPromise"></a>

## beforeEach()
## conditionPromise()
**Kind**: global function
**Babel**:
<a name="beforeEach"></a>
Expand Down
6 changes: 3 additions & 3 deletions docs/Source-Code-Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ style: Exclusively used for the <code>style</code> attribute</p>
<dt><a href="#renderMarkdown">renderMarkdown(content, givenOpts)</a> ⇒ <code>string</code></dt>
<dd><p>Takes a Markdown document and renders it as HTML.</p>
</dd>
<dt><a href="#beforeEach">beforeEach()</a></dt>
<dt><a href="#conditionPromise">conditionPromise()</a></dt>
<dd></dd>
<dt><a href="#beforeEach">beforeEach()</a></dt>
<dd></dd>
Expand Down Expand Up @@ -639,9 +639,9 @@ This file aims to run some short simple tests against `update.js`. Focusing
## path
**Kind**: global constant
**Babel**:
<a name="beforeEach"></a>
<a name="conditionPromise"></a>

## beforeEach()
## conditionPromise()
**Kind**: global function
**Babel**:
<a name="beforeEach"></a>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pulsar",
"author": "Pulsar-Edit <[email protected]>",
"productName": "Pulsar",
"version": "1.127.0-dev",
"version": "1.127.1-dev",
"description": "A Community-led Hyper-Hackable Text Editor",
"branding": {
"id": "pulsar",
Expand Down
1 change: 1 addition & 0 deletions packages/language-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"license": "MIT",
"atomTestRunner": "runners/jasmine2-test-runner",
"dependencies": {
"tree-sitter-python": "0.19.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's please not add back a Tree-sitter dependency.

},
"consumedServices": {
"hyperlink.injection": {
Expand Down
5 changes: 4 additions & 1 deletion packages/welcome/lib/changelog-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ export default class ChangeLogView {
<p>Take a look at some of the awesome things {atom.branding.name} has changed:</p>
<p>Feel free to read our <a href="https://github.com/pulsar-edit/pulsar/blob/master/CHANGELOG.md">Full Change Log</a>.</p>
<ul>
<li>
Pulsar v1.127.1 Hotfix: Reverted a Wayland-related change that Linux users reported issues with on Electron 12. (The remaining changes listed below are from Pulsar v1.127.0.)
</li>
<li>
Added a Jasmine 2-based test runner, migrated core editor tests to use it. Packages bundled into the core editor can migrate their tests to use this as well, over time. The Jasmine 1 test runner remains available.
</li>
<li>
Adding <code>--enable-features=UseOzonePlatform</code> and <code>--ozone-platform=wayland</code> as parameters when running under Wayland on Linux (avoids using xwayland, which causes rendering problems on some systems, especially with NVidia)
Added <code>--enable-features=UseOzonePlatform</code> and <code>--ozone-platform=wayland</code> as parameters when running under Wayland on Linux (avoids using xwayland, which causes rendering problems on some systems, especially with NVidia)
</li>
<li>
Many Tree-sitter/parser/grammar improvements.
Expand Down
12 changes: 3 additions & 9 deletions spec/helpers/jasmine2-spies.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,8 @@ exports.register = (jasmineEnv) => {
atom.config.set("editor.fontFamily", "Courier");
atom.config.set("editor.fontSize", 16);
atom.config.set("editor.autoIndent", false);
atom.config.set(
"core.disabledPackages",
[
"package-that-throws-an-exception",
"package-with-broken-package-json",
"package-with-broken-keymap"
]
);
atom.config.set("core.disabledPackages", ["package-that-throws-an-exception",
"package-with-broken-package-json", "package-with-broken-keymap"]);

// advanceClock(1000);
// window.setTimeout.calls.reset();
Expand Down Expand Up @@ -98,6 +92,6 @@ exports.register = (jasmineEnv) => {
});
}

jasmine.unspy = function (object, methodName) {
jasmine.unspy = function(object, methodName) {
object[methodName].and.callThrough();
};
1 change: 0 additions & 1 deletion spec/package-manager-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,6 @@ describe('PackageManager', () => {
});

it('sets hasActivatedInitialPackages', async () => {
jasmine.useRealClock();
spyOn(atom.styles, 'getUserStyleSheetPath').and.returnValue(null);
spyOn(atom.packages, 'activatePackages');
expect(atom.packages.hasActivatedInitialPackages()).toBe(false);
Expand Down
11 changes: 6 additions & 5 deletions spec/package-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ describe('Package', function () {

afterEach(() => (atom.packages.devMode = true));

it('returns a promise resolving to the results of `apm rebuild`', async () => {
const packagePath = atom.project.getDirectories()?.[0]?.resolve('packages/package-with-index')

it('returns a promise resolving to the results of `apm rebuild`', async function() {
const packagePath = __guard__(atom.project.getDirectories()[0], x =>
x.resolve('packages/package-with-index')
);
const pack = buildPackage(packagePath);
const rebuildCallbacks = [];
spyOn(pack, 'runRebuildProcess').and.callFake(callback =>
Expand Down Expand Up @@ -154,7 +155,7 @@ describe('Package', function () {
});
});

describe('theme', function () {
describe('theme', function() {
let editorElement, theme;

beforeEach(function () {
Expand Down Expand Up @@ -239,7 +240,7 @@ describe('Package', function () {
theme.activate();
});

it('deactivated event fires on .deactivate()', async function () {
it('deactivated event fires on .deactivate()', async function() {
let spy = jasmine.createSpy();
theme.onDidDeactivate(spy);
await theme.deactivate();
Expand Down
21 changes: 6 additions & 15 deletions spec/runners/jasmine2-test-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,11 @@ const defineJasmineHelpersOnWindow = (jasmineEnv) => {
['it', 'fit', 'xit'].forEach((key) => {
window[key] = (name, originalFn) => {
jasmineEnv[key](name, async (done) => {
try {
if (originalFn.length === 0) {
await originalFn();
done();
} else {
originalFn(done);
}
} catch (err) {
if (typeof err === 'string' && err.includes('Pending')) {
// A test marked itself as pending. Swallow the exception and
// proceed.
return;
}
throw err;
if(originalFn.length === 0) {
await originalFn()
done();
} else {
originalFn(done);
}
});
}
Expand All @@ -118,7 +109,7 @@ const defineJasmineHelpersOnWindow = (jasmineEnv) => {
['beforeEach', 'afterEach'].forEach((key) => {
window[key] = (originalFn) => {
jasmineEnv[key](async (done) => {
if (originalFn.length === 0) {
if(originalFn.length === 0) {
await originalFn()
done();
} else {
Expand Down
50 changes: 2 additions & 48 deletions spec/text-editor-component-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let verticalScrollbarWidth, horizontalScrollbarHeight;

describe('TextEditorComponent', () => {
beforeEach(() => {
if (!window.customElements.get('text-editor-component-test-element')) {
if(!window.customElements.get('text-editor-component-test-element')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No! These if(s shall not stand! :)

window.customElements.define(
'text-editor-component-test-element',
DummyElement
Expand Down Expand Up @@ -3592,74 +3592,33 @@ describe('TextEditorComponent', () => {
});

it('does not attempt to render block decorations located outside the visible range', async () => {
// Build a text editor with only two rows per tile.
const { editor, element, component } = buildComponent({
const { editor, component } = buildComponent({
autoHeight: false,
rowsPerTile: 2
});

// Set `line-height` to an integer to save us headaches later. (We
// believe that Chromium used to guarantee fixed increments of line
// height, but doesn't anymore — so we must specify it as an integer
// value ourselves if we want the math to be simpler.)
element.style.lineHeight = '20px';
component.measureCharacterDimensions();

// Make the editor tall enough to fit only two lines at a time.
Comment on lines -3600 to -3608
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the additions in this file are purposeful; they're what I had to add to get specs to pass in Electron 30. They need to stay.

await setEditorHeightInLines(component, 2);

expect(component.getRenderedStartRow()).toBe(0);

// This suggests one extra tile is rendered below the viewport just out
// of view. (But why is this `4` rather than `3`, since we're
// zero-indexed? This seems like a mistake in `getRenderedEndRow` logic.)
expect(component.getRenderedEndRow()).toBe(4);

// Create a marker spanning the fourth and fifth rows…
const marker1 = editor.markScreenRange([[3, 0], [5, 0]], {
reversed: false
});

// …and decorate it with a DIV.
const item1 = document.createElement('div');
editor.decorateMarker(marker1, { type: 'block', item: item1 });

// Repeat, but with the marker reversed.
const marker2 = editor.markScreenRange([[3, 0], [5, 0]], {
reversed: true
});
const item2 = document.createElement('div');
editor.decorateMarker(marker2, { type: 'block', item: item2 });

await component.getNextUpdatePromise();

// We do not expect the first block decoration to be rendered; its head
// is outside the renderered range.
expect(item1.parentElement).toBeNull();

// But we expect the second decoration to be present because its head
// _is_ within the rendered range. (Remember that a “reversed” marker has
// its head _before_ its tail, but a non-reversed marker starts with its
// tail and ends with its head. Read the text-buffer docs for `Marker`
// for further understanding.)
//
// This comment does not imply understanding of the reasoning behind
// this — just that this is the relevant difference in behavior between
// the two decorations.
expect(item2.nextSibling).toBe(lineNodeForScreenRow(component, 3));

// Scroll down so that the fifth line is the first one visible.
await setScrollTop(component, 4 * component.getLineHeight());

// Again, lines 4-5-6-7 (zero-indexed) are understood to be visible, but
// `getRenderedEndRow` will report an end row of `8`, which is its own
// quirk.
expect(component.getRenderedStartRow()).toBe(4);
expect(component.getRenderedEndRow()).toBe(8);

// Now the logic is reversed; the rendered range includes the head of
// the first decoration, but not of the second decoration. Hence the
// first decoration is renderered and the second isn't.
expect(item1.nextSibling).toBe(lineNodeForScreenRow(component, 5));
expect(item2.parentElement).toBeNull();
});
Expand Down Expand Up @@ -5649,9 +5608,6 @@ describe('TextEditorComponent', () => {
rowsPerTile: 1,
autoHeight: false
});
// Set the initial line height to match that of the editor font size.
element.style.lineHeight = Math.ceil(parseFloat(getComputedStyle(element).fontSize)) + 'px'
component.measureCharacterDimensions();
await setEditorHeightInLines(component, 3);
await setEditorWidthInCharacters(component, 20);
component.setScrollTopRow(4);
Expand Down Expand Up @@ -6035,8 +5991,6 @@ describe('TextEditorComponent', () => {
rowsPerTile: 3,
autoHeight: false
});
element.style.lineHeight = '20px';
component.measureCharacterDimensions();
element.style.height =
4 * component.measurements.lineHeight +
horizontalScrollbarHeight +
Expand Down
Loading
Loading