Comments (11)
Could you please provide some more explanations. What is the expected outcome and what is the actual?
Also, what is the change you are suggesting?
from synedit.
Current situation, when roNotEmpty is included in default and you have no possibility to remove it leads to "wrong regular expression" message when you try to search for ^ or $ only. It disallows you insert content of the replace expression on any lines start or end.
Try my example with current Synedit version, remove roNotEmpty option (it's on 3 places in SynEditRegExpSearch.pas unit) and try it again. You will see the difference.
The change I suggest is remove roNotEmpty option, cause it's automatically added to any options you use.
from synedit.
I see...
cause it's automatically added to any options you use.
How do you conclude that?
from synedit.
constructor TSynEditRegexSearch.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
fOptions := [roNotEmpty];
end;
...
procedure TSynEditRegexSearch.SetOptions(const Value: TSynSearchOptions);
begin
if ssoMatchCase in Value then
fOptions := [roNotEmpty]
else
fOptions := [roNotEmpty, roIgnoreCase];
RegEx := TRegEx.Create(fPattern, fOptions);
RegEx.SetAdditionalPCREOptions(PCRE_UCP);
end;
from synedit.
Just to make sure. Are you suggesting that we remove reNotEmpty from the constructor only and keeping it in SetOptions?
from synedit.
No, I mean remove it from constructor and set options. It has no influence of search.
Az alternative you can make it optional, but it means add property
from synedit.
But if I remove it from SetOptions it will never be set and empty matches could always happen.
from synedit.
This is what I wrote as alternative solution - make it optional (add property) in RegExp Synedit engine
Empty expression were there in the past before Delphi reg exp engine in Synedit.
from synedit.
Empty expression were there in the past before Delphi reg exp engine in Synedit
I could not find such an option in https://github.com/SynEdit/SynEdit/.
from synedit.
I committed anyway since your use case is common.
We should rethink how to expose roNotEmpty and other PCRE options to TSynEditRegexSearch.
from synedit.
Yes, in old implementation was no such options, but behavior was as I described
from synedit.
Related Issues (20)
- Assert parameter code removed in release cause Font not found error
- Change in shortcut CTRL + Backspace from previous version HOT 1
- Font for line numbers when printing.
- TSynBaseCompletionProposalForm styling. HOT 6
- Porting to Lazarus (by myself, with your help sometimes) HOT 2
- Exception when printing HOT 7
- SynHighlighterJSON fails on Number value=0
- 11.2 breaks SynEdit HOT 1
- SynEdit install error on Delphi 11.2 HOT 1
- TSynExporterHTML HOT 1
- Printing as graphics HOT 1
- 64bit - Component TSynCompletionProposal Crash (D 11.2) HOT 2
- Lines.Add / Lines.Insert do not respect CRLF in a string HOT 6
- New spell checking component
- value of the SYNS_FriendlyAttrKey constant HOT 4
- TSynCssSyn endless loop
- Text copied from webpages into SynEdit is not handled correctly HOT 1
- TSynedit.SetOptions() group UNDO HOT 1
- eoTrimtrailingSpaces vs Read only HOT 1
- Cannot install the SynEdit through Getit because of compile error caused by ANSI encoded source files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from synedit.