zyedidia / micro

A modern and intuitive terminal-based text editor

Home Page:https://micro-editor.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

regression: `SpawnMultiCursorUpN` function

usfbih8u opened this issue · comments

There has been a regression in the SpawnMultiCursorUpN function when softwrap: true. Previously (2.0.13) the multi-cursors were created in the next/previous line in LineArray, now (2.0.14) its created in the next/previous visual line. Can this previous behavior be recovered using a new option in settings.json (ignore-wrap-lines?) for ignoring the lines wrapped inside the logic of SpawnMultiCursorUpN so both behaviors can coexist.

Maybe the only change needed (not counting the new option addition) is to add and "or ignore-wrap-lines" in

if !h.Buf.Settings["softwrap"].(bool) {
.

Thanks!

Fair enough, this change in 9f36c57 was done just for "consistently" with CursorUp etc, and it seems there are no actual use cases for it, so I think we can just restore the old behavior, without adding a new option.

I've uploaded #3503 that fixes it.

This turned out to be not so easy to fix (see the PR description), but hopefully it's worth it.

Thanks for the PR!