#459 Extended mode replace and regex \n

Next_release
closed
Don HO
None
9
2013-04-01
2013-03-04
No

This patch fixes the regex search for \n, and the extended mode replace not being "extended".
Patch applied as normal with patch.exe -p 1 -i <filename>

See https://sourceforge.net/p/notepad-plus/discussion/331753/thread/1a508772/?limit=25#e259

Patch applied on revision 1028.

1 Attachments

Discussion

  • Don HO

    Don HO - 2013-03-06

    Hi Dave,

    Thank you for the patch!

    However, the extended mode hasn't been fixed by the "0001-Fix-replace-extended-mode.patch".
    As I said, "Replacing '\n' in extended mode" not working is due to the following condition is not satisfied:

    if (nextFind.cpMin == currentSelection.cpMin && nextFind.cpMax == currentSelection.cpMax)

    therefor your added lines in the block of above condition will never be executed:

    if (replaceOptions._searchType == FindExtended)
    {
    Searching::convertExtendedToString(pTextReplace, pTextReplace, stringSizeReplace);
    }

    OTOH, the second patch "0002-Fix-regex-search-for-n.patch" fixes the "Replacing '\n' in regex mode" bug.
    Quick test to replace \ replaceAll on '\r\n', '\r' and '\n', it works like a charm.

    Regarding the condition which keeps from extended mode repalcing working, may we do somethings to make extended mode enters into block?

    Don

     
    Last edit: Don HO 2013-03-06
  • Don HO

    Don HO - 2013-03-06

    Dave,

    Just tried your binary http://www.brotherstone.co.uk/npp/npp63r1.7z
    It works in both extended and regex mode.

    I'm quite confused - could you attach your FindReplaceDlg.cpp please?

    Don

     
    Last edit: Don HO 2013-03-06
  • Don HO

    Don HO - 2013-03-06

    Dave,

    I'm sorry, I must be drunk (2 glasses of wine may be over the Ballmer Peak :) ). It all works now.

    I just committed in the SVN (rev.1029).

    Thank you for the patch.

    Don

     
    Last edit: Don HO 2013-03-06
  • Don HO

    Don HO - 2013-03-06
    • status: open --> accepted
    • priority: 5 --> 9
     
  • Don HO

    Don HO - 2013-04-01
    • status: accepted --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks