|
From: SourceForge.net <no...@so...> - 2012-07-14 06:48:50
|
Patches item #3543916, was opened at 2012-07-13 23:48 Message generated for change (Tracker Item Submitted) made by swetha1910 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300588&aid=3543916&group_id=588 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: texteditor Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Swetha (swetha1910) Assigned to: Nobody/Anonymous (nobody) Summary: Fixed Issue replacing start of line match with empty string Initial Comment: Problem: With regular expressions enabled, and if the search pattern having '^' then the 'replace all' option performs repeated replacing for every character in the line and not 'start of the line' matches. Details: Example I: Input: Twinkle Twinkle Little Star How I wonder what you are Search for: ^. meaning I want a search for the first character of every line Replace with: replace every matched character with nothing (literally deleting the first character from every line) Expected Output when I click REPLACE ALL: winkle Twinkle ittle Star ow I wonder what you re What actually happens here is that the buffer is emptied because every character is replaced with an empty string. Output when I click REPLACE: winkle Twinkle Little Star How I wonder what you are Output when I click REPLACE AND FIND: winkle Twinkle Little Star How I wonder what you are NOTE: In the last case, the find function will now match 'w' in the second line input text. Example II: Input: Twinkle Twinkle Little Star How I wonder what you are Search for: ^. meaning I want a search for the first character of every line Replace with: p replace every matched character with the letter 'p' Expected Output when I click REPLACE ALL: pwinkle Twinkle pittle Star pow I wonder what you pre Output when I click REPLACE: pwinkle Twinkle Little Star How I wonder what you are Output when I click REPLACE AND FIND: pinkle Twinkle Little Star How I wonder what you are NOTE: In the last case, the find function will now match 'L' in the input text because in regular expressions '^' symbol should check only for the beginning of the line. But the result in the current version empties the buffer whenever replace all is given for Example 1 which is wrong. It violates the meaning of the regular expression '^' itself. Example III: Input text: AABBBA Search: ^A Expected Output: ABBBA But Actual Result of the current version: BBBA How the bug was fixed: 1. Check if the regex option is selected 2. If yes, then check if the search pattern has '^' 3. If yes, then set the offset value accordingly. Patch Details: Version of jEdit : 4.5.2 Platform: Windows Edited file: SearchAndReplace.java Package: org/gjt/sp/jedit/Search ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300588&aid=3543916&group_id=588 |