Skip to content

Commit

Permalink
Merge pull request #435 - move to WASM version of Oniguruma
Browse files Browse the repository at this point in the history
Using "second-mate"
  • Loading branch information
mauricioszabo authored Mar 29, 2023
2 parents 75083fa + 6dd95ec commit c3bcd06
Show file tree
Hide file tree
Showing 44 changed files with 3,753 additions and 208 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

## [Unreleased]

- Migrated away from `node-oniguruma` in favor of `vscode-oniguruma` (WASM
version). This fixes issues with Electron 21

## 1.103.0

- Added a new feature to Search for Pulsar's settings
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"base16-tomorrow-dark-theme": "file:packages/base16-tomorrow-dark-theme",
"base16-tomorrow-light-theme": "file:packages/base16-tomorrow-light-theme",
"bookmarks": "file:packages/bookmarks",
"bracket-matcher": "https://github.com/pulsar-edit/bracket-matcher.git#c877977",
"bracket-matcher": "file:packages/bracket-matcher",
"chai": "4.3.4",
"clear-cut": "^2.0.2",
"coffeescript": "1.12.7",
Expand All @@ -62,7 +62,7 @@
"exception-reporting": "file:packages/exception-reporting",
"find-and-replace": "https://github.com/atom-community/find-and-replace/archive/refs/tags/v0.220.1.tar.gz",
"find-parent-dir": "^0.3.0",
"first-mate": "7.4.3",
"second-mate": "https://github.com/pulsar-edit/second-mate.git#14aa7bd",
"focus-trap": "6.3.0",
"fs-admin": "0.19.0",
"fs-plus": "^3.1.1",
Expand Down
1 change: 1 addition & 0 deletions packages/bracket-matcher/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[See how you can contribute](https://github.com/pulsar-edit/.github/blob/main/CONTRIBUTING.md)
20 changes: 20 additions & 0 deletions packages/bracket-matcher/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2014 GitHub Inc.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
52 changes: 52 additions & 0 deletions packages/bracket-matcher/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Bracket Matcher package

Highlights and jumps between `[]`, `()`, and `{}`. Also highlights matching XML
and HTML tags.

Autocompletes `[]`, `()`, `{}`, `""`, `''`, `“”`, `‘’`, `«»`, `‹›`, and
backticks by default.

Use <kbd>ctrl-m</kbd> to jump to the bracket matching the one adjacent to the cursor.
It jumps to the nearest enclosing bracket when there's no adjacent bracket,

Use <kbd>ctrl-cmd-m</kbd> to select all the text inside the current brackets.

Use <kbd>alt-cmd-.</kbd> to close the current XML/HTML tag.

---
### Configuration

Matching brackets and quotes are sensibly inserted for you. If you dislike this
functionality, you can disable it from the Bracket Matcher section of the
Settings View.

#### Custom Pairs

You can customize matching pairs in Bracket Matcher at any time. You can do so either globally via the Settings View or at the scope level via your `config.cson`. Changes take effect immediately.

* **Autocomplete Characters** - Comma-separated pairs that the editor will treat as brackets / quotes. Entries in this field override the package defaults.
* For example: `<>, (), []`

* **Pairs With Extra Newline** - Comma-separated pairs that enhance the editor's auto indent feature. When used, a newline is automatically added between the pair when enter is pressed between them. Note: This feature is meant to be used in combination with brackets defined for indentation by the active language package (`increaseIndentPattern` / `decreaseIndentPattern`).
Example:
```
fn main() {
| <---- Cursor positioned at one indent level higher
}
```

#### Scoped settings
In addition to the global settings, you are also able to add scope-specific modifications to Pulsar in your `config.cson`. This is especially useful for editor rule changes specific to each language. Scope-specific settings override package defaults _and_ global settings.
Example:
```cson
".rust.source":
"bracket-matcher":
autocompleteCharacters: [
"()"
"[]"
"{}"
"<>"
"\"\""
"``"
]
```
18 changes: 18 additions & 0 deletions packages/bracket-matcher/keymaps/bracket-matcher.cson
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'atom-text-editor':
'ctrl-m': 'bracket-matcher:go-to-matching-bracket'
'ctrl-]': 'bracket-matcher:remove-brackets-from-selection'

'.platform-darwin atom-text-editor':
'ctrl-cmd-m': 'bracket-matcher:select-inside-brackets'
'alt-cmd-.': 'bracket-matcher:close-tag'
'ctrl-backspace': 'bracket-matcher:remove-matching-brackets'

'.platform-linux atom-text-editor':
'ctrl-alt-,': 'bracket-matcher:select-inside-brackets'
'ctrl-alt-.': 'bracket-matcher:close-tag'
'ctrl-alt-backspace': 'bracket-matcher:remove-matching-brackets'

'.platform-win32 atom-text-editor':
'ctrl-alt-,': 'bracket-matcher:select-inside-brackets'
'ctrl-alt-.': 'bracket-matcher:close-tag'
'ctrl-alt-backspace': 'bracket-matcher:remove-matching-brackets'
Loading

0 comments on commit c3bcd06

Please sign in to comment.