atom / find-and-replace

Find and replace in a single buffer and in the project
MIT License
242 stars 197 forks source link

Uncaught Error: unknown property name after \P or \p #1062

Open ghost opened 5 years ago

ghost commented 5 years ago

Edit by @rsese to add more detailed repro steps from https://github.com/atom/find-and-replace/issues/1062#issuecomment-450413011

a. mkdir test; touch ./test/test_error.txt b. atom ./test --safe c. Project Find: Show d. Enable regex search d. Run this search: ^(?=.\projects_users\b)(?=.\bactive\b).*$ d. Click on test_error.txt in tree view e. Type in the file

Expect no errors, actual is you see the Uncaught Error: unknown property name after \P or \p error on each keypress, see stack below.

Reproduced on macOS 10.12.6 with Atom 1.33.1.


@elalgarro commented on Dec 20, 2018, 9:28 PM UTC:

[Enter steps to reproduce:]

  1. global regex search ^(?=._\projectsusers\b)(?=.\bactive\b).*$
  2. highlighted 'active'
  3. started typing, this error occured

Atom: 1.33.1 x64 Electron: 2.0.16 OS: Mac OS X 10.12.6 Thrown From: Atom Core

Stack Trace

Uncaught Error: unknown property name after \P or \p

At /Users/username/Desktop/Atom.app/Contents/Resources/app.asar/node_modules/superstring/index.js:252

Error: unknown property name after \P or \p
    at TextBuffer.findAllInRangeSync (/app.asar/node_modules/superstring/index.js:252:44)
    at TextBuffer.findAllInRangeSync (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:494788)
    at TextBuffer.scanInRange (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:493713)
    at TextBuffer.scan (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:493476)
    at TextEditor.scan (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:40885)
    at ResultsModel.onContentsModified (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:792910)
    at e.onDidStopChanging (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:787435)
    at Function.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1190759)
    at Emitter.emit (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1192200)
    at TextBuffer.emitDidStopChangingEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:504581)
    at later (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:14:98353)

Commands

     -1:00.9.0 project-find:show (div.tool-panel.tree-view)
  2x -1:00.2.0 core:paste (input.hidden-input)
     -0:58.1.0 core:undo (input.hidden-input)
     -0:52.6.0 core:backspace (input.hidden-input)
  3x -0:51.1.0 core:undo (input.hidden-input)
     -0:40.5.0 core:paste (input.hidden-input)
     -0:40 core:confirm (input.hidden-input)
     -0:10.4.0 core:backspace (input.hidden-input)

Non-Core Packages

atom-erb 0.2.0 
autoclose-html 0.23.0 
language-vue 0.23.1 

This issue was moved by rsese from atom/atom#18609.

ghost commented 5 years ago

@elalgarro commented on Dec 20, 2018, 9:33 PM UTC:

upon closer inspection i had a typo in my regex search that is causing the error i think ^(?=._\projectsusers\b)(?=.\bactive\b).*$

note the missing \b before projects_users

rsese commented 5 years ago

Thanks for the report! Can you confirm if the error is reproducible in safe mode (atom --safe)? Also, does it matter what project you're working on or can you reproduce with a project with no files and you're working on a new empty file?

elalgarro commented 5 years ago

yes to both,

  1. Safe Mode a. loaded project from console atom project_path --safe b. global regex searched ^(?=.\projects_users\b)(?=.\bactive\b).*$ c. clicked on file, started typing. d. atom bug appears on key press Uncaught Error: unknown property name after \P or \p

  2. New Project a. touch ~/Desktop/test_error/test_error.txt b.atom ~/Desktop/test_error/ --safe c. shift+cmd+f ^(?=.\projects_users\b)(?=.\bactive\b).*$ d. click on test_error.txt in file browser e. on keypress in file Uncaught Error: unknown property name after \P or \p

rsese commented 5 years ago

Thanks @elalgarro :+1: I can reproduce on macOS 10.12.6 with 1.33.1, went ahead and updated the issue body.