mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 07:58:04 +03:00
A Community-led Hyper-Hackable Text Editor
6de4da995b
Spent a lot of time on indents today. Now that `nvim-treesitter` has renamed their indent captures, I figured I should switch to a system whose names made more sense to me. `@indent_end` and `@branch` were too similar to keep as separate things, and have been consolidated into `@dedent`. This system is pretty easy to write queries for, but it's awfully hard to _explain_, so I wonder if I have to go back to the drawing board here. I was convinced of its theoretical elegance, but then found a situation where I needed a different sort of capture, so I also invented `@dedent.next`. So now I'm not so sure. Folds also got a look because they really did need some optimization. When we perform a transaction in the editor, we invalidate the folds cache, and since we know we'll end up querying against each of those lines individually, we can pre-capture each range with a folds query and save some time. The worst thing about indents is the prospect of needing to re-parse the tree separate from the ordinary update process, since the editor calls `suggestedIndentForBufferRow` before the editor transaction finishes. It's not a bottleneck yet, but it could be if a given tree-sitter grammar were particularly slow. We can at least re-use the same tree when one of the `suggestedIndent` methods calls another. |
||
---|---|---|
.github | ||
docs | ||
dot-atom | ||
exports | ||
hooks | ||
integration | ||
keymaps | ||
menus | ||
packages | ||
ppm@a46537c0b7 | ||
resources | ||
script | ||
spec | ||
src | ||
static | ||
vendor | ||
.cirrus.yml | ||
.codacy.yaml | ||
.eslintrc.js | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.nvmrc | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
Dockerfile | ||
LICENSE.md | ||
package.json | ||
playwright.config.ts | ||
pnpm-workspace.yaml | ||
PULL_REQUEST_TEMPLATE.md | ||
pulsar.sh | ||
README.md | ||
SUPPORT.md | ||
yarn.lock |