bujo icon indicating copy to clipboard operation
bujo copied to clipboard

Keyboard shortcuts won't work when modifier is present

Open riccardoferretti opened this issue 2 years ago • 1 comments

If I try to change the status of an item using the keyboard shortcut (e.g. option+x) I get an error if there is a modifier for the item (e.g. !) and there is no space before the modifier.

To reproduce:

  1. type - [ ]! this is an item
  2. press option+x

Note that with - [ ] ! this is an item it works as expected.

riccardoferretti avatar Jul 19 '22 16:07 riccardoferretti

Thanks for pointing this out, @riccardoferretti, and apologizes for the slow response—I was away for a few weeks.

I believe the issue occurs here: https://github.com/mihaiconstantin/bujo/blob/66a4f892f14faafd9e152f2c1b91223f485d6d56/src/models/Symbol.ts#L28

Because the Pattern.extractSymbol(symbol) fails to identify the line as a valid BuJo entry. This can be seen in the regex demo (i.e., https://regex101.com/r/ABVEf2/4) for the following text:

- [ ]! Some example task ^2rj7bd6p8pph

I will fix the regex pattern and push out an update. Thanks for catching this!

mihaiconstantin avatar Aug 10 '22 11:08 mihaiconstantin