Skip to content

Commit

Permalink
Update command name and method of finding activeEditor following guid…
Browse files Browse the repository at this point in the history
  • Loading branch information
SimplGy committed Mar 12, 2023
1 parent 1e9fa93 commit 9489362
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "emoji-magic",
"name": "Emoji Magic",
"version": "0.1.2",
"version": "0.1.3",
"description": "Easily add emoji, with a powerful keyword search. 🔮 ✨ 🐇",
"author": "simplgy",
"authorUrl": "https://github.com/simplgy",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-emoji-magic",
"version": "0.1.2",
"version": "0.1.3",
"description": "",
"main": "main.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { App, Plugin, PluginSettingTab, MarkdownView } from 'obsidian';
import { App, Plugin, PluginSettingTab } from 'obsidian';

import { SearchModal } from './search_modal';
import { EmojiMagicSettings } from './interfaces';
Expand Down Expand Up @@ -64,7 +64,7 @@ export default class EmojiMagicPlugin extends Plugin {
// if you "add" with the same id, it works as an "update"
this.addCommand({
id: 'insert', // automatically prefixed with plugin name
name: `Find an emoji and insert it where your cursor is`,
name: `Insert emoji...`,
callback: () => this.openSearchUX(),
});
}
Expand All @@ -77,7 +77,7 @@ export default class EmojiMagicPlugin extends Plugin {
}

insertTextAtCursor = (text: string) => {
const view = this.app.workspace.getActiveViewOfType(MarkdownView);
const view = this.app.workspace.activeEditor;

// Make sure the user is editing a Markdown file.
if (view) {
Expand Down

0 comments on commit 9489362

Please sign in to comment.