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

Bug with RegEx and (Book)marked lines #5361

Closed
rddim opened this issue Mar 1, 2019 · 9 comments
Closed

Bug with RegEx and (Book)marked lines #5361

rddim opened this issue Mar 1, 2019 · 9 comments
Labels
verified Issues verified to be valid and reproducible, PRs that have been tested thoroughly

Comments

@rddim
Copy link
Contributor

rddim commented Mar 1, 2019

Description of the Issue

When I use a regex to mark and bookmark repeated lines and after that use Remove Unmarked Lines and Undo all the lines (with the uniques one) between 1st and last bookmarked lines are also marked.

Steps to Reproduce the Issue

  1. In a text file type:
aaa
bbb
ccc
aaa
aaa
ddd
eee
bbb
bbb
  1. Go to Search > Mark...
  2. In Find what: type ^(.*)$\s+(?=(^.*$\s+)*\1) or ^(.*?)$\s+?^(?=.*^\1$)
  3. Check the Bookmark line, Regular expression and . matches newline
  4. Click Mark All
  5. Go to Search > Bookmark > Remove Unmarked Lines
  6. Click on Undo icon or Edit > Undo

Expected Behavior

After the step 7 I expect to seen the result that is after the step 5

Actual Behavior

The unique lines between 1st and last bookmarked lines are also marked.
npp_regex_mark_bookmark

Debug Information

Notepad++ v7.6.3 (64-bit)
Build time : Jan 27 2019 - 17:16:47
Path : D:\Install\Office Programs\Notepad++\notepad++.exe
Admin mode : ON
Local Conf mode : ON
OS : Windows 7 (64-bit)
Plugins : AutoSave.dll ComparePlugin.dll VisualStudioLineCopy.dll

Edit:

  1. If I use Normal search mode and Find what: aaa or bbb the result is normal with or without bookmarks
  2. If I use step 3 but type aaa or bbb the result is also normal with or without bookmarks
@sasumner
Copy link
Contributor

sasumner commented Mar 1, 2019

To my knowledge, Undo refers to textual changes only and not bookmarking (or other actions). You are certainly free to complain about it not working well with bookmarking.

@rddim
Copy link
Contributor Author

rddim commented Mar 1, 2019

OK, I make another test:
After step 6 and Clear All Bookmarks the result is the same after Undo

Edit:

  1. If I use Normal search mode and Find what: aaa or bbb the result is normal with or without bookmarks
  2. If I use step 3 but type aaa or bbb the result is also normal with or without bookmarks

@MetaChuh MetaChuh added the verified Issues verified to be valid and reproducible, PRs that have been tested thoroughly label Apr 24, 2019
@sasumner
Copy link
Contributor

sasumner commented Aug 7, 2019

Unlike @MetaChuh , I can't follow the reproduction steps well enough to make a determination. @rddim please provide a clearer set of steps, showing what you expect at each step. If this doesn't happen in a few days, I'm going to go ahead and close this issue.

@rddim
Copy link
Contributor Author

rddim commented Aug 9, 2019 via email

@sasumner
Copy link
Contributor

sasumner commented Aug 9, 2019

@rddim That's fine, I will give until 19 Aug 2019 before auto-closure.

@rddim
Copy link
Contributor Author

rddim commented Aug 18, 2019

@sasumner

After following all the 7 steps I expect only lines numbers 1 2 4 and 8 to be marked and bookmarked.

@sasumner
Copy link
Contributor

@rddim Okay, I think I see it now. Sorry for not seeing it earlier and thank you for the clarification.

The complaint is that after the 7 steps to reproduce there is too much (red)marking: Lines 1-8 are all completely (red)marked when the contention is that only lines 1,2,4,8 should be. There is no complaint about how the bookmarks end up after the undo (at least I don't think there is).

[The source of my confusion: The term "mark" is unfortunate (for me at least), because I get it confused between the (red)marking of text and the (book)marking of lines. I would much rather have "marking" be officially called "red-marking", but of course the color can be changed by the user -- red is only the default -- so that's probably not a good idea.]

@sasumner
Copy link
Contributor

sasumner commented Dec 5, 2019

So I still think that "Undo refers to textual changes only...". Consider an initial state:

image

Then make this selection:

image

Press Delete key to get:

image

Press ctrl+z (Undo) to get:

image

Note lack of restoration of redmarking on line 4.

This works similarly for "styling" (similar sequence):

image

image

image

image

In short, I don't think we can call this a "bug". If it is a "feature request" then maybe I feel better about that. :-)

@rddim
Copy link
Contributor Author

rddim commented Dec 8, 2019

Then you can close this issue...

@sasumner sasumner closed this as completed Dec 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
verified Issues verified to be valid and reproducible, PRs that have been tested thoroughly
Projects
None yet
Development

No branches or pull requests

3 participants