CTRL-UP/DOWN => Broken Swap line up/down

Steps to reproduce

Step 1. Bind the “Swap line up” and “Swap line down” hotkeys to something. I have them as Ctrl+Up and Ctrl+Down respectively.

Step 2. Create the following lines in your editor:
1
2
3

DEMONSTRATING SWAP LINE UP
Step 3. Put cursor on “3”
Step 4. Use swap line up hotkey

DEMONSTRATING SWAP LINE DOWN
Step 3. Put cursor on “1”
Step 4. Use swap line down hotkey

Expected result

For swap line up, lines should be reordered like this:
1
3
2

For swap line down, lines should be reordered like this:
2
1
3

Actual result

Swap line up applies the line swap action to the line above it. Swap line down applies the line swap action to the line below it.

Actual result for swap line up:
2
1
3

Actual result for swap line down:
1
3
2

Environment

  • Operating system: windows 10
  • Obsidian version: 0.7.4

Additional information

1 Like

Does this happen if you use alt-up and alt down?

Works if I switch to alt-up/down! Wonder why ctrl+up/down is buggy.

Same problem with CTRL+SHIFT+Up/Down. Not only it swaps incorrect lines, but the more times you swap, the more lines it adds to the selection (and moves 2,3, etc lines up/down)

Merged in https://forum.obsidian.md/t/consolidation-redefining-shortcuts-handled-by-codemirror/4235