TempleOSTS_130707.ISO
This commit is contained in:
1 parent
17b71f1a2d
commit
1343005a29
617 files changed
+14399
-25130
No files matched your search
+293
-146
@@ -1,26 +1,22 @@
|
||||
#define EF_DONT_RECOMPILE 0
|
||||
#define EF_RECOMPILE 1
|
||||
#define EF_RENUM_ASM 2
|
||||
#define EF_SLIDER_CTRL 3
|
||||
#define EF_CH_SC 4
|
||||
#define C_INDENT_SPACES 2
|
||||
#define ASM_RENUM_SPACING 5
|
||||
|
||||
#define EF_REINDENT 0
|
||||
#define EF_CHK_COMPILE 1
|
||||
#define EF_RENUM_ASM 2
|
||||
#define EF_SLIDER_CTRL 3
|
||||
#define EF_CH_SC 4
|
||||
|
||||
I64 PopUpEdFmt()
|
||||
{
|
||||
I64 i;
|
||||
CDoc *doc=DocNew;
|
||||
DocPutS(doc,"$$FG,PURPLE$$Reformat Function$$FG$$\n"
|
||||
"If you enter $$FG,GREEN$$DONT RECOMPILE$$FG$$ the stored\n"
|
||||
"source line indentation information will\n"
|
||||
"be used. $$BK,1$$Be sure it is up-to-date!$$BK,0$$\n"
|
||||
"For $$FG,GREEN$$#exe$$FG$$ config'ed projects, enter $$FG,GREEN$$DONT RECOMPILE$$FG$$.\n"
|
||||
"$$MU,\"Recompile and autoindent CPP.Z Fun\",EF_RECOMPILE$$\n"
|
||||
"$$MU,\"Don't Recompile but autoindent CPP.Z Fun\",EF_DONT_RECOMPILE$$\n\n"
|
||||
"$$MU,\"Renum Asm Local @@ Labels for Fun\",EF_RENUM_ASM$$\n\n"
|
||||
"$$FG,PURPLE$$Insert Managed Code$$FG$$\n"
|
||||
"$$MU,\"Slider Ctrl\",EF_SLIDER_CTRL$$\n\n"
|
||||
"$$FG,PURPLE$$Misc$$FG$$\n"
|
||||
"$$MU,\"Insert ASCII/Scan Code Hex Codes for key pressed\",EF_CH_SC$$\n\n"
|
||||
"$$MU,\"CANCEL\",DOCM_CANCEL$$\n"
|
||||
DocPutS(doc,"$$FG,LTBLUE$$$$MU,\"Check Compile\",EF_CHK_COMPILE$$\n"
|
||||
"$$MU,\"Reindent CPP.Z Fun\",EF_REINDENT$$\n"
|
||||
"$$MU,\"Renum Asm Local @@ Labels for Fun\",EF_RENUM_ASM$$\n"
|
||||
"$$MU,\"Insert Mgd Code: Slider Ctrl\",EF_SLIDER_CTRL$$\n"
|
||||
"$$MU,\"Insert ASCII/Scan Code Hex Codes for key pressed\",EF_CH_SC$$\n"
|
||||
"$$MU,\"CANCEL\",DOCM_CANCEL$$\n\n"
|
||||
"$$FG,GREEN$$<ALT-BACKSPACE>$$FG$$ to undo if not happy\n"
|
||||
"with the results.\n");
|
||||
i=PopUpMenu(doc);
|
||||
@@ -28,14 +24,185 @@ I64 PopUpEdFmt()
|
||||
return i;
|
||||
}
|
||||
|
||||
class CRILex
|
||||
{
|
||||
CLex *lx1,*lx2;
|
||||
CQueVectU8 *indent;
|
||||
I64 depth,exp_depth;
|
||||
Bool was_new_line,is_not_cont,one_shot;
|
||||
};
|
||||
|
||||
#define C_INDENT_SPACES 2
|
||||
#define ASM_RENUM_SPACING 5
|
||||
I64 EdRILex(CRILex *rx)
|
||||
{
|
||||
Bool is_not_cont=FALSE;
|
||||
I64 i;
|
||||
do {
|
||||
Lex(rx->lx1);
|
||||
Lex(rx->lx2);
|
||||
|
||||
if (rx->lx1->token=='\n') {
|
||||
if (rx->lx2->token==TK_IDENT)
|
||||
i=PrsKeyWord(rx->lx2);
|
||||
else
|
||||
i=-1;
|
||||
if (rx->lx2->token==';' || rx->lx2->token=='{' || rx->lx2->token=='}' ||
|
||||
rx->lx2->token==':' || rx->lx2->token==')' && !rx->exp_depth ||
|
||||
i==KW_ELSE || i==KW_CATCH || i==KW_DO)
|
||||
is_not_cont=TRUE;
|
||||
}
|
||||
|
||||
if (rx->was_new_line && (rx->lx1->token!=':' || rx->lx2->token!=TK_IDENT ||
|
||||
PrsKeyWord(rx->lx2)==KW_DFT)) {
|
||||
if (rx->one_shot) {
|
||||
QueVectU8Put(rx->indent,rx->lx2->lfns[0].cur_entry->y,rx->depth+3);
|
||||
rx->one_shot=FALSE;
|
||||
} else
|
||||
QueVectU8Put(rx->indent,rx->lx2->lfns[0].cur_entry->y,rx->depth);
|
||||
}
|
||||
if (rx->lx2->token=='\n')
|
||||
rx->was_new_line=TRUE;
|
||||
else
|
||||
rx->was_new_line=FALSE;
|
||||
} while (rx->lx1->token=='\n');
|
||||
rx->is_not_cont=is_not_cont;
|
||||
return rx->lx1->token;
|
||||
}
|
||||
|
||||
U0 EdRIExp(CRILex *rx)
|
||||
{
|
||||
if (rx->lx1->token=='(') {
|
||||
if (!rx->exp_depth++)
|
||||
rx->depth+=3;
|
||||
EdRILex(rx);
|
||||
while (rx->lx1->token && rx->lx1->token!=')')
|
||||
EdRIExp(rx);
|
||||
if (!--rx->exp_depth)
|
||||
rx->depth-=3;
|
||||
}
|
||||
EdRILex(rx);
|
||||
}
|
||||
|
||||
U0 EdRIStmt(CRILex *rx,Bool indent)
|
||||
{
|
||||
I64 i;
|
||||
Bool cont;
|
||||
if (rx->lx1->token=='{') {
|
||||
rx->depth++;
|
||||
EdRILex(rx);
|
||||
while (rx->lx1->token && rx->lx1->token!='}')
|
||||
EdRIStmt(rx,FALSE);
|
||||
rx->depth--;
|
||||
EdRILex(rx);
|
||||
} else {
|
||||
if (indent) rx->depth++;
|
||||
do {
|
||||
cont=FALSE;
|
||||
switch (PrsKeyWord(rx->lx1)) {
|
||||
case KW_IF:
|
||||
EdRILex(rx);
|
||||
EdRIExp(rx);
|
||||
EdRIStmt(rx,TRUE);
|
||||
if (PrsKeyWord(rx->lx1)==KW_ELSE) {
|
||||
EdRILex(rx);
|
||||
if (PrsKeyWord(rx->lx1)==KW_IF && rx->lx2->token!='\n')
|
||||
EdRIStmt(rx,FALSE);
|
||||
else
|
||||
EdRIStmt(rx,TRUE);
|
||||
}
|
||||
break;
|
||||
case KW_TRY:
|
||||
EdRILex(rx);
|
||||
EdRIStmt(rx,TRUE);
|
||||
if (PrsKeyWord(rx->lx1)==KW_CATCH) {
|
||||
EdRILex(rx);
|
||||
EdRIStmt(rx,TRUE);
|
||||
}
|
||||
break;
|
||||
case KW_FOR:
|
||||
case KW_WHILE:
|
||||
EdRILex(rx);
|
||||
EdRIExp(rx);
|
||||
EdRIStmt(rx,TRUE);
|
||||
break;
|
||||
case KW_DO:
|
||||
EdRILex(rx);
|
||||
EdRIStmt(rx,TRUE);
|
||||
if (PrsKeyWord(rx->lx1)==KW_WHILE) {
|
||||
EdRILex(rx);
|
||||
EdRIExp(rx);
|
||||
}
|
||||
if (rx->lx1->token==';')
|
||||
EdRILex(rx);
|
||||
break;
|
||||
case KW_SWITCH:
|
||||
case KW_NOBOUND_SWITCH:
|
||||
EdRILex(rx);
|
||||
EdRIExp(rx);
|
||||
if (rx->lx1->token=='{') {
|
||||
rx->depth++;
|
||||
EdRILex(rx);
|
||||
while (rx->lx1->token && rx->lx1->token!='}') {
|
||||
while (TRUE) {
|
||||
i=PrsKeyWord(rx->lx1);
|
||||
if (i==KW_CASE || i==KW_DFT) {
|
||||
EdRILex(rx);
|
||||
while (rx->lx1->token && rx->lx1->token!=':')
|
||||
EdRILex(rx);
|
||||
EdRILex(rx);
|
||||
} else
|
||||
break;
|
||||
}
|
||||
if (rx->lx1->token)
|
||||
EdRIStmt(rx,TRUE);
|
||||
}
|
||||
rx->depth--;
|
||||
EdRILex(rx);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
while (rx->lx1->token && rx->lx1->token!=';' && rx->lx1->token!=':') {
|
||||
if (rx->lx2->token=='\n' && !rx->is_not_cont)
|
||||
rx->one_shot=TRUE;
|
||||
EdRILex(rx);
|
||||
}
|
||||
if (rx->lx1->token==':')
|
||||
cont=TRUE;
|
||||
EdRILex(rx);
|
||||
}
|
||||
} while (cont);
|
||||
if (indent) rx->depth--;
|
||||
}
|
||||
}
|
||||
|
||||
CQueVectU8 *EdRICode(CDoc *doc)
|
||||
{
|
||||
CQueVectU8 *result;
|
||||
CRILex *rx=CAlloc(sizeof(CRILex));
|
||||
|
||||
rx->lx1=LexNew(NULL,LF_KEEP_NEW_LINES|LF_DONT_FREE_BUF,doc->filename.name);
|
||||
Free(rx->lx1->lfns[0].name);
|
||||
LexAttachDoc(rx->lx1,&rx->lx1->lfns[0],doc,,doc->cur_entry,doc->cur_data_col);
|
||||
|
||||
rx->lx2=LexNew(NULL,LF_KEEP_NEW_LINES|LF_DONT_FREE_BUF,doc->filename.name);
|
||||
Free(rx->lx2->lfns[0].name);
|
||||
LexAttachDoc(rx->lx2,&rx->lx2->lfns[0],doc,,doc->cur_entry,doc->cur_data_col);
|
||||
|
||||
rx->indent=QueVectU8New(doc->cur_entry->y);
|
||||
|
||||
Lex(rx->lx1);
|
||||
EdRIStmt(rx,FALSE);
|
||||
|
||||
LexDel(rx->lx1);
|
||||
LexDel(rx->lx2);
|
||||
result=rx->indent;
|
||||
Free(rx);
|
||||
return result;
|
||||
}
|
||||
|
||||
U0 EdRemFunLeadingSpace(CDoc *doc)
|
||||
{
|
||||
Bool unlock=DocLock(doc),
|
||||
start_of_line=TRUE;
|
||||
start_of_line=TRUE;
|
||||
U8 ch,*ptr;
|
||||
I64 levels=1;
|
||||
CDocEntry *doc_e,*doc_e2;
|
||||
@@ -45,8 +212,8 @@ U0 EdRemFunLeadingSpace(CDoc *doc)
|
||||
do {
|
||||
doc_e2=doc_e->next;
|
||||
if (doc_e!=doc && doc_e!=doc->cur_entry &&
|
||||
!(doc_e->flags1&(DOCEG1_DONT_EDIT-DOCEF1_SCROLLING_X)) &&
|
||||
!(doc_e->flags2&DOCEG2_DONT_EDIT))
|
||||
!(doc_e->flags1&(DOCEG1_DONT_EDIT-DOCEF1_SCROLLING_X)) &&
|
||||
!(doc_e->flags2&DOCEG2_DONT_EDIT))
|
||||
switch (doc_e->type_u8) {
|
||||
case DOCT_TEXT:
|
||||
ptr=doc_e->tag;
|
||||
@@ -155,7 +322,7 @@ U0 EdRenumAsm(CDoc *doc)
|
||||
I64 num=0;
|
||||
CRenum root,*tempr,*tempr1;
|
||||
U8 buf[sizeof(CEdFindText.find_text)],
|
||||
buf2[sizeof(CEdFindText.find_text)];
|
||||
buf2[sizeof(CEdFindText.find_text)];
|
||||
|
||||
QueInit(&root);
|
||||
EdSelectFun(doc,TRUE);
|
||||
@@ -184,146 +351,105 @@ U0 EdRenumAsm(CDoc *doc)
|
||||
DocUnlock(doc);
|
||||
}
|
||||
|
||||
#define AC_ABORT -1
|
||||
#define AC_REINDENT 0
|
||||
#define AC_RENUM_ASM 1
|
||||
|
||||
U0 EdRefmtFun(CDoc *doc,I64 fmt_type)
|
||||
U0 EdCodeTools2(CDoc *doc,I64 tool_action)
|
||||
{
|
||||
Bool unlock=DocLock(doc),start_of_line=TRUE;
|
||||
Bool okay,unlock=DocLock(doc),start_of_line=TRUE;
|
||||
CDocEntry *doc_e,*doc_ne;
|
||||
I64 i,x,r,action=AC_ABORT,old_line_num;
|
||||
I64 i,start_y,end_y,x,r,goto_line_num;
|
||||
U8 *b,*st,*st2,*prj_file;
|
||||
CHashSrcSym *temph;
|
||||
CIndentInfo *indent;
|
||||
CTask *task=NULL;
|
||||
CTaskCmd *tempc;
|
||||
CSrvCmd *tempc;
|
||||
CQueVectU8 *indent;
|
||||
|
||||
DocRecalc(doc);
|
||||
old_line_num=doc->cur_entry->y+1;
|
||||
goto_line_num=doc->cur_entry->y+1;
|
||||
|
||||
DocCaptureUndo(doc,TRUE);
|
||||
switch (fmt_type) {
|
||||
case EF_RECOMPILE:
|
||||
if (EdGoToFun(doc,FALSE,FALSE)) {
|
||||
if (doc->flags&DOCF_PLAIN_TEXT)
|
||||
DocFlagsToggle(doc,DOCF_PLAIN_TEXT);
|
||||
DocWrite(doc);
|
||||
task=Spawn(&ServantUserCmdLine,NULL,"Servant",Fs);
|
||||
st2=CurDir;
|
||||
st=MSPrintF("Cd(\"%s\");",st2);
|
||||
tempc=TaskRqstQue(task,Fs,st,1<<TASKCf_WAKE_MASTER|1<<TASKCf_FOCUS_MASTER);
|
||||
Free(st2);
|
||||
switch (tool_action) {
|
||||
case EF_CHK_COMPILE:
|
||||
okay=FALSE;
|
||||
if (doc->flags&DOCF_PLAIN_TEXT)
|
||||
DocFlagsToggle(doc,DOCF_PLAIN_TEXT);
|
||||
DocWrite(doc);
|
||||
task=Spawn(&SrvUserCmdLine,NULL,"Srv",,Fs);
|
||||
st2=CurDir;
|
||||
st=MSPrintF("Cd(\"%s\");",st2);
|
||||
tempc=TaskExeStrQue(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
Free(st2);
|
||||
Free(st);
|
||||
SetWinHorz(Fs->win_left,Fs->win_right, task);
|
||||
SetWinVert(Fs->win_top, Fs->win_bottom,task);
|
||||
if (ScanResult(tempc,&r)) {
|
||||
st=DirFile(doc->filename.name,,"PRJ.Z"),
|
||||
prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z);
|
||||
Free(st);
|
||||
SetWinHorz(Fs->win_left,Fs->win_right, task);
|
||||
SetWinVert(Fs->win_top, Fs->win_bottom,task);
|
||||
if (GetRqstResult(tempc,&r)) {
|
||||
st=DirFile(doc->filename.name,,"PRJ.Z"),
|
||||
if (FileFind(prj_file)) {
|
||||
st2=DirFile(prj_file),
|
||||
st=MSPrintF("Cd(\"%s\");",st2);
|
||||
Free(st2);
|
||||
tempc=TaskExeStrQue(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER|1<<SVCf_FREE_ON_COMPLETE);
|
||||
Free(st);
|
||||
st=MSPrintF("\"$$WW,1$$\";Cmp(\"%s\",\"SysTemp\",\"SysTemp\");",prj_file);
|
||||
tempc=TaskExeStrQue(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
Free(st);
|
||||
if (ScanResult(tempc,&r))
|
||||
if (!r) {
|
||||
tempc=TaskExeStrQue(task,Fs,
|
||||
"Load(\"SysTemp\",LDF_JUST_LOAD);",1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
if (ScanResult(tempc,&r))
|
||||
okay=TRUE;
|
||||
}
|
||||
tempc=TaskExeStrQue(task,Fs,"Del(\"SysTemp.*\");",1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
ScanResult(tempc,&r);
|
||||
} else {
|
||||
Free(prj_file);
|
||||
st=DirFile(doc->filename.name,"Load","CPP.Z");
|
||||
prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z);
|
||||
Free(st);
|
||||
if (FileFind(prj_file)) {
|
||||
st2=DirFile(prj_file),
|
||||
st=MSPrintF("Cd(\"%s\");",st2);
|
||||
Free(st2);
|
||||
tempc=TaskRqstQue(task,Fs,st,1<<TASKCf_WAKE_MASTER|1<<TASKCf_FOCUS_MASTER);
|
||||
Free(st);
|
||||
st=MSPrintF("\"$$WW,1$$\";Cmp(\"%s\",\"SysTemp\",\"SysTemp\");",prj_file);
|
||||
tempc=TaskRqstQue(task,Fs,st,1<<TASKCf_WAKE_MASTER|1<<TASKCf_FOCUS_MASTER);
|
||||
Free(st);
|
||||
if (GetRqstResult(tempc,&r))
|
||||
if (!r) {
|
||||
tempc=TaskRqstQue(task,Fs,
|
||||
"Load(\"SysTemp\",LDF_JUST_LOAD);"
|
||||
"MapFileLoad(\"SysTemp\");",1<<TASKCf_WAKE_MASTER|1<<TASKCf_FOCUS_MASTER);
|
||||
if (GetRqstResult(tempc,&r))
|
||||
action=AC_REINDENT;
|
||||
}
|
||||
tempc=TaskRqstQue(task,Fs,"Del(\"SysTemp.*\");",1<<TASKCf_WAKE_MASTER|1<<TASKCf_FOCUS_MASTER);
|
||||
GetRqstResult(tempc,&r);
|
||||
} else {
|
||||
Free(prj_file);
|
||||
st=DirFile(doc->filename.name,"Load","CPP.Z");
|
||||
prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z);
|
||||
Free(st);
|
||||
if (FileFind(prj_file))
|
||||
st=MSPrintF("\"$$WW,1$$\";ExeFile(\"%s\",TRUE);",prj_file);
|
||||
else
|
||||
st=MSPrintF("\"$$WW,1$$\";ExeFile(\"%s\",TRUE);",doc->filename.name);
|
||||
tempc=TaskRqstQue(task,Fs,st,1<<TASKCf_WAKE_MASTER|1<<TASKCf_FOCUS_MASTER);
|
||||
Free(st);
|
||||
if (GetRqstResult(tempc,&r) && r)
|
||||
action=AC_REINDENT;
|
||||
}
|
||||
Free(prj_file);
|
||||
}
|
||||
if (action==AC_REINDENT) {
|
||||
DocUnlock(doc);
|
||||
st=MSPrintF("DbgFunFind(0x%X,0);",doc);
|
||||
tempc=TaskRqstQue(task,Fs,st,1<<TASKCf_WAKE_MASTER|1<<TASKCf_FOCUS_MASTER);
|
||||
Free(st);
|
||||
if (GetRqstResult(tempc,&r))
|
||||
temph=r;
|
||||
if (FileFind(prj_file))
|
||||
st=MSPrintF("\"$$WW,1$$\";ExeFile(\"%s\",TRUE);",prj_file);
|
||||
else
|
||||
action=AC_ABORT;
|
||||
DocLock(doc);
|
||||
} else
|
||||
PopUpOk("Has Errors");
|
||||
}
|
||||
break;
|
||||
case EF_DONT_RECOMPILE:
|
||||
if (EdGoToFun(doc,FALSE,FALSE)) {
|
||||
if (temph=DbgFunFind(doc,0))
|
||||
action=AC_REINDENT;
|
||||
}
|
||||
break;
|
||||
case EF_RENUM_ASM:
|
||||
if (EdGoToFun(doc,FALSE,TRUE)) {
|
||||
if (EdCurU8(doc)=='{') {
|
||||
EdCursorRight(doc);
|
||||
DocRecalc(doc);
|
||||
} else if (EdCurU8(doc)==':') {
|
||||
EdCursorRight(doc);
|
||||
if (EdCurU8(doc)==':')
|
||||
EdCursorRight(doc);
|
||||
DocRecalc(doc);
|
||||
st=MSPrintF("\"$$WW,1$$\";ExeFile(\"%s\",TRUE);",doc->filename.name);
|
||||
tempc=TaskExeStrQue(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
Free(st);
|
||||
if (ScanResult(tempc,&r) && r)
|
||||
okay=TRUE;
|
||||
}
|
||||
action=AC_RENUM_ASM;
|
||||
Free(prj_file);
|
||||
}
|
||||
if (!okay) {
|
||||
PopUpOk("Has Errors");
|
||||
while (LBts(&sys_semas[SYS_SEMA_FIX],0))
|
||||
Yield;
|
||||
ToFileLine(sys_fix_file_line,&st,&i);
|
||||
LBtr(&sys_semas[SYS_SEMA_FIX],0);
|
||||
if (!StrCmp(st,doc->filename.name))
|
||||
goto_line_num=i;
|
||||
Free(st);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
switch (action) {
|
||||
case AC_RENUM_ASM:
|
||||
DocUnlock(doc);
|
||||
Snd(2000); Sleep(150); Snd(0);
|
||||
Sleep(100);
|
||||
Snd(2000); Sleep(150); Snd(0);
|
||||
DocLock(doc);
|
||||
EdRenumAsm(doc);
|
||||
break;
|
||||
case AC_REINDENT:
|
||||
if (temph->type&(HTT_FUN|HTT_EXPORT_SYS_SYM))
|
||||
indent=temph->indent;
|
||||
else
|
||||
indent=NULL;
|
||||
if (indent && indent->min_line<=indent->max_line) {
|
||||
case EF_REINDENT:
|
||||
if (EdGoToFun(doc,FALSE,FALSE)) {
|
||||
start_y=doc->cur_entry->y;
|
||||
indent=EdRICode(doc);
|
||||
DocUnlock(doc);
|
||||
Snd(2000); Sleep(150); Snd(0);
|
||||
Sleep(100);
|
||||
Snd(2000); Sleep(150); Snd(0);
|
||||
DocLock(doc);
|
||||
EdRemFunLeadingSpace(doc);
|
||||
DocLineNumGoTo(doc,indent->min_line);
|
||||
DocLineNumGoTo(doc,start_y+1);
|
||||
doc_e=doc->cur_entry;
|
||||
while (indent->min_line<=doc_e->y+1<=indent->max_line) {
|
||||
end_y=start_y+indent->total_cnt;
|
||||
while (start_y<=doc_e->y<end_y) {
|
||||
if (doc_e!=doc && doc_e!=doc->cur_entry &&
|
||||
!(doc_e->flags1&(DOCEG1_DONT_EDIT-DOCEF1_SCROLLING_X)) &&
|
||||
!(doc_e->flags2&DOCEG2_DONT_EDIT)) {
|
||||
!(doc_e->flags1&(DOCEG1_DONT_EDIT-DOCEF1_SCROLLING_X)) &&
|
||||
!(doc_e->flags2&DOCEG2_DONT_EDIT)) {
|
||||
if (doc_e->type_u8==DOCT_NEW_LINE||doc_e->type_u8==DOCT_SOFT_NEW_LINE)
|
||||
start_of_line=TRUE;
|
||||
else {
|
||||
if (start_of_line) {
|
||||
i=indent->body[doc_e->y+1-indent->min_line]*C_INDENT_SPACES;
|
||||
i=QueVectU8Get(indent,doc_e->y)*C_INDENT_SPACES;
|
||||
x=doc_e->x+1;
|
||||
while (i>8) {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
@@ -339,7 +465,7 @@ U0 EdRefmtFun(CDoc *doc,I64 fmt_type)
|
||||
b=MAlloc(i+1,doc->mem_task);
|
||||
MemSet(b,CH_SPACE,i);
|
||||
b[i]=0;
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase)+sizeof(U8 *),doc->mem_task);
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr << 8;
|
||||
doc_ne->tag=b;
|
||||
doc_ne->max_col=1;
|
||||
@@ -354,11 +480,32 @@ U0 EdRefmtFun(CDoc *doc,I64 fmt_type)
|
||||
}
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
break;
|
||||
QueVectU8Del(indent);
|
||||
}
|
||||
break;
|
||||
case EF_RENUM_ASM:
|
||||
if (EdGoToFun(doc,FALSE,TRUE)) {
|
||||
if (EdCurU8(doc)=='{') {
|
||||
EdCursorRight(doc);
|
||||
DocRecalc(doc);
|
||||
} else if (EdCurU8(doc)==':') {
|
||||
EdCursorRight(doc);
|
||||
if (EdCurU8(doc)==':')
|
||||
EdCursorRight(doc);
|
||||
DocRecalc(doc);
|
||||
}
|
||||
DocUnlock(doc);
|
||||
Snd(2000); Sleep(150); Snd(0);
|
||||
Sleep(100);
|
||||
Snd(2000); Sleep(150); Snd(0);
|
||||
DocLock(doc);
|
||||
EdRenumAsm(doc);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
DocRecalc(doc);
|
||||
DocLineNumGoTo(doc,old_line_num);
|
||||
DocLineNumGoTo(doc,goto_line_num);
|
||||
|
||||
DocUnlock(doc);
|
||||
if (!unlock)
|
||||
@@ -371,7 +518,7 @@ U0 EdPopUpChSC(I64 *_ch,I64 *_sc)
|
||||
{
|
||||
I64 sc;
|
||||
"Press A Key\n";
|
||||
DocCur->flags|=DOCF_MIN_SIZE;
|
||||
DocPut->flags|=DOCF_MIN_SIZE;
|
||||
do GetMsg(_ch,&sc,1<<MSG_KEY_DOWN);
|
||||
while (sc.u8[0]==SC_SHIFT || sc.u8[0]==SC_CTRL || sc.u8[0]==SC_ALT);
|
||||
*_sc=sc;
|
||||
@@ -411,12 +558,12 @@ U0 EdChSC(CDoc *doc)
|
||||
|
||||
U0 EdCodeTools(CDoc *doc)
|
||||
{
|
||||
I64 fmt_type=PopUpEdFmt;
|
||||
switch (fmt_type) {
|
||||
case EF_DONT_RECOMPILE:
|
||||
case EF_RECOMPILE:
|
||||
I64 tool_action=PopUpEdFmt;
|
||||
switch (tool_action) {
|
||||
case EF_CHK_COMPILE:
|
||||
case EF_REINDENT:
|
||||
case EF_RENUM_ASM:
|
||||
EdRefmtFun(doc,fmt_type);
|
||||
EdCodeTools2(doc,tool_action);
|
||||
break;
|
||||
case EF_SLIDER_CTRL:
|
||||
MgdSliderCtrl(doc);
|
||||
|
||||
Reference in new issue
Block a user