gracelang / grace-web-editor

A simple editor for Grace
GNU General Public License v3.0
2 stars 8 forks source link

Auto-pair brackets clashes with ]] => ⟧ shortcut #58

Open apblack opened 5 years ago

apblack commented 5 years ago

The normal behaviour of the editor is to replace [[ by ⟦ and ]] by ⟧. This works fine.

However, if the user turns on the authors-pair brackets feature (in settings), then the "[" key inserts "[ ]". The second "[" also inserts "[" and "]", (inside the prior pair). The [[ is converted to ⟦, but the ]] is not converted to ⟧, which looks really weird.

I'm guessing that this happens because the conversion of ]] to ⟧ normally takes place only if the cursor is just right of the second ], and in this scenario, it's not.

apblack commented 10 months ago

A possible fix would be to perform the conversion from ]] to ⟧ when the cursor is just left of the ]], as well as when it is just right.