1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Desktop: New Markdown editor: Fix horizontal rule button when cursor is not on a new line (#11085)

This commit is contained in:
Henry Heino
2024-09-21 05:00:43 -07:00
committed by GitHub
parent a01f519131
commit be5a6c189a
6 changed files with 61 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import { EditorCommandType, ListType } from '../../types';
import { undo, redo, selectAll, indentSelection, cursorDocStart, cursorDocEnd, cursorLineStart, cursorLineEnd, deleteToLineStart, deleteToLineEnd, undoSelection, redoSelection, cursorPageDown, cursorPageUp, cursorCharRight, cursorCharLeft, insertNewlineAndIndent, cursorLineDown, cursorLineUp, toggleComment, deleteLine, moveLineUp, moveLineDown } from '@codemirror/commands';
import {
decreaseIndent, increaseIndent,
insertHorizontalRule,
toggleBolded, toggleCode,
toggleHeaderLevel, toggleItalicized,
toggleList, toggleMath,
@ -41,6 +42,7 @@ const editorCommands: Record<EditorCommandType, EditorCommandFunction> = {
[EditorCommandType.ToggleHeading3]: toggleHeaderLevel(3),
[EditorCommandType.ToggleHeading4]: toggleHeaderLevel(4),
[EditorCommandType.ToggleHeading5]: toggleHeaderLevel(5),
[EditorCommandType.InsertHorizontalRule]: insertHorizontalRule,
[EditorCommandType.ScrollSelectionIntoView]: editor => {
editor.dispatch(editor.state.update({