feat: release v1.2.0 with configurable word deletion
This commit is contained in:
1 parent
b8461c3eb0
commit
74b3a16151
8 files changed
+228
-111
No files matched your search
+19
@@ -1,4 +1,6 @@
|
||||
import { Editor, MarkdownView, MarkdownFileInfo, Plugin } from 'obsidian';
|
||||
import { deleteGroupBackward, deleteGroupForward } from '@codemirror/commands';
|
||||
import type { EditorView } from '@codemirror/view';
|
||||
|
||||
import {
|
||||
BindThemSettings,
|
||||
@@ -472,6 +474,23 @@ export default class BindThemPlugin extends Plugin {
|
||||
editorCallback: (editor: Editor, view: MarkdownView | MarkdownFileInfo) => {
|
||||
this.deleteToLineBoundary(editor, 'end');
|
||||
}});
|
||||
this.addConditionalCommand({
|
||||
id: 'delete-previous-word',
|
||||
name: 'Delete Previous Word',
|
||||
icon: 'delete',
|
||||
editorCallback: (editor: Editor) => {
|
||||
// Obsidian's Editor.exec API does not expose word deletion.
|
||||
deleteGroupBackward((editor as Editor & { cm: EditorView }).cm);
|
||||
}
|
||||
});
|
||||
this.addConditionalCommand({
|
||||
id: 'delete-next-word',
|
||||
name: 'Delete Next Word',
|
||||
icon: 'delete',
|
||||
editorCallback: (editor: Editor) => {
|
||||
deleteGroupForward((editor as Editor & { cm: EditorView }).cm);
|
||||
}
|
||||
});
|
||||
this.addConditionalCommand({
|
||||
id: 'join-lines',
|
||||
name: 'Join Lines',
|
||||
|
||||
@@ -75,6 +75,8 @@ export const COMMANDS: Record<keyof typeof COMMAND_CATEGORIES, CommandDefinition
|
||||
{ id: 'delete-line', name: 'Delete line' },
|
||||
{ id: 'delete-to-start-of-line', name: 'Delete to start of line' },
|
||||
{ id: 'delete-to-end-of-line', name: 'Delete to end of line' },
|
||||
{ id: 'delete-previous-word', name: 'Delete previous word' },
|
||||
{ id: 'delete-next-word', name: 'Delete next word' },
|
||||
{ id: 'join-lines', name: 'Join lines' },
|
||||
{ id: 'duplicate-line', name: 'Duplicate line' },
|
||||
{ id: 'copy-line-up', name: 'Copy line up' },
|
||||
|
||||
Reference in new issue
Block a user