When deleting a line, the final cursor position is incorrect for wrapped lines

Steps to reproduce

Create a file like this:

a
b
c is an extremely long line that is long enough to wrap onto multiple lines even though it does not contain a line break character
d

Put your cursor on b and press your delete line hotkey (e.g. cmd+D)
Notice the cursor goes to line c (i.e. the line below the deleted line)
Press your delete line hotkey
Notice the cursor goes to line a (i.e. the line above the deleted line)

Expected result

The cursor should go to the line below the deleted line in every case.

Actual result

The cursor goes to the line below the deleted line when a short line is deleted and to the line above the deleted line when a wrapped line is deleted.

This makes deleting lots of lines of varying length very unpredictable.

Environment

  • Operating system: osx
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v1.0.3
    Installer version: v0.15.9
    Operating system: Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 20.3.0
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: light
    Community theme: none
    Snippets enabled: 0
    Restricted mode: off
    Plugins installed: 2
    Plugins enabled: 2
    1: Editor Syntax Highlight v0.1.2
    2: CodeMirror Options v0.6.0

Additional information

None

1 Like

thanks

Also, experiencing the same which is a little bit annoying when editing. I used to start deleting from the end of the section that I need to delete.

My debug info is as follows:

SYSTEM INFO:
	Obsidian version: v1.1.9
	Installer version: v1.0.3
	Operating system: Darwin Kernel Version 22.1.0: Sun Oct  9 20:14:30 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8103 22.1.0
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 7
	Plugins enabled: 7
		1: Dataview v0.5.52
		2: Calendar v1.5.10
		3: Icon Folder v1.5.1
		4: Tasks v1.22.0
		5: Multi-Column Markdown v0.7.6
		6: Templater v1.16.0
		7: Settings Search v1.2.0

RECOMMENDATIONS:
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.