phibr0 / obsidian-emoji-shortcodes

Emoji Shortcodes - Obsidian Plugin | Adds Support for Emoji Shortcodes to Obsidian
MIT License
181 stars 15 forks source link

Fix Bugs Reported in Issue#13 #14

Closed tswwe closed 3 years ago

tswwe commented 3 years ago

This patch addresses the bugs reported in Issue#13. Note: Because I don't have a typescript compiler, these changes are made base on my local modified .obsidian/plugins/emoji-shortcodes/main.js file, which is proved to work for me. Anyway, further test may be needed.

phibr0 commented 3 years ago

Looks good, will test it before merge

phibr0 commented 3 years ago

Okay everything works great, except when you press Enter in the Suggester it will insert the currently selected Emoji and go to the next line (because of the Enter key press). Any obvious way to "only eat the Enter keypress, when a emoji is entered"?

tswwe commented 3 years ago

Thank you for reviewing and finding out the case I ignored. I have pushed a new commit to the patch-issue#13-tswwe branch to fix it. To be specific, the new commit just adds one line (return false;) into line#84 in suggest.ts. (I believed if I don't write the return false line, the function will return false as default. But it seems not to behavior like what I expected? So I added return false explicitly, and it works now (press Enter in the Suggester it will insert the currently selected Emoji and NOT go to the next line).)

phibr0 commented 3 years ago

I will create the Release later today