Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from savetheclocktower/apd-refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
confused-Techie authored Apr 9, 2024
2 parents c70bd25 + 2acdf6d commit feab33f
Show file tree
Hide file tree
Showing 123 changed files with 23,251 additions and 13,491 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
node_modules
_dist
hovercard_list.json
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
[submodule "submodules/dot-github"]
path = submodules/dot-github
url = https://github.com/pulsar-edit/.github
[submodule "submodules/node-patchwatcher"]
path = submodules/node-patchwatcher
[submodule "submodules/node-pathwatcher"]
path = submodules/node-pathwatcher
url = https://github.com/pulsar-edit/node-pathwatcher
1 change: 1 addition & 0 deletions docs/api/api.11tydata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"indexTitle": "",
"sidebar": [
{
"text": "Pulsar API",
Expand Down
13 changes: 7 additions & 6 deletions docs/behind-pulsar/behind-pulsar.11tydata.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
{
"indexTitle": "Behind Pulsar",
"sidebar": [
{
"text": "Configuration API",
"link": "configuration-api"
"link": "/behind-pulsar/configuration-api"
},
{
"text": "Keymaps in-depth",
"link": "keymaps-in-depth"
"link": "/behind-pulsar/keymaps-in-depth"
},
{
"text": "Scoped settings, scopes and scope descriptors",
"link": "scoped-settings"
"link": "/behind-pulsar/scoped-settings"
},
{
"text": "Serialization in Pulsar",
"link": "serialization-in-pulsar"
"link": "/behind-pulsar/serialization-in-pulsar"
},
{
"text": "Developing node modules",
"link": "developing-node-modules"
"link": "/behind-pulsar/developing-node-modules"
},
{
"text": "Interacting with other packages via services",
"link": "interacting-with-other-packages-via-services"
"link": "/behind-pulsar/interacting-with-other-packages-via-services"
}
]

Expand Down
25 changes: 5 additions & 20 deletions docs/behind-pulsar/configuration-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ if (atom.config.get("editor.showInvisibles")) {
}
```

Or you can subscribe via `atom.config.observe` to track changes from any view
object.
Or you can subscribe via `atom.config.observe` to track changes from any view object.

```js
const {View} = require('space-pen')
Expand All @@ -36,31 +35,17 @@ class MyView extends View {
}
```

The `atom.config.observe` method will call the given callback immediately with
the current value for the specified key path, and it will also call it in the
future whenever the value of that key path changes. If you only want to invoke
the callback the next time the value changes, use `atom.config.onDidChange`
instead.
The `atom.config.observe` method will call the given callback immediately with the current value for the specified key path, and it will also call it in the future whenever the value of that key path changes. If you only want to invoke the callback the next time the value changes, use `atom.config.onDidChange` instead.

Subscription methods return [`Disposable`](/api/pulsar/latest/Disposable/)
objects that can be used to unsubscribe. Note in the example above how we save
the subscription to the `@fontSizeObserveSubscription` instance variable and
dispose of it when the view is detached. To group multiple subscriptions
together, you can add them all to a [`CompositeDisposable`](/api/pulsar/latest/CompositeDisposable/)
that you dispose when the view is detached.
Subscription methods return [`Disposable`](/api/pulsar/latest/Disposable/) objects that can be used to unsubscribe. Note in the example above how we save the subscription to the `@fontSizeObserveSubscription` instance variable and dispose of it when the view is detached. To group multiple subscriptions together, you can add them all to a [`CompositeDisposable`](/api/pulsar/latest/CompositeDisposable/) that you dispose when the view is detached.

## Writing Config Settings

The `atom.config` database is populated on startup from
**_LNX/MAC_**: `~/.pulsar/config.cson` -
**_WIN_**: `%USERPROFILE%\.pulsar\config.cson`
but you can programmatically write to it with `atom.config.set`:
The `atom.config` database is populated on startup from <span class="platform-linux platform-mac">`~/.pulsar/config.cson`</span> <span class="platform-win">`%USERPROFILE%\.pulsar\config.cson`</span> but you can programmatically write to it with `atom.config.set`:

```js
// basic key update
atom.config.set("core.showInvisibles", true);
```

If you're exposing package configuration via specific key paths, you'll want to
associate them with a schema in your package's main module. Read more about
schemas in the [Config API documentation](/api/pulsar/latest/Config/).
If you're exposing package configuration via specific key paths, you'll want to associate them with a schema in your package's main module. Read more about schemas in the [Config API documentation](/api/pulsar/latest/Config/).
31 changes: 5 additions & 26 deletions docs/behind-pulsar/keymaps-in-depth.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,7 @@ when keystrokes pass through `atom-text-editor` elements:

:::

Beneath the first selector are several keybindings, mapping specific key
combinations to commands. When an element with the `atom-text-editor` class is
focused and
**_LNX/WIN_**: [[Ctrl+Backspace]] -
**_MAC_**: [[Alt+Backspace]]
is pressed, a custom DOM event called `editor:delete-to-beginning-of-word` is
emitted on the `atom-text-editor` element.
Beneath the first selector are several keybindings, mapping specific key combinations to commands. When an element with the `atom-text-editor` class is focused and <kbd class="platform-linux platform-win">Ctrl+Backspace</kbd> <kbd class="platform-mac">Alt+Backspace</kbd> is pressed, a custom DOM event called `editor:delete-to-beginning-of-word` is emitted on the `atom-text-editor` element.

The second selector group also targets editors, but only if they don't have the
`mini` attribute. In this example, the commands for code folding don't really
Expand Down Expand Up @@ -107,13 +101,7 @@ atom.commands.add("atom-text-editor", {
`atom.commands` refers to the global `CommandRegistry` instance where all
commands are set and consequently picked up by the command palette.

When you are looking to bind new keys, it is often useful to use the Command
Palette
(**_LNX/WIN_**: [[Ctrl+Shift+P]] -
**_MAC_**: [[Cmd+Shift+P]])
to discover what commands are being listened for in a given focus context.
Commands are "humanized" following a simple algorithm, so a command like
`editor:fold-current-row` would appear as "Editor: Fold Current Row".
When you are looking to bind new keys, it is often useful to use the Command Palette <kbd class="platform-linux platform-win">Ctrl+Shift+P</kbd> <kbd class="platform-mac">Cmd+Shift+P</kbd> to discover what commands are being listened for in a given focus context. Command names are "humanized" following a simple algorithm, so a command like `editor:fold-current-row` would appear as "Editor: Fold Current Row".

### "Composed" Commands

Expand Down Expand Up @@ -182,15 +170,9 @@ which is normally used to trigger the `tree-view:add-file` command:

![Keybinding Resolver](/img/atom/keybinding.png)

But if some element above the Tree View had a keybinding for `a`, that
keybinding would still execute even when the focus is inside the Tree View.
But if some element above the Tree View had a keybinding for `a`, that keybinding would still execute even when the focus is inside the Tree View.

When the keymap system encounters a binding with the `abort!` directive as its
command, it will stop searching for a keybinding. For example, the following
code removes the keybinding for
**_LNX/WIN_**: [[Ctrl+O]] -
**_MAC_**: [[Cmd+O]]
when the selection is inside an editor pane:
When the keymap system encounters a binding with the `abort!` directive as its command, it will stop searching for a keybinding. For example, the following code removes the keybinding for <kbd class="platform-linux platform-win">Ctrl+O</kbd> <kbd class="platform-mac">Cmd+O</kbd> when the selection is inside an editor pane:

::: tabs#behind-pulsar

Expand All @@ -217,10 +199,7 @@ when the selection is inside an editor pane:

:::

But if you click inside the Tree View and press
**_LNX/WIN_**: [[Ctrl+O]] -
**_MAC_**: [[Cmd+O]]
, it will work.
But if you click inside the Tree View and press <kbd class="platform-linux platform-win">Ctrl+O</kbd> <kbd class="platform-mac">Cmd+O</kbd>, it will work.

## Forcing Chromium's Native Keystroke Handling

Expand Down
Original file line number Diff line number Diff line change
@@ -1,54 +1,55 @@
{
"indexTitle": "Core Packages & Features",
"sidebar": [
{
"text": "Find and Replace",
"link": "find-and-replace",
"summary": "Find and replace text"
"link": "/core-packages-and-features/find-and-replace",
"summary": "Find and replace within buffers and across the project."
},
{
"text": "Snippets",
"link": "snippets",
"summary": "Expand text"
"link": "/core-packages-and-features/snippets",
"summary": "Expand text via special prefixes or via the autocomplete menu."
},
{
"text": "Autocomplete",
"link": "autocomplete",
"summary": "Work with suggested autocompletions as you type"
"link": "/core-packages-and-features/autocomplete",
"summary": "Work with suggested autocompletions as you type."
},
{
"text": "Folding",
"link": "folding",
"summary": "Collapse text in a file"
"text": "Version Control in Pulsar",
"link": "/core-packages-and-features/version-control-in-pulsar",
"summary": "Keep a history of your files’ changes."
},
{
"text": "Panes",
"link": "panes",
"summary": "Understand the layout within Pulsar"
"text": "GitHub Package",
"link": "/core-packages-and-features/github-package",
"summary": "Integrate with GitHub from within Pulsar."
},
{
"text": "Grammar",
"link": "grammar",
"summary": "Learn how text receives Syntax Highlighting"
"text": "Spell Check",
"link": "/core-packages-and-features/spell-check",
"summary": "Fix misspellings in your text."
},
{
"text": "Version Control in Pulsar",
"link": "version-control-in-pulsar",
"summary": "Keep a history of your files changes"
"text": "Previews",
"link": "/core-packages-and-features/previews",
"summary": "See what your prose files look like rendered."
},
{
"text": "GitHub Package",
"link": "github-package",
"summary": "Integrate directly within GitHub"
"text": "Folding",
"link": "/core-packages-and-features/folding",
"summary": "Collapse text in a file."
},
{
"text": "Spell Check",
"link": "spell-check",
"summary": "Fix mis-spellings in your text"
"text": "Panes",
"link": "/core-packages-and-features/panes",
"summary": "Understand how items are arranged in the Pulsar workspace."
},
{
"text": "Previews",
"link": "previews",
"summary": "See what your prose files look like rendered"
"text": "Grammars",
"link": "/core-packages-and-features/grammar",
"summary": "Learn how text receives syntax highlighting."
}
]
}
29 changes: 5 additions & 24 deletions docs/core-packages-and-features/find-and-replace.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,10 @@ layout: doc.ejs

Finding and replacing text in your file or project is quick and easy in Pulsar.

::: tabs#using-pulsar
::: info Shortcuts

@tab Linux

- [[Ctrl+F]] - Search within a buffer
- [[Ctrl+Shift+F]] - Search the entire project

@tab macOS

- [[Cmd+F]] - Search within a buffer
- [[Cmd+Shift+F]] - Search the entire project

@tab Windows

- [[Ctrl+F]] - Search within a buffer
- [[Ctrl+Shift+F]] - Search the entire project
- <kbd class="platform-linux platform-win">Ctrl+F</kbd> <kbd class="platform-mac">Cmd+F</kbd> - Search within a buffer
- <kbd class="platform-linux platform-win">Ctrl+Shift+F</kbd> <kbd class="platform-mac">Cmd-Shift-F</kbd> - Search the entire project

:::

Expand All @@ -29,13 +17,7 @@ Replace panel at the bottom of your screen.

![Find and replace text in the current file](/img/atom/find-replace-file.png "Find and replace text in the current file")

To search within your current file you can press
**_LNX/WIN_**: [[Cmd+F]] -
**_MAC_**: [[Ctrl+F]], type in a search string and press
**_LNX/WIN/MAC_**: [[Enter]] or
**_LNX/WIN_**[[F3]] -
**_MAC_**: [[Cmd+G]] or the "Find Next" button) multiple
times to cycle through all the matches in that file. [[Alt+Enter]] will
To search within your current file you can press <kbd class="platform-linux platform-win">Ctrl+F</kbd> <kbd class="platform-mac">Cmd+F</kbd>, type in a search string and press <span class="platform-linux platform-win"><kbd>Enter</kbd> or <kbd>F3</kbd></span> <span class="platform-mac"><kbd>Enter</kbd> or <kbd>Cmd+G</kbd></span> (or the “Find Next” button) multiple times to cycle through all the matches in that file. [[Alt+Enter]] will
find all occurrences of the search string. The Find and Replace panel also
contains buttons for toggling case sensitivity, performing regular expression
matching, scoping the search to selections, and performing whole word search.
Expand All @@ -57,8 +39,7 @@ to learn more about regular expression syntax you can use in Pulsar.
:::

You can also find and replace throughout your entire project if you invoke the
panel with **_LNX/WIN_**: [[Ctrl+Shift+F]] -
**_MAC_**: [[Cmd+Shift+F]].
panel with <kbd class="platform-linux platform-win">Ctrl+Shift+F</kbd> <kbd class="platform-mac">Cmd+Shift+F</kbd>.

![Find and replace text in your project](/img/atom/find-replace-project.png "Find and replace text in your project")

Expand Down
53 changes: 3 additions & 50 deletions docs/core-packages-and-features/folding.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,10 @@ If you want to see an overview of the structure of the code file you're working
on, folding can be a helpful tool. Folding hides blocks of code such as
functions or looping blocks in order to simplify what is on your screen.

::: tabs#using-pulsar

@tab linux

You can fold blocks of code by clicking the arrows that appear when you hover
your mouse cursor over the gutter. You can also fold and unfold from the
keyboard with the [[Alt+Ctrl+[]] and [[Alt+Ctrl+]]] keybindings.

![Code folding example](/img/atom/folding.png "Code folding example")

To fold everything, use [[Alt+Ctrl+Shift+[]] and to unfold everything use
[[Alt+Ctrl+Shift+]]]. You can also fold at a specific indentation level
with [[Ctrl+K]] [[Ctrl+0-9]] where the number is the indentation
depth.

Finally, you can fold arbitrary sections of your code or text by making a
selection and then typing [[Alt+Ctrl+F]] or choosing "Fold Selection" in
the Command Palette.

@tab macOS

You can fold blocks of code by clicking the arrows that appear when you hover
your mouse cursor over the gutter. You can also fold and unfold from the
keyboard with the [[Alt+Cmd+[]] and [[Alt+Cmd+]]] keybindings.
You can fold blocks of code by clicking the arrows that appear when you hover your mouse cursor over the gutter. You can also fold and unfold from the keyboard with the <kbd class="platform-linux platform-win">Alt+Ctrl+\[</kbd><kbd class="platform-mac">Alt+Cmd+\[</kbd> and <kbd class="platform-linux platform-win">Alt+Ctrl+\]</kbd><kbd class="platform-mac">Alt+Cmd+\]</kbd> keybindings.

![Code folding example](/img/atom/folding.png "Code folding example")

To fold everything, use [[Alt+Cmd+Shift+[]] and to unfold everything use
[[Alt+Cmd+Shift+]]]. You can also fold at a specific indentation level
with [[Cmd+K]] [[Cmd+0-9]] where the number is the indentation
depth.

Finally, you can fold arbitrary sections of your code or text by making a
selection and then typing [[Alt+Cmd+Ctrl+F]] or choosing "Fold Selection"
in the Command Palette.

@tab Windows

You can fold blocks of code by clicking the arrows that appear when you hover
your mouse cursor over the gutter. You can also fold and unfold from the
keyboard with the [[Alt+Ctrl+[]] and [[Alt+Ctrl+]]] keybindings.

![Code folding example](/img/atom/folding.png "Code folding example")

To fold everything, use [[Alt+Ctrl+Shift+[]] and to unfold everything use
[[Alt+Ctrl+Shift+]]]. You can also fold at a specific indentation level
with [[Ctrl+K]] [[Ctrl+0-9]] where the number is the indentation
depth.

Finally, you can fold arbitrary sections of your code or text by making a
selection and then typing [[Alt+Ctrl+F]] or choosing "Fold Selection" in
the Command Palette.
To fold everything, use <kbd class="platform-linux platform-win">Alt+Ctrl+Shift+\[</kbd><kbd class="platform-mac">Alt+Cmd+Shift+\[</kbd> and to unfold everything use <kbd class="platform-linux platform-win">Alt+Ctrl+Shift+\]</kbd><kbd class="platform-mac">Alt+Cmd+Shift+\]</kbd>. You can also fold at a specific indentation level with <span class="platform-linux platform-win"><kbd>Ctrl+K</kbd> <kbd>Ctrl+0-9</kbd></span> <span class="platform-mac"><kbd>Cmd+K</kbd> <kbd>Cmd+0-9</kbd></span> where the number is the indentation depth.

:::
Finally, you can fold arbitrary sections of your code or text by making a selection and then typing <kbd class="platform-linux platform-win">Alt+Ctrl+F</kbd> <kbd class="platform-mac">Alt+Cmd+Ctrl+F</kbd> or choosing "Fold Selection" in the Command Palette.
18 changes: 4 additions & 14 deletions docs/core-packages-and-features/github-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,10 @@ commit. Choose between staging...
- **Files**: Double-click a file or select a file and press [[Enter]].
- **Hunk**: Click on the "Stage Hunk" button or select a hunk and press [[Enter]].
- **Lines**: Click on a line (or drag on multiple lines) to select, then click
on the "Stage Selection" button. Or use the
**_LNX/WIN_**: [[Ctrl+/]] -
**_MAC_**: [[Cmd-/]] key to toggle from hunk mode to line mode, then
press
**_LNX/WIN_**: [[Ctrl-Enter]] -
**_MAC_**: [[Cmd-Enter]] to stage
just a single line.

Use the
**_LNX/WIN_**: [[Cmd-Left]] -
**_MAC_**: [[Ctrl-Left]] or
**_LNX/WIN_**: [[Ctrl-Right]] -
**_MAC_**: [[Cmd-Right]] arrow key to switch between
file list and the diff view. Unstaging can be done in the same way.
on the "Stage Selection" button. Or use the <kbd class="platform-linux platform-win">Ctrl+/</kbd> <kbd class="platform-mac">Cmd+/</kbd> key to toggle from hunk mode to line mode, then
press <kbd class="platform-linux platform-win">Ctrl+Enter</kbd> <kbd class="platform-mac">Cmd+Enter</kbd> to stage just a single line.

Use the <kbd class="platform-linux platform-win">Ctrl+Left</kbd> <kbd class="platform-mac">Cmd+Left</kbd> or <kbd class="platform-linux platform-win">Ctrl+Right</kbd> <kbd class="platform-mac">Cmd+Right</kbd> arrow keys to switch between file list and the diff view. Unstaging can be done in the same way.

![Stage changes](/img/atom/github-stage.png "Stage changes")

Expand Down
Loading

0 comments on commit feab33f

Please sign in to comment.