Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Irregular selection when making a column-block selection containing certain characters #9686

Open
sasumner opened this issue Mar 22, 2021 · 4 comments

Comments

@sasumner
Copy link
Contributor

Description of the Issue

It can happen, when attempting to create a rectangular selection using the column-block capability, that the selection contains a differing amount of characters in each row of the block. Short lines in the source for the block and line-ending characters are not in-play in this complaint.

Some more discussion on this starts in THIS discussion thread on the Community site, at this POSTING as well as further down in the long thread.

Steps to Reproduce the Issue

  1. In a fresh 7.9.4 portable edition of N++, create the following data in a tab:
abc🦅def
abcédef
abc∑def
abc1def
  1. Note that each of the four lines contains seven characters.
  2. Place your caret after the c in line 1.
  3. Hold down Shift and Alt.
  4. While continuing to hold down the modifiers from step 4, press DownArrow four times and RightArrow once. Observe the column-block selection appears like this (correctly):
    image
  5. While continuing to hold down the modifiers, press RightArrow again. Observe the column-block selection appears like this (incorrect):
    image

Expected Behavior

After step 6, expect to have two characters in each line selected, and for it to visually appear like this:
image

Actual Behavior

Visually as per step 6 above. In actuality, we have one character from line 1 selected and two characters selected as part of the remainder of the lines.

Debug Information

Notepad++ v7.9.4 (64-bit)
Build time : Mar 15 2021 - 01:03:10
Path : C:...............\npp.7.9.4.portable.x64\notepad++.exe
Admin mode : OFF
Local Conf mode : ON
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 1909
OS Build : 18363.1379
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll NppExport.dll

@Uhf7
Copy link
Contributor

Uhf7 commented Apr 5, 2021

The column block selection of Scintilla seems actually not to be based on columns, but on x-pixel positions in the line. This can be confirmed by using a font with variable character width. Using Arial Unicode MS and the text

X...XXX
XXXXX

the block selection looks like this:
9686

@sasumner
Copy link
Contributor Author

sasumner commented Apr 5, 2021

And some other editors (e.g. Visual Studio's text editor) seem to do the same thing with it.
I fail to see what makes this a useful behavior.

In the past I had control over the width of a character (e.g. in the X...XXX example I could set a monospaced font -- Courier New -- to obtain one-character = one-column-width behavior), but now with certain characters I have no such choice.

@Uhf7
Copy link
Contributor

Uhf7 commented Apr 5, 2021

The behavior is useful for composed characters with a fixed font. Example:

xxxêêêxxx
xxxeeexxx

The ê is composed of U+0065 + U+0302.

@sasumner
Copy link
Contributor Author

sasumner commented Apr 5, 2021

The behavior is useful for composed characters with a fixed font.

That IS a good use!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants