coteditor / CotEditor

Lightweight Plain-Text Editor for macOS
https://coteditor.com
Other
6.37k stars 431 forks source link

Selecting lines with shift+cursor gets confused with line-wrap #1585

Open gingerbeardman opened 8 months ago

gingerbeardman commented 8 months ago

Description

Selecting lines with shift+cursor gets confused after it encounters a line that is wrapped

To Reproduce

  1. Load a file with some long lines, eg. source code
  2. Activate line wrap and/or split window vertically
  3. Use shift+cursor to select line at a time
  4. Cursor selects parts of lines after it encounters line wrap

Expected behavior

CotEditor version

macOS version

Additional context

Screen recording

https://github.com/coteditor/CotEditor/assets/49612/fed42210-ace1-46c2-897a-8a6f3d6a985e

1024jp commented 8 months ago

I'd say it is currently by design that the hanging indentation part is not highlighted when selecting. But, I understand it feels odd.

I'll check whether there is a lightweight way to detour it.

gingerbeardman commented 8 months ago

Well, there are two things happening:

  1. not selecting hanging part of line (normal, expected)
  2. beyond the hanging part selection is no longer working in full lines (bug, unexpected)

For item 2, I tested all my other editors and none of them exhibit this problem.

Source files: https://web.archive.org/web/20060626155423/http://www.ueno.no-ip.org:80/~jinzo/WinCE/download/JZP16/102/JZP16-102-src.zip

main.cpp, search for IDM_PASTE and use narrow window size with word wrap activated.

1024jp commented 7 months ago

Aha, OK. Now I understand the second issue. Let me see if I can fix it.

gingerbeardman commented 7 months ago

Thanks, sorry that my description was not very good.