You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(snippets): make automatic cursor placement an optional feature
This is ostensibly a reversion of v6.2.0, as that version's only change
was the (non-optional) removal of auto-cursor, where this version makes
it an optional feature
Refs: 5e57a39
<dd><p><ahref="#user-content-bibtexlanguage">BibTeX</a> language support with <ahref="#user-content-biblatexlanguage">BibLaTeX</a> dialect support, autocompletion <ahref="#user-content-bibtexcompletion">configuration</a>, and <ahref="https://codemirror.net/docs/ref/#autocomplete.snippet">snippets</a> for both BibTeX and BibLaTeX that are suggested based on the editor <ahref="https://codemirror.net/docs/ref/#autocomplete.CompletionContext">context</a>.</p>
37
37
<p>There are configuration options for the following:</p>
@@ -54,6 +54,15 @@ const view = new EditorView({
54
54
<li>Snippets have been scaffolded as per the current <ahref="https://ctan.org/ctan-ann/id/mailman.3109.1292253131.2307.ctan-ann@dante.de">BibTeX</a>/<ahref="https://ctan.org/ctan-ann/id/mailman.404.1656879977.32352.ctan-ann@ctan.org">BibLaTeX</a> specs. The snippet <ahref="https://codemirror.net/docs/ref/#autocomplete.CompletionSection">render config</a>, exclusion of certain snippets, and entry snippets' suggestion of recommendation/optional fields are done in an <ahref="https://www.citedrive.com/en/blog/codemirror-bibtex-plugin">opinionated</a> manner (<ahref="https://github.com/citedrive/codemirror-lang-bibtex/issues">suggestions</a> are welcome!).</li>
55
55
</ul>
56
56
</li>
57
+
<li><strong>Automatic Cursor Placement</strong>:
58
+
<ul>
59
+
<li>default: <code>autoCursor: true</code></li>
60
+
<li>Automatically place the cursor in ideal location(s) when expanding a snippet. This, as well, is <ahref="https://www.citedrive.com/en/blog/codemirror-bibtex-plugin">opinionated</a>.</li>
61
+
<li>Please note that this feature relies on the cursor state (which is tracked by <ahref="https://codemirror.net/docs/ref/#state.EditorState">EditorState</a>). When overwriting the EditorState (in a non user-input related manner, i.e. via a formatting plugin), the future cursor locations do not always persist, leading to a clunky (or sometimes fully inoperable) experience.</li>
62
+
<li>Thus, if your CodeMirror implementation relies heavily on modifying/overwriting EditorState, I would recommend testing both with and without this feature, to see which works best for your use-case.</li>
63
+
<li><em>(As an aside: I have some ideas on how to fix this issue, but I have just started a new semester at uni and will likely not have much time to work on the plugin for the next few months. - Vai)</em></li>
/// - Snippets have been scaffolded as per the current [BibTeX](https://ctan.org/ctan-ann/id/mailman.3109.1292253131.2307.ctan-ann@dante.de)/[BibLaTeX](https://ctan.org/ctan-ann/id/mailman.404.1656879977.32352.ctan-ann@ctan.org) specs. The snippet [render config](#autocomplete.CompletionSection), exclusion of certain snippets, and entry snippets' suggestion of recommendation/optional fields are done in an [opinionated](https://www.citedrive.com/en/blog/codemirror-bibtex-plugin) manner ([suggestions](https://github.com/citedrive/codemirror-lang-bibtex/issues) are welcome!).
95
+
/// - **Automatic Cursor Placement**:
96
+
/// - default: `autoCursor: true`
97
+
/// - Automatically place the cursor in ideal location(s) when expanding a snippet. This, as well, is [opinionated](https://www.citedrive.com/en/blog/codemirror-bibtex-plugin).
98
+
/// - Please note that this feature relies on the cursor state (which is tracked by [EditorState](#state.EditorState)). When overwriting the EditorState (in a non user-input related manner, i.e. via a formatting plugin), the future cursor locations do not always persist, leading to a clunky (or sometimes fully inoperable) experience.
99
+
/// - Thus, if your CodeMirror implementation relies heavily on modifying/overwriting EditorState, I would recommend testing both with and without this feature, to see which works best for your use-case.
100
+
/// - _(As an aside: I have some ideas on how to fix this issue, but I have just started a new semester at uni and will likely not have much time to work on the plugin for the next few months. - Vai)_
95
101
/// - **Syntax Linting**:
96
102
/// - default: `syntaxLinter: true`
97
103
/// - Invalid BibTeX (and BibLaTeX) syntax is underlined in red and a warning is issued, thanks to [bibtex-tidy](https://github.com/flamingtempura/bibtex-tidy).
0 commit comments