Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Shortcut for italics not working when no text selected #6

Closed
eyssette opened this issue Apr 8, 2023 · 3 comments
Closed

Shortcut for italics not working when no text selected #6

eyssette opened this issue Apr 8, 2023 · 3 comments

Comments

@eyssette
Copy link

eyssette commented Apr 8, 2023

Thanks for your very useful vscode extension!
The shortcut for italics doesn't work when no text is selected.
Is it possible to fix that?
Thank you!

@robole
Copy link
Owner

robole commented Apr 8, 2023

hi eysette,

I am not sure how it is possible for there to be an issue! Does it work in the exact same case when you select text? Please try again.

I tested it on my Linux laptop just now and it works fine. The only possibilities I can think of are down to:

  • Working on a file that is not an editable markdown file. Were you working on a brand new, unsaved file perhaps?
  • The snippet is not fired because there is another keybinding for the same key combination. Do you have another keybinding for Ctrl + i?

To give the background. The shortcut is a keybinding to the built-in snippet Insert italic text.. The snippet has this body: *${1:${TM_SELECTED_TEXT}}*$0, which will surround selected text with asterisks. If there is no selected text, it will inserts 2 asterisks and you the cursor will be between the asterisks. The only issue for this shortcut is whether the keybinding triggers the action or not.

To troubleshoot yourself:

  • Test the keybinding fires when you hit Cmd + i, if this works then this extension is doing it job correctly.
  • Test the snippet yourself with a markdown open, run the command Insert Snippet and choose Insert italic text

@eyssette
Copy link
Author

eyssette commented Apr 8, 2023

Thanks for your time!
I have the problem both on my Linux Laptop and my iMac.
I have checked keybindings issues (i still have the problem when i change the keybinding).
The snippet works when I run Insert Snippet and choose Insert italic text, even if no text is selected.
But it still doesn't work when no text is selected and i fire the snippet with a keybinding.

On my iMac, an error is displayed : [getWordRangeAtPosition]: ignoring custom regexp '\_?[A-Za-z\u00C0-\u017F]*\_?' because it matches the empty string.

@robole
Copy link
Owner

robole commented Apr 8, 2023

hi @eyssette

I can't do anything else for you. I can't reproduce the issue.

This extension is just configuration, and nothing has changed in 3 years. It is unlikely an issue with the extension. It is either VS Code has introduced a new issue, or some funky configuration on your end.

I will close the issue for now. If you find out what it is you can let me know.

@robole robole closed this as completed Apr 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants