CotEditor icon indicating copy to clipboard operation
CotEditor copied to clipboard

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

Open gingerbeardman opened this issue 1 year ago • 4 comments

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

  • should continue selecting full lines regardless after line wrap is encountered

CotEditor version

  • 4.7.3

macOS version

  • 14.3

Additional context

Screen recording

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

gingerbeardman avatar Jan 27 '24 15:01 gingerbeardman

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.

1024jp avatar Jan 28 '24 14:01 1024jp

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.

  • BBEdit
  • TextMate
  • Sublime Text
  • SubEthaEdit
  • Nova

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.

gingerbeardman avatar Jan 28 '24 15:01 gingerbeardman

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

1024jp avatar Feb 10 '24 14:02 1024jp

Thanks, sorry that my description was not very good.

gingerbeardman avatar Feb 10 '24 16:02 gingerbeardman