When typing a passage link, a suggestion menu appears with matching passage names. However the passage suggestion list closes as soon as a space is typed, either in the passage name or link name.
Steps to reproduce:
Name a passage "Passage Name"
Open a new passage and start typing a link [[Passage, "Passage Name" is suggested
According to the CodeMirror documentation for showHint, extraKeys causes the list of characters provided (in this case ], -, |) to be appended to the standard CodeMirror key list that closes the hint, which includes white space (/[\s()\[\]{};:>,]/_. Using customKeys instead, replaces the standard list.
I suggest using customKeys instead of extraKeys would fix the issue.
Twine version number
2.4.0
Does this problem occur with the web version of Twine or the desktop app?
Desktop app
What operating system does this problem occur on?
Other
If this problem is occurring with the web version of Twine, what browser does it occur on?
No response
Presubmission checklist
[ ] I am interested in working on code that would fix this bug. (This is not required to submit a bug report.)
[X] I have done a search and believe that an issue does not already exist for this bug in the GitHub repository.
[X] I have read and agree to abide by this project's Code of Conduct.
Describe the bug.
When typing a passage link, a suggestion menu appears with matching passage names. However the passage suggestion list closes as soon as a space is typed, either in the passage name or link name.
Steps to reproduce:
[[Passage
, "Passage Name" is suggested[[Passage
, the hint menu dissapearsExpected behavior:
The hint menu does not dissapear
Additional context on this problem.
I think the problem is the use of
extraKeys
in: https://github.com/klembot/twinejs/blob/7c27fc6cf20337292b28e31ed772bc572e761c09/src/store/use-codemirror-passage-hints.ts#L10-L12According to the CodeMirror documentation for showHint,
extraKeys
causes the list of characters provided (in this case ], -, |) to be appended to the standard CodeMirror key list that closes the hint, which includes white space (/[\s()\[\]{};:>,]/
_. UsingcustomKeys
instead, replaces the standard list.I suggest using
customKeys
instead ofextraKeys
would fix the issue.Twine version number
2.4.0
Does this problem occur with the web version of Twine or the desktop app?
Desktop app
What operating system does this problem occur on?
Other
If this problem is occurring with the web version of Twine, what browser does it occur on?
No response
Presubmission checklist