A Community-led Hyper-Hackable Text Editor
Go to file
Andrew Dupont 4eec1c211e [snippets] Fix incorrect range traversal when resolving variables
When we expand a snippet, we know where the variables are within the snippet; they're described using `Point`s, but the origin of the coordinate system is the beginning of the snippet. To translate them into actual buffer `Point`s during snippet expansion, we “add” each point to the `Point` that marks the insertion point of the snippet.

When doing so, we need to remember that, when a snippet contains a newline and content after that newline, that second line of content will be indented by the same amount as the initial line; we know how much leading whitespace (if any) there was before the snippet trigger text and apply it at the head of each line of the expansion.

For this reason, we were adding the two points incorrectly. Since the column position doesn't reset to `0` each time a row is advanced, we should've been using `Point#translate`, not `Point#traverse`.

I'd have caught this earlier if I had thought to test the combination of variable expansion and leading whitespace.

I see other usages of `Point#traverse` in different contexts in this file, but I'll leave them be until they can be proven to be the source of a bug.
2024-06-28 18:32:47 -07:00
.github Update Renovate preset name 2024-05-11 19:06:07 +02:00
docs GH Action Documentation 2024-01-07 23:36:02 +00:00
dot-atom rebrand and relinking to new site 2022-12-31 20:07:22 +00:00
exports Reformat all JS files using prettier 2019-05-31 18:33:56 +02:00
hooks Replace incorrect spellings of 'macOS' with the correct one 2023-01-19 18:54:05 +01:00
integration A vain attempt to get the integration testing working for PHP 2024-01-21 16:11:34 -08:00
keymaps [keymaps] Rename A[a]tom -> P[p]ulsar 2022-08-17 01:22:11 -03:00
menus Revert "[skip ci] Create i18n API" 2023-04-06 16:44:38 -03:00
packages [snippets] Fix incorrect range traversal when resolving variables 2024-06-28 18:32:47 -07:00
ppm@3542dee00f Update ppm to commit 3542dee00f4622f7458f2f65f05e5 2024-05-28 15:09:47 -04:00
resources Revert: WIP: only use an SVG for linux 2024-04-15 16:02:12 -07:00
script electron-builder: Add '--no-sandbox' launch arg for Linux build targets 2024-06-20 10:56:00 -04:00
spec Revert "Merge pull request #810 from pulsar-edit/fix-on-change-cursor-pos" 2024-06-25 15:04:47 -04:00
src Revert "Merge pull request #810 from pulsar-edit/fix-on-change-cursor-pos" 2024-06-25 15:04:47 -04:00
static Add fallback values for new compulsory syntax variables… 2024-02-01 21:35:07 -08:00
vendor Update web-tree-sitter to custom version of 0.20.9 2024-03-06 23:03:11 -08:00
.cirrus.yml Don't need this in the prepare_script step 2024-06-27 23:05:53 -07:00
.codacy.yaml File Glob not having the effect expected 2022-11-20 22:32:37 -08:00
.eslintignore Don’t try to lint JS in the vendor directory 2024-02-04 13:36:33 -08:00
.eslintrc.js Add extensive comment delimiter metadata to most built-in grammars 2024-04-06 13:00:55 -07:00
.gitattributes Make changelog easier to merge 2023-05-16 10:51:48 -03:00
.gitignore Ignore direnv and asdf config files 2023-04-06 12:39:43 -07:00
.gitmodules Update submodule to use the public URL 2022-09-07 18:54:44 -03:00
.nvmrc bump .nvmrc to 16 2022-09-26 01:02:20 +01:00
.yarnrc Make yarn sane 2023-05-29 21:07:19 -03:00
CHANGELOG.md Changelog: grammar and copy editing for 1.118.0 entries 2024-06-15 23:14:06 -04:00
CODE_OF_CONDUCT.md 📝 Update Contributing.md (#20707) 2021-01-19 06:34:39 +03:00
CONTRIBUTING.md use init.js by default 2022-11-03 14:15:11 +01:00
Dockerfile rename Atom to Pulsar in Dockerfile 2022-12-13 19:33:04 +00:00
LICENSE.md update year 2024-01-17 22:21:04 +00:00
package.json meta: Add '-dev' back to the version string 2024-06-17 12:34:45 -04:00
playwright.config.ts Packages test 2022-11-19 01:04:18 -03:00
pnpm-workspace.yaml chore: sync with the repository template 2021-07-21 17:59:40 -05:00
PULL_REQUEST_TEMPLATE.md Apply suggestions from code review 2019-06-14 09:21:07 -07:00
pulsar.sh Return to original logic for ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT 2023-12-12 20:28:55 -08:00
README.md update colours 2024-01-25 02:47:45 +00:00
SUPPORT.md SUPPORT.md add developer documentation, and a minor update (#430) 2022-07-05 19:03:49 -07:00
yarn.lock GH Action Documentation 2024-05-15 03:25:37 +00:00


Badge Discussions Badge Discord Badge Reddit Badge Mastodon Badge Lemmy

Badge Status Badge License


Pulsar


Button Install Button Documentation Button Build

Badge Codacy Badge Crowdin Badge OpenCollective


A Community-led Hyper-Hackable Text Editor, Forked from Atom, built on Electron.

Designed to be deeply customizable, but still approachable using the default configuration.



Preview