TempleOSCDV4.08.ISO
This commit is contained in:
1 parent
b632ab9a4f
commit
2d56cda5f3
258 files changed
+6973
-5476
No files matched your search
+18
-18
@@ -29,7 +29,7 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
|
||||
if (sc>=0 && sc&SCF_CTRL) {
|
||||
while (doc_ce->last!=doc && (doc_ce->last->y==y ||
|
||||
doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP)))
|
||||
doc_ce=doc_ce->last; //TODO: select? recurse?
|
||||
doc_ce=doc_ce->last; //TODO: sel? recurse?
|
||||
cc=doc_ce->min_col;
|
||||
} else {
|
||||
if (cc>doc_ce->min_col) {
|
||||
@@ -51,7 +51,7 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
|
||||
cc=doc_ce->min_col;
|
||||
}
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
} else {
|
||||
cc=doc_ce->min_col;
|
||||
while (doc_ce->last!=doc &&
|
||||
@@ -60,7 +60,7 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
|
||||
doc_ce->last->de_flags&(DOCEF_SKIP|DOCEF_FILTER_SKIP))) {
|
||||
doc_ce=doc_ce->last;
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
}
|
||||
if (doc_ce->last!=doc) {
|
||||
doc_ce=doc_ce->last;
|
||||
@@ -78,7 +78,7 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
|
||||
} else
|
||||
cc=doc_ce->max_col;
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,7 @@ public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64)
|
||||
old_de_flags=doc_ce->de_flags;
|
||||
old_color=doc_ce->type;
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
if (IsEditableText(doc_ce) && cc<doc_ce->max_col) {
|
||||
dst=doc_ce->tag+cc;
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
|
||||
@@ -141,17 +141,17 @@ public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64)
|
||||
} else {
|
||||
if (doc_ce!=doc) {
|
||||
if (cc<=doc_ce->min_col && sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
doc_ce=doc_ce->next;
|
||||
while (doc_ce!=doc && doc_ce->de_flags&(DOCEF_SKIP|DOCEF_FILTER_SKIP)) {
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
doc_ce=doc_ce->next;
|
||||
}
|
||||
cc=doc_ce->min_col;
|
||||
if (doc_ce->type_u8==DOCT_SOFT_NEW_LINE) {
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
doc_ce=doc_ce->next;
|
||||
cc=doc_ce->min_col;
|
||||
}
|
||||
@@ -198,7 +198,7 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
|
||||
} else if (doc_ce->last!=doc)
|
||||
doc_ce=doc_ce->last;
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
doc->cur_entry=doc_ce;
|
||||
DocFormBwd(doc);
|
||||
doc_ce=doc->cur_entry;
|
||||
@@ -206,14 +206,14 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
|
||||
doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) {
|
||||
doc_ce=doc_ce->last;
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
}
|
||||
y=doc_ce->y;
|
||||
doc->y=y;
|
||||
while (doc_ce!=doc && (doc_ce->y>=y && doc_ce->x>=x ||
|
||||
doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) {
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
doc_ce=doc_ce->last;
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
|
||||
else {
|
||||
if (!IsEditableText(doc_ce)) {
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
} else {
|
||||
if (doc_ce->next->x==x) {
|
||||
doc_ce=doc_ce->next;
|
||||
@@ -259,9 +259,9 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
|
||||
*dst=0;
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ne->type=doc_ce->type | DOCET_SELECTED;
|
||||
doc_ne->type=doc_ce->type | DOCET_SEL;
|
||||
else
|
||||
doc_ne->type=doc_ce->type & ~DOCET_SELECTED;
|
||||
doc_ne->type=doc_ce->type & ~DOCET_SEL;
|
||||
}
|
||||
doc_ne->x=doc_ce->x+doc->cur_col;
|
||||
doc_ce->max_col=doc->cur_col;
|
||||
@@ -305,9 +305,9 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
||||
*dst=0;
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ne->type=doc_ce->type | DOCET_SELECTED;
|
||||
doc_ne->type=doc_ce->type | DOCET_SEL;
|
||||
else
|
||||
doc_ne->type=doc_ce->type & ~DOCET_SELECTED;
|
||||
doc_ne->type=doc_ce->type & ~DOCET_SEL;
|
||||
}
|
||||
doc_ne->x=doc_ce->x+doc->cur_col;
|
||||
doc_ce->max_col=doc->cur_col;
|
||||
@@ -345,7 +345,7 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
||||
doc_ce2->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP) ||
|
||||
doc_ce2->x==x && !doc_ce2->max_col &&
|
||||
Bt(doldoc.type_flags_nontag_invisible,doc_ce2->type_u8)) && sc>=0)
|
||||
BEqu(&doc_ce2->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
BEqu(&doc_ce2->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
if (doc_ce2==doc_ce) break;
|
||||
doc_ce2=doc_ce2->next;
|
||||
}
|
||||
@@ -377,7 +377,7 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
||||
if (!(doc->flags & DOCF_FORM))
|
||||
while (doc_ce!=doc && doc_ce!=doc->cur_entry) {
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
doc_ce=doc_ce->next;
|
||||
}
|
||||
doc->x=doc->cur_entry->x+doc->cur_col;
|
||||
|
||||
@@ -8,15 +8,15 @@ public U0 ClipboardDel()
|
||||
}
|
||||
|
||||
public U0 EdCopyToClipboard(CDoc *doc)
|
||||
{//Copy $LK,"DOCET_SELECTED",A="MN:DOCET_SELECTED"$ flagged entries to clipboard.
|
||||
{//Copy $LK,"DOCET_SEL",A="MN:DOCET_SEL"$ flagged entries to clipboard.
|
||||
CDoc *doc2=sys_clipboard_doc;
|
||||
Bool unlock_doc=DocLock(doc),
|
||||
unlock_doc2=DocLock(doc2);
|
||||
CDocEntry *doc_e=doc->root.next,*doc_ne;
|
||||
ClipboardDel;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type & DOCET_SELECTED) {
|
||||
doc_e->type&=~DOCET_SELECTED;
|
||||
if (doc_e->type & DOCET_SEL) {
|
||||
doc_e->type&=~DOCET_SEL;
|
||||
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
|
||||
doc_ne=DocEntryCopy(doc2,doc_e);
|
||||
QueIns(doc_ne,doc2->root.last);
|
||||
@@ -31,7 +31,7 @@ public U0 EdCopyToClipboard(CDoc *doc)
|
||||
}
|
||||
|
||||
public U0 EdCutToClipboard(CDoc *doc)
|
||||
{//Remove selected entries and place on clipboard.
|
||||
{//Remove sel entries and place on clipboard.
|
||||
CDoc *doc2=sys_clipboard_doc;
|
||||
Bool unlock_doc=DocLock(doc),
|
||||
unlock_doc2=DocLock(doc2);
|
||||
@@ -39,8 +39,8 @@ public U0 EdCutToClipboard(CDoc *doc)
|
||||
ClipboardDel;
|
||||
while (doc_e!=doc) {
|
||||
doc_e1=doc_e->next;
|
||||
if (doc_e->type & DOCET_SELECTED) {
|
||||
doc_e->type&=~DOCET_SELECTED;
|
||||
if (doc_e->type & DOCET_SEL) {
|
||||
doc_e->type&=~DOCET_SEL;
|
||||
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
|
||||
doc_ne=DocEntryCopy(doc2,doc_e);
|
||||
QueIns(doc_ne,doc2->root.last);
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
#help_index "DolDoc/Misc"
|
||||
|
||||
U0 EdReplaceTroubleOne(CDoc *doc,U8 *st_original,U8 *st_safe,I64 num,
|
||||
Bool to_safe,Bool select)
|
||||
Bool to_safe,Bool sel)
|
||||
{
|
||||
U8 buf[STR_LEN];
|
||||
StrPrint(buf,st_safe,num);
|
||||
if (to_safe)
|
||||
EdReplace(doc,st_original,buf,select);
|
||||
EdReplace(doc,st_original,buf,sel);
|
||||
else
|
||||
EdReplace(doc,buf,st_original,select);
|
||||
EdReplace(doc,buf,st_original,sel);
|
||||
}
|
||||
|
||||
U0 EdReplaceTroubleAll(CDoc *doc,Bool to_safe,Bool select)
|
||||
U0 EdReplaceTroubleAll(CDoc *doc,Bool to_safe,Bool sel)
|
||||
{
|
||||
I64 i=0;
|
||||
EdReplaceTroubleOne(doc,"#assert" ,"//<@%d@>" ,i++,to_safe,select);
|
||||
EdReplaceTroubleOne(doc,"#define" ,"//<@%d@>" ,i++,to_safe,select);
|
||||
EdReplaceTroubleOne(doc,"#include","//<@%d@>" ,i++,to_safe,select);
|
||||
EdReplaceTroubleOne(doc,"#assert" ,"//<@%d@>" ,i++,to_safe,sel);
|
||||
EdReplaceTroubleOne(doc,"#define" ,"//<@%d@>" ,i++,to_safe,sel);
|
||||
EdReplaceTroubleOne(doc,"#include","//<@%d@>" ,i++,to_safe,sel);
|
||||
//#if will match #if,#ifdef,#ifndef,#ifaot and #ifjit
|
||||
EdReplaceTroubleOne(doc,"#if" ,"//<@%d@>" ,i++,to_safe,select);
|
||||
EdReplaceTroubleOne(doc,"#endif" ,"//<@%d@>" ,i++,to_safe,select);
|
||||
EdReplaceTroubleOne(doc,"#if" ,"//<@%d@>" ,i++,to_safe,sel);
|
||||
EdReplaceTroubleOne(doc,"#endif" ,"//<@%d@>" ,i++,to_safe,sel);
|
||||
//Convert #exe to union because we want that indent pattern.
|
||||
EdReplaceTroubleOne(doc,"#exe" ,"union @%d@",i++,to_safe,select);
|
||||
EdReplaceTroubleOne(doc,"'{'" ,"'<@%d@>'" ,i++,to_safe,select);
|
||||
EdReplaceTroubleOne(doc,"'}'" ,"'<@%d@>'" ,i++,to_safe,select);
|
||||
EdReplaceTroubleOne(doc,"#exe" ,"union @%d@",i++,to_safe,sel);
|
||||
EdReplaceTroubleOne(doc,"'{'" ,"'<@%d@>'" ,i++,to_safe,sel);
|
||||
EdReplaceTroubleOne(doc,"'}'" ,"'<@%d@>'" ,i++,to_safe,sel);
|
||||
}
|
||||
|
||||
#define C_INDENT_SPACES 2
|
||||
@@ -76,7 +76,7 @@ I64 EdRILex(CRILex *rx)
|
||||
!rx->exp_depth || i==KW_ELSE || i==KW_CATCH || i==KW_DO)
|
||||
rx->is_not_cont=TRUE;
|
||||
if (rx->was_new_line && (rx->cc1->token!=':' || i==KW_CASE ||
|
||||
i==KW_DFT || i==KW_SUB_SWITCH_START || i==KW_SUB_SWITCH_END)) {
|
||||
i==KW_DFT || i==KW_START || i==KW_END)) {
|
||||
tempf=rx->cc2->lex_include_stk;
|
||||
while (tempf->next)
|
||||
tempf=tempf->next;
|
||||
@@ -189,13 +189,13 @@ U0 EdRIStmt(CRILex *rx,Bool indent)
|
||||
i=0;
|
||||
while (rx->cc1->token && rx->cc1->token!='}') {
|
||||
switch (PrsKeyWord(rx->cc1)) {
|
||||
case KW_SUB_SWITCH_START:
|
||||
case KW_START:
|
||||
rx->depth+=i; i=0;
|
||||
while (EdRILex(rx) && rx->cc1->token!=':');
|
||||
EdRILex(rx);
|
||||
i++;
|
||||
break;
|
||||
case KW_SUB_SWITCH_END:
|
||||
case KW_END:
|
||||
rx->depth+=i; i=0;
|
||||
if (--rx->depth<0) rx->depth=0;
|
||||
while (EdRILex(rx) && rx->cc1->token!=':');
|
||||
@@ -336,7 +336,7 @@ I64 EdRAGetU8(CDoc *doc)
|
||||
{
|
||||
I64 res=-1;
|
||||
while (doc->cur_entry!=doc &&
|
||||
doc->cur_entry->type&DOCET_SELECTED && res<0) {
|
||||
doc->cur_entry->type&DOCET_SEL && res<0) {
|
||||
res=EdCurU8(doc);
|
||||
EdCursorRight(doc);
|
||||
}
|
||||
@@ -393,7 +393,7 @@ U0 EdRenumAsm(CDoc *doc)
|
||||
buf2[sizeof(CEdFindText.find_text)];
|
||||
|
||||
QueInit(&root);
|
||||
EdSelectFun(doc,TRUE);
|
||||
EdSelFun(doc,TRUE);
|
||||
EdRACollect(doc,&root);
|
||||
|
||||
tempr=root.next;
|
||||
@@ -412,7 +412,7 @@ U0 EdRenumAsm(CDoc *doc)
|
||||
EdReplace(doc,buf,buf2,TRUE,TRUE,TRUE);
|
||||
num-=ASM_RENUM_SPACING;
|
||||
}
|
||||
EdSelectAll(doc,FALSE);
|
||||
EdSelAll(doc,FALSE);
|
||||
DocRecalc(doc);
|
||||
DocCenter(doc);
|
||||
if (unlock)
|
||||
@@ -479,9 +479,10 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z);
|
||||
Free(st);
|
||||
if (FileFind(prj_file))
|
||||
st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",TRUE);",prj_file);
|
||||
st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",CCF_JUST_LOAD);",prj_file);
|
||||
else
|
||||
st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",TRUE);",doc->filename.name);
|
||||
st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",CCF_JUST_LOAD);",
|
||||
doc->filename.name);
|
||||
tempc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
Free(st);
|
||||
if (JobResScan(tempc,&r) && r)
|
||||
|
||||
+19
-19
@@ -106,8 +106,8 @@ public U0 EdFindNext(CDoc *doc)
|
||||
if (doc_e!=doc) {
|
||||
if (doc_e->de_flags&DOCEF_TAG && doc_e->tag &&
|
||||
!(doc_e->de_flags&(DOCEG_DONT_EDIT|DOCEF_FILTER_SKIP))) {
|
||||
if (doc_e->type & DOCET_SELECTED ||
|
||||
!doc->find_replace->scan_selected_text) {
|
||||
if (doc_e->type & DOCET_SEL ||
|
||||
!doc->find_replace->scan_sel_text) {
|
||||
if (doc->find_replace->scan_fwd) {
|
||||
if (doc_e==doc_ce) {
|
||||
ptr=doc_ce->tag+doc->cur_col+1;
|
||||
@@ -167,12 +167,12 @@ fn_skip:
|
||||
DocUnlock(doc);
|
||||
}
|
||||
|
||||
public U0 EdSelectAll(CDoc *doc,Bool select)
|
||||
{//Set state of $LK,"DOCET_SELECTED",A="MN:DOCET_SELECTED"$ on all entries.
|
||||
public U0 EdSelAll(CDoc *doc,Bool sel)
|
||||
{//Set state of $LK,"DOCET_SEL",A="MN:DOCET_SEL"$ on all entries.
|
||||
Bool unlock=DocLock(doc);
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
BEqu(&doc_e->type,DOCEt_SELECTED,select);
|
||||
BEqu(&doc_e->type,DOCEt_SEL,sel);
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
if (unlock)
|
||||
@@ -319,13 +319,13 @@ public Bool EdGoToFun(CDoc *doc,Bool fwd,Bool abort_on_dbl_colon)
|
||||
return res;
|
||||
}
|
||||
|
||||
public U0 EdSelectFun(CDoc *doc,Bool abort_on_dbl_colon=FALSE)
|
||||
{//Set $LK,"DOCET_SELECTED",A="MN:DOCET_SELECTED"$ on all entries in cur fun.
|
||||
public U0 EdSelFun(CDoc *doc,Bool abort_on_dbl_colon=FALSE)
|
||||
{//Set $LK,"DOCET_SEL",A="MN:DOCET_SEL"$ on all entries in cur fun.
|
||||
Bool unlock=DocLock(doc);
|
||||
U8 *ptr;
|
||||
I64 ch,levels=0,colons=0;
|
||||
CDocEntry *doc_e;
|
||||
EdSelectAll(doc,FALSE);
|
||||
EdSelAll(doc,FALSE);
|
||||
EdGoToFun(doc,FALSE,abort_on_dbl_colon);
|
||||
if (EdCurU8(doc)=='{')
|
||||
levels--;
|
||||
@@ -336,7 +336,7 @@ public U0 EdSelectFun(CDoc *doc,Bool abort_on_dbl_colon=FALSE)
|
||||
}
|
||||
doc_e=doc->cur_entry;
|
||||
while (doc_e!=doc) {
|
||||
doc_e->type|=DOCET_SELECTED;
|
||||
doc_e->type|=DOCET_SEL;
|
||||
if (doc_e->de_flags&DOCEF_TAG && doc_e->tag) {
|
||||
ptr=doc_e->tag;
|
||||
if (doc_e==doc->cur_entry)
|
||||
@@ -406,10 +406,10 @@ I64 EdFindReplace(CDoc *doc)
|
||||
if (doc_ce->de_flags&DOCEF_TAG && doc_ce->tag &&
|
||||
!(doc_ce->de_flags&DOCEF_FILTER_SKIP) &&
|
||||
StrFind(doc->find_replace->find_text,doc_ce->tag,sf_flags)) {
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
doc_ce->type|=DOCET_SEL;
|
||||
res++;
|
||||
} else
|
||||
doc_ce->type&=~DOCET_SELECTED;
|
||||
doc_ce->type&=~DOCET_SEL;
|
||||
doc_ce=doc_ce->next;
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ I64 EdFindReplace(CDoc *doc)
|
||||
|
||||
doc_e=doc_ce;
|
||||
while (doc_e!=doc && doc_e->y>doc_ce->y-i) {
|
||||
if (doc_e->type&DOCET_SELECTED) {
|
||||
if (doc_e->type&DOCET_SEL) {
|
||||
found=TRUE;
|
||||
break;
|
||||
} else
|
||||
@@ -430,7 +430,7 @@ I64 EdFindReplace(CDoc *doc)
|
||||
if (!found) {
|
||||
doc_e=doc_ce;
|
||||
while (doc_e!=doc && doc_e->y<doc_ce->y+i) {
|
||||
if (doc_e->type&DOCET_SELECTED) {
|
||||
if (doc_e->type&DOCET_SEL) {
|
||||
found=TRUE;
|
||||
break;
|
||||
} else
|
||||
@@ -444,12 +444,12 @@ I64 EdFindReplace(CDoc *doc)
|
||||
|
||||
doc_ce=doc_ce->next;
|
||||
}
|
||||
EdSelectAll(doc,FALSE);
|
||||
EdSelAll(doc,FALSE);
|
||||
goto fr_unlock_done;
|
||||
}
|
||||
|
||||
if (doc->find_replace->local_var)
|
||||
EdSelectFun(doc);
|
||||
EdSelFun(doc);
|
||||
|
||||
if (!doc->find_replace->replace && !doc->find_replace->local_var) {
|
||||
EdFindNext(doc);
|
||||
@@ -473,8 +473,8 @@ I64 EdFindReplace(CDoc *doc)
|
||||
}
|
||||
if (doc_e->type_u8==DOCT_TEXT &&
|
||||
!(doc_e->de_flags&(DOCEG_DONT_EDIT|DOCEF_FILTER_SKIP)) &&
|
||||
(doc_e->type & DOCET_SELECTED ||
|
||||
!doc->find_replace->scan_selected_text&&
|
||||
(doc_e->type & DOCET_SEL ||
|
||||
!doc->find_replace->scan_sel_text&&
|
||||
!doc->find_replace->local_var)) {
|
||||
src=doc_e->tag;
|
||||
while (src) {
|
||||
@@ -541,7 +541,7 @@ fr_unlock_done:
|
||||
}
|
||||
|
||||
public I64 EdReplace(CDoc *doc,U8 *find,U8 *replace,
|
||||
Bool selected=TRUE,Bool match_case=TRUE,Bool whole_labels=FALSE)
|
||||
Bool sel=TRUE,Bool match_case=TRUE,Bool whole_labels=FALSE)
|
||||
{//Find & replace using editor's cmd.
|
||||
CEdFindText old_find_replace;
|
||||
Bool unlock;
|
||||
@@ -557,7 +557,7 @@ Bool selected=TRUE,Bool match_case=TRUE,Bool whole_labels=FALSE)
|
||||
if (i<sizeof(CEdFindText.replace_text)) {
|
||||
MemCpy(doc->find_replace->replace_text,replace,i+1);
|
||||
doc->find_replace->replace=TRUE;
|
||||
doc->find_replace->scan_selected_text=selected;
|
||||
doc->find_replace->scan_sel_text=sel;
|
||||
doc->find_replace->match_case=match_case;
|
||||
doc->find_replace->whole_labels=whole_labels;
|
||||
doc->find_replace->pmt=FALSE;
|
||||
|
||||
@@ -24,8 +24,8 @@ public I64 PopUpColorLighting(U8 *header=NULL)
|
||||
CDoc *doc=DocNew;
|
||||
if (header)
|
||||
DocPrint(doc,"%s",header);
|
||||
DocPrint(doc,"\nSingle-Sided means both sides same color."
|
||||
"\nDouble-Sided means back side darker."
|
||||
DocPrint(doc,"\nSingle-Sided means front and back different."
|
||||
"\nDouble-Sided means front and back same."
|
||||
"\n"
|
||||
"\nHalf-Range means 0 to [0,7]"
|
||||
"\n [8,15]-8 to [8,15]"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#help_index "DolDoc/Misc"
|
||||
|
||||
U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _temp_u32_attr)
|
||||
{//Be aware of $LK,"::/Demo/ToHtmlToTXTExample/ToHtml.CPP"$.
|
||||
{//Be aware of $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.CPP"$.
|
||||
U32 *res=MAlloc((len+1)*sizeof(U32)),*dst=res;
|
||||
U8 *ptr;
|
||||
CDocSettings *s=&doc_e->settings;
|
||||
|
||||
@@ -10,7 +10,7 @@ I64 PrsDocFlagSingle(CCmpCtrl *cc,I64 *_de_flags,U32 *_type,Bool turn_on)
|
||||
if (res<64) {
|
||||
BEqu(_de_flags,res,turn_on);
|
||||
switch (res) {
|
||||
case DOCEf_SELECTED:
|
||||
case DOCEf_SEL:
|
||||
case DOCEf_UNDERLINE:
|
||||
case DOCEf_INVERT:
|
||||
case DOCEf_BLINK:
|
||||
@@ -56,7 +56,7 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
|
||||
f1=doldoc.dft_de_flags[doc_e->type_u8];
|
||||
t1=doc_e->type_u8|doldoc.dft_type_flags[doc_e->type_u8];
|
||||
|
||||
de_flags=doc_e->de_flags&~(DOCG_BL_IV_UL|DOCEF_SELECTED|
|
||||
de_flags=doc_e->de_flags&~(DOCG_BL_IV_UL|DOCEF_SEL|
|
||||
DOCEF_HIGHLIGHT|DOCEF_WORD_WRAP|DOCEF_SKIP|DOCEF_FILTER_SKIP);
|
||||
for (i=0;i<DOCEf_NUM_FLAGS;i++)
|
||||
if (Bt(&f1,i)!=Bt(&de_flags,i)) {
|
||||
@@ -70,7 +70,7 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
|
||||
Free(buf); buf=buf2;
|
||||
}
|
||||
}
|
||||
type=doc_e->type&~DOCET_SELECTED;
|
||||
type=doc_e->type&~DOCET_SEL;
|
||||
for (i=DOCEt_BLINK;i<=DOCEt_UNDERLINE;i++)
|
||||
if (Bt(&t1,i)!=Bt(&type,i)) {
|
||||
if (Bt(&type,i))
|
||||
|
||||
@@ -112,6 +112,7 @@ public U8 *PopUpPickLst(U8 *lst)
|
||||
return i;
|
||||
}
|
||||
|
||||
#help_index "DolDoc/Input;Char/Lists;Char/Define;StdIn/DolDoc"
|
||||
public U8 *PopUpPickDefineSub(U8 *dname)
|
||||
{//Prompt for $LK,"Define",A="HI:Define"$ lst entry in PopUp win task.
|
||||
return PopUpPickLst(Define(dname));
|
||||
@@ -295,7 +296,8 @@ public I64 PopUpFile(U8 *filename,Bool warn_ext=TRUE,
|
||||
okay=FALSE;
|
||||
if (okay) {
|
||||
st=MStrPrint(
|
||||
"\"$$$$WW+H,1$$$$\";Auto(\"ExeFile2(\\\"%s\\\");\\n\");UserTaskCont;",
|
||||
"\"$$$$WW+H,1$$$$\";Auto(\"ExeFile2(\\\"%s\\\",CCF_CMD_LINE);\\n\");"
|
||||
"UserTaskCont;",
|
||||
name2);
|
||||
res=PopUp(st,parent,_pu_task);
|
||||
Free(st);
|
||||
|
||||
+12
-12
@@ -45,7 +45,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (!(sc&SCF_CTRL)) {
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc&SCF_SHIFT)
|
||||
KeyDescSet("Edit/Cursor Down, Select");
|
||||
KeyDescSet("Edit/Cursor Down, Sel");
|
||||
else
|
||||
KeyDescSet("Edit/Cursor Down");
|
||||
} else
|
||||
@@ -58,12 +58,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (!(sc&SCF_CTRL)) {
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc&SCF_SHIFT)
|
||||
KeyDescSet("Edit/GoTo Doc End, Select");
|
||||
KeyDescSet("Edit/GoTo Doc End, Sel");
|
||||
else
|
||||
KeyDescSet("Edit/GoTo Doc End");
|
||||
} else {
|
||||
while (doc_ce!=doc) {
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
doc_ce=doc->cur_entry=doc_ce->next;
|
||||
}
|
||||
doc->cur_col=doc_ce->min_col;
|
||||
@@ -75,7 +75,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (!(sc&SCF_CTRL)) {
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc&SCF_SHIFT)
|
||||
KeyDescSet("Edit/Cursor Up, Select");
|
||||
KeyDescSet("Edit/Cursor Up, Sel");
|
||||
else
|
||||
KeyDescSet("Edit/Cursor Up");
|
||||
} else
|
||||
@@ -88,13 +88,13 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (!(sc&SCF_CTRL)) {
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc&SCF_SHIFT)
|
||||
KeyDescSet("Edit/GoTo Top of Doc, Select");
|
||||
KeyDescSet("Edit/GoTo Top of Doc, Sel");
|
||||
else
|
||||
KeyDescSet("Edit/GoTo Top of Doc");
|
||||
} else {
|
||||
if (doc_ce==doc) doc_ce=doc_ce->last;
|
||||
while (doc_ce!=doc) {
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
doc_ce=doc->cur_entry=doc_ce->last;
|
||||
}
|
||||
doc_ce=doc->cur_entry=doc->root.next;
|
||||
@@ -107,7 +107,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (!(sc&SCF_CTRL)) {
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc&SCF_SHIFT)
|
||||
KeyDescSet("Edit/Page Down, Select");
|
||||
KeyDescSet("Edit/Page Down, Sel");
|
||||
else
|
||||
KeyDescSet("Edit/Page Down");
|
||||
} else {
|
||||
@@ -131,7 +131,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (!(sc&SCF_CTRL)) {
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc&SCF_SHIFT)
|
||||
KeyDescSet("Edit/Page Up, Select");
|
||||
KeyDescSet("Edit/Page Up, Sel");
|
||||
else
|
||||
KeyDescSet("Edit/Page Up");
|
||||
}else {
|
||||
@@ -158,7 +158,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
KeyDescSet("Edit/GoTo Start of Line");
|
||||
else {
|
||||
if (sc&SCF_SHIFT)
|
||||
KeyDescSet("Edit/Cursor Left, Select");
|
||||
KeyDescSet("Edit/Cursor Left, Sel");
|
||||
else
|
||||
KeyDescSet("Edit/Cursor Left");
|
||||
}
|
||||
@@ -171,7 +171,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
KeyDescSet("Edit/GoTo End of Line");
|
||||
else {
|
||||
if (sc&SCF_SHIFT)
|
||||
KeyDescSet("Edit/Cursor Right, Select");
|
||||
KeyDescSet("Edit/Cursor Right, Sel");
|
||||
else
|
||||
KeyDescSet("Edit/Cursor Right");
|
||||
}
|
||||
@@ -505,12 +505,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /Personal Notes");
|
||||
else
|
||||
Ed("::/Home/PersonalNotes.TXT.Z");
|
||||
Ed("~/PersonalNotes.TXT.Z");
|
||||
} else {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /Personal Menu");
|
||||
else {
|
||||
m=DocRead("::/Home/PersonalMenu.TXT.Z");
|
||||
m=DocRead("~/PersonalMenu.TXT.Z");
|
||||
DocMenu(m);
|
||||
DocDel(m);
|
||||
}
|
||||
|
||||
@@ -968,7 +968,7 @@ rc_adjust_xy:
|
||||
i=cur_u8_attr>>4 &0xF ^ win_task->text_attr>>4 & 0xF;
|
||||
else {
|
||||
i=temp_u32_attr>>12&0xF ^ win_task->text_attr>>4 & 0xF;
|
||||
if (temp_u32_attr & DOCET_SELECTED)
|
||||
if (temp_u32_attr & DOCET_SEL)
|
||||
i^=0xF;
|
||||
if (temp_u32_attr & DOCET_INVERT)
|
||||
i^=0xF;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
|
||||
Bool exited,I64 *_has_action=NULL)
|
||||
{//Do action on final entry selected by user.
|
||||
{//Do action on final entry sel by user.
|
||||
//Sometimes returns locked, sometimes unlocked
|
||||
U8 ch=doc->cmd_U8,*st;
|
||||
I64 res=DOCM_CANCEL,has_action=FALSE;
|
||||
|
||||
@@ -121,7 +121,7 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
|
||||
}
|
||||
"#include \"%s\";\n$$PT$$$$FG$$$$BG$$",st;
|
||||
WinZBufUpdate;
|
||||
ExeFile(st);
|
||||
ExeFile(st,CCF_CMD_LINE);
|
||||
res=TRUE;
|
||||
break;
|
||||
case RIGHT_AINCLUDE:
|
||||
|
||||
@@ -114,13 +114,11 @@ mt_done:
|
||||
}
|
||||
|
||||
#help_index "DolDoc/Compiler;Compiler"
|
||||
public I64 ExeDoc(CDoc *doc,Bool just_load=FALSE)
|
||||
public I64 ExeDoc(CDoc *doc,I64 ccf_flags=0)
|
||||
{//JIT Compile and execute a document.
|
||||
I64 res;
|
||||
Bool okay=TRUE,unlock_doc=DocLock(doc);
|
||||
CCmpCtrl *cc=CmpCtrlNew(,CCF_DONT_FREE_BUF);
|
||||
if (just_load)
|
||||
cc->flags|=CCF_JUST_LOAD;
|
||||
CCmpCtrl *cc=CmpCtrlNew(,ccf_flags|CCF_DONT_FREE_BUF);
|
||||
if (Fs->last_lex!=&Fs->next_lex)
|
||||
cc->opts=Fs->last_lex->opts;
|
||||
QueIns(cc,Fs->last_lex);
|
||||
|
||||
@@ -860,7 +860,7 @@ U0 EdInsCheckBox()
|
||||
|
||||
class CEdLst
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,A=\"Dft Select :%s\"$$\n",
|
||||
U8 tag[512] fmtstr "$$DA-P,A=\"Dft Sel :%s\"$$\n",
|
||||
define_str[512] fmtstr "$$DA-P,A=\"Define Str :%s\"$$\n";
|
||||
Bool refresh fmtstr "$$CB,\"Refresh Data\"$$\n";
|
||||
I64 type fmtstr "$$LS,D=\"ST_INT_SIZE_TYPES\"$$\n";
|
||||
|
||||
Reference in new issue
Block a user