Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/editors/fxite/files/patch-src_help.cpp
16461 views
1
--- src/help.cpp.orig 2013-10-03 09:22:51 UTC
2
+++ src/help.cpp
3
@@ -36,7 +36,13 @@
4
#define sendString(iMessage, wParam, lParam) sendMessage(iMessage, wParam, reinterpret_cast<long>(lParam))
5
6
7
+#ifdef FOX_1_7_50_OR_NEWER
8
+# define RxFind(rx,subj,start,beg,end,npar) (rx.search(subj,strlen(subj),start,strlen(subj),FXRex::Normal,beg,end,npar)>=0)
9
+#else
10
+# define RxFind(rx,subj,start,beg,end,npar) (rx.match(subj,beg,end,REX_FORWARD,npar,start))
11
+#endif
12
13
+
14
enum {
15
SCHLP_FIXED,
16
SCHLP_ITALIC,
17
@@ -224,7 +230,7 @@ void SciHelp::replace(const char*oldstr, const char*ne
18
FXRex generic_rx(oldstr, REX_NORMAL|REX_NEWLINE);
19
content=(const char*)(sendMessage(SCI_GETCHARACTERPOINTER,0,0));
20
FXint n=strlen(newstr);
21
- while (generic_rx.match(content,beg,end,REX_FORWARD,1)) {
22
+ while (RxFind(generic_rx,content,0,beg,end,1)) {
23
sendMessage(SCI_SETTARGETSTART,beg[0],0);
24
sendMessage(SCI_SETTARGETEND,end[0],0);
25
sendString(SCI_REPLACETARGET,n,newstr);
26
@@ -261,7 +267,7 @@ void SciHelp::parse(const char*txt, unsigned int size)
27
for (FXint i=SCHLP_FIRST; i<SCHLP_LAST; i++) {
28
content=(const char*)(sendMessage(SCI_GETCHARACTERPOINTER,0,0));
29
FXRex rx(phrases[i], REX_CAPTURE|REX_NEWLINE);
30
- while (rx.match(content,beg,end,REX_FORWARD,2)) {
31
+ while (RxFind(rx,content,0,beg,end,2)) {
32
sendMessage(SCI_SETTARGETSTART,beg[0],0);
33
sendMessage(SCI_SETTARGETEND,end[0],0);
34
char*tmp=my_strndup(content+beg[1], end[1]-beg[1]);
35
@@ -289,10 +295,10 @@ void SciHelp::parse(const char*txt, unsigned int size)
36
}
37
38
// Make the editor's name stand out a little...
39
- FXRex appname_rx("\\<"APP_NAME"\\>", REX_NORMAL|REX_NEWLINE);
40
+ FXRex appname_rx("\\<" APP_NAME "\\>", REX_NORMAL|REX_NEWLINE);
41
content=(const char*)(sendMessage(SCI_GETCHARACTERPOINTER,0,0));
42
FXint p=0;
43
- while (appname_rx.match(content,beg,end,REX_FORWARD,1, p)) {
44
+ while (RxFind(appname_rx,content,p,beg,end,1)) {
45
sendMessage(SCI_STARTSTYLING,beg[0],0xff);
46
sendMessage(SCI_SETSTYLING,(end[0]-beg[0]),SCHLP_LOGO);
47
p=end[0];
48
49