Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Searches using regular expressions and look ahead/behind do not update correctly #1148

Open
1 task done
torik42 opened this issue Mar 18, 2021 · 2 comments
Open
1 task done

Comments

@torik42
Copy link

torik42 commented Mar 18, 2021

Prerequisites

Description

The results of find-and-replace usually update when the file is changed. However, this does not work as expected when using regular expressions with look-ahead/-behind.

Steps to Reproduce

  1. Open a file.
  2. Add some text, e.g. bdb ada adb ada adb.
  3. Open find and replace and search using regex with look ahead and look behind, e.g. (?<=a)d(?=a) to find the character d surrounded by as.
  4. Change parts of the string which contain the match, in this example remove some of the ds or change the surrounding such that it is not matched any more.

Expected behavior:

During editing, the matches should update automatically and correctly.

Actual behavior:

During editing, the matches do not update correctly. Here is an example:

example.mov

Reproduces how often:

Always, but with different behaviour.

Versions

macOS Catalina 10.15.7

Atom : 1.55.0
Electron: 6.1.12
Chrome : 76.0.3809.146
Node : 12.4.0

apm 2.5.2
npm 6.14.8
node 12.4.0 x64
atom 1.55.0
python 3.8.6
git 2.24.3

Additional Information

Even, if one clicks search again, it does not update correctly. But if one changes the search term, e.g. remove the last ) and add it back, then it finds the occurrences correctly again.

@strixy
Copy link

strixy commented Dec 20, 2021

I am experiencing this issue with v 1.58 on Linux.
Find is index: \N
Replace is index: n
language used is JS
It's weird. It finds what I expect it to find, but makes no changes. Weirder still, hitting undo will walk back through the items it should have changed, but didn't change, showing no change was undone.

@Audiofrank
Copy link

I am experiencing this issue with v 1.58.0 x64 on Linux (Ubuntu), in safe mode too.
Find is: \b(\.)\b
Replace is: empty field
Language is a text-File (.a51), Assembler-File with Tabs and comments after ;
First it finds all "." correctly, but after editing, for example, by adding the same letter in an empty line lets say 10 times, the search result changes.
Some of the former results are gone or changing while adding more letters.
Deleting the added letters by the backspace-key completely, so I have the state where I started from, shows a different Find-result. I can only get the correct search result again by switching the RegExp-Button off and on or by changing the text in the Find-field in that way deleting something and fill it in again.

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

No branches or pull requests

3 participants