https://github.com/krzyzanowskim/STTextView-Plugin-TextFormation
Source Code Typing Completions
https://github.com/krzyzanowskim/STTextView-Plugin-TextFormation
Last synced: 5 months ago
JSON representation
Source Code Typing Completions
- Host: GitHub
- URL: https://github.com/krzyzanowskim/STTextView-Plugin-TextFormation
- Owner: ChimeHQ
- License: bsd-3-clause
- Created: 2023-08-30T22:05:00.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-25T11:27:45.000Z (about 1 year ago)
- Last Synced: 2024-11-14T06:16:19.876Z (11 months ago)
- Language: Swift
- Homepage:
- Size: 43 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[STTextView](https://github.com/krzyzanowskim/STTextView) typing completions with [TextFormation](https://github.com/ChimeHQ/TextFormation).
- ⚠️ There is a bug related to undo. I haven't tracked this down yet.
## Installation
Add the plugin package as a dependency of your application, then register/add it to the `STTextView` instance:
```swift
import TextFormation
import TextFormationPluginlet filters = [
StandardOpenPairFilter(open: "[", close: "]")
]let providers = WhitespaceProviders(
leadingWhitespace: WhitespaceProviders.passthroughProvider,
trailingWhitespace: WhitespaceProviders.removeAllProvider
)textView.addPlugin(
TextFormationPlugin(filters: filters, whitespaceProviders: providers)
)
```Note that both the `Filter` array and `WhitespaceProviders` must be specified statically and cannot be changed for the lifetime of the plugin. If you need to change these, when the document type changes for example, the plugin must be re-created.
## Contributing and Feedback
I'd love to hear from you! Get in touch via an issue or pull request.
By participating in this project you agree to abide by the [Contributor Code of Conduct](CODE_OF_CONDUCT.md).