Markpad icon indicating copy to clipboard operation
Markpad copied to clipboard

Shift + Alt + LMB drag in the editor takes into account the window size

Open netricsa opened this issue 2 months ago • 4 comments

Markpad version

2.7.6

How did you install it?

Windows — installer (Markpad_…_setup.exe)

OS and version

Windows 11

What happens, and what you expected instead

If my Markpad window is not scaled to the whole monitor, and I have it on smaller window, the Shift + Alt + LMB drag to select everything in one vertical line at the start of each sentences, it also selects area which is just a word wrap of a single sentence. It should only have selected the Start of each sentence like it does in Notepad ++. Also, if I scale the window a bit too small and try selecting in the similar way, it only selects in that vertical line of a single sentence.

Steps to reproduce

For bug 1 - Open a note and keep the window smaller so text wraps below, so you have 1 sentence covering 2 lines. Alt + Shift + LMB Drag select from top to bottom of all the sentences, and add a hyphen. The hyphen also gets added in the middle sentence. For bug 2 - keep the same note and window to the smallest - horizontally. Try selecting the same way with Alt + Shift + LMB Drag select from top to bottom of all the sentences. Only data in 1 sentence would get selected, and not go down to selection of other sentence start points.

The Markdown that triggers it


Screenshots, and anything else

Image Image

netricsa avatar Sep 09 '26 08:09 netricsa

Image

for the 2nd bug

netricsa avatar Sep 09 '26 08:09 netricsa

Thanks for the screenshots, they make this easy to follow. This is my read of it; the maintainer makes the call.

The first problem comes from the editor component Markpad uses (Monaco, the editor inside VS Code). With word wrap on, column selection works on the lines you see on screen, not the lines in the file, so a wrapped sentence counts as two lines. VS Code does the same thing. For now you can switch Word Wrap off in Settings → Editor, do the column edit, and switch it back on.

The second one I can't explain yet. Could you say exactly where the drag starts and ends: which line, and whether the pointer is over the text or over the line numbers? A short screen recording would help most.

PathGao avatar Sep 10 '26 06:09 PathGao

https://github.com/user-attachments/assets/c313e1a8-181a-45f4-8e69-e8dce6b583d4

Hi, Thank you for the reply, makes sense. The video for small window. Shift + Alt + Mouse drag only goes 2 lines when windows is resized to minimum.

netricsa avatar Sep 11 '26 16:09 netricsa

Found the second one, and it is ours, not Monaco's.

The strip along the bottom of the window — the one showing Ln 5, Col 45, the word count, CRLF, UTF-8 — has to fit on one line. In a small window it does not: the moment your drag creates a second cursor, Markpad adds a "2 selections" reading to that strip, the text there wraps, and the strip becomes two lines tall. The editor above it loses a line of height, and the editor engine cancels a drag that is in progress whenever its height changes. So the selection stops at exactly the point the reading appeared, while the mouse keeps going. Your video shows it: compare the bottom strip at the start with the one in the frames where it says "2 selections".

The same thing ends an ordinary click-and-drag selection, one character in, at that window size.

The fix pins that strip to one line: #773. Until it ships, either make the window a bit wider, or turn the status bar off in Settings — with no strip there is nothing to resize the editor.

The first problem is unchanged: that one is the editor component doing column selection on the lines you see rather than the lines in the file, same as VS Code, and turning Word Wrap off for the edit is still the way around it.

Thanks for the recording — the bug was in the part of the frame nobody was looking at.

PathGao avatar Sep 12 '26 02:09 PathGao