ox icon indicating copy to clipboard operation
ox copied to clipboard

Line duplicated on Ctrl-Up/Down

Open vlisivka opened this issue 5 years ago • 3 comments

Describe the bug If a file contains one line, and Ctrl-Up or Ctrl-Down is pressed, the line is duplicated.

To Reproduce

  1. Create new file.
  2. Enter one line, without pressing of Enter key.
  3. Press Ctrl-Up.

Expected behavior Editor must do nothing, because the line cannot be moved.

Actual behavior The line is duplicated.

Screenshots Before: Screenshot_2020-11-22_21:27:05

After pressing of Ctrl-Up: Screenshot_2020-11-22_21:27:15

Desktop (please complete the following information):

  • OS: Fedora Linux

vlisivka avatar Nov 22 '20 19:11 vlisivka

thanks for the report.

curlpipe avatar Nov 22 '20 22:11 curlpipe

This problem might be caused by the config/ox.ron. Right now, CTRL+UP and CTRL+DOWN is binded to "move line up" and "move line down" respectively. I suspect that there's something wrong with the macro itself.

tengkuizdihar avatar Dec 19 '20 10:12 tengkuizdihar

I'm new to this project, but I suspect the macro is using the instruction inside of interpret_line(...) in oxa.rs right? I think the problem can be solved by fixing the behavior of Event::InsertLineBelow and Event::InsertLineAbove in the match scope inside of execute(...) in document.rs.

Correct me if I'm wrong, I consider myself a noob at this.

tengkuizdihar avatar Dec 19 '20 11:12 tengkuizdihar