argenos/hotkeysplus-obsidian

Cursor is placed at beginning of line with non-legacy editor

Closed this issue · 4 comments

When I switch to the non-legacy editor and toggle an empty line to a bullet list, a to-do list, or a block quote, the cursor is placed at the beginning of the line rather than at the end of the line. When the legacy editor is set, the cursor is placed at the end of the line after such toggling.

This makes it so I can't immediately start typing and instead have to move the cursor. It would be more convenient if the cursor placement was consistent with the legacy editor way of doing things.

Interestingly, this doesn't seem to occur if the cursor is already at the end of the line filled with text. This only occurs if it's a blank line or if the cursor is in the middle of line with characters.

Actually I'm not sure this part is functioning correctly.

// Keep cursor in the same place
if (selection) {
editor.setSelection(selectedText.start, {
line: selectedText.end.line,
ch: editor.getLine(selectedText.end.line).length,
});
}

When I select some characters within the line and trigger the toggle, are only those characters supposed to remain selected? Even in the non-legacy editor the whole line becomes selected.

I wonder if just explicitly moving the cursor to the end of the line after a toggle operation would be the way to go. That's how it behaves in the non-legacy editor currently (at least in the my environment, no idea if that's consistent). Perhaps that's what people have come to expect.

Were you able to solve the problem ??

Alas, no. I'm sticking with the legacy editor for now. Not sure this plugin is supported any more.

Ah, silly me. It seems most of this plugin's functionality has been integrated into base Obsidian. Toggling to bullet lists, numbered lists, checkbox statuses, and really any other toggle-able feature is all accessible through the command palette (and therefore hotkey assignable).

It seems like this plugin is obsolete.