Project: FAR manager
Revision: 1938
Author: skirda
Date: 06 Aug 2008 05:44:52
Changes:mix
Files:modified: /trunk/unicode_far/keyboard.cpp (
try)
modified: /trunk/unicode_far/macroopcode.hpp (
try)
modified: /trunk/unicode_far/syslog.cpp (
try)
modified: /trunk/unicode_far/macro.cpp (
try)
modified: /trunk/unicode_far/viewer.cpp (
try)
modified: /trunk/unicode_far/vbuild.m4 (
try)
modified: /trunk/unicode_far/changelog (
try)
modified: /trunk/unicode_far/macro.hpp (
try)
modified: /trunk/unicode_far/syntax.cpp (
try)
Diff:
| ... | ...@@ -381,7 +381,7 @@ |
| 381 | 381 | NotMacros=CalcKey&0x80000000?1:0;
|
| 382 | 382 | CalcKey&=~0x80000000;
|
| 383 | 383 | //???
|
| 384 | | if(CtrlObject && CtrlObject->Macro.IsRecording() && (CalcKey == (KEY_ALT|KEY_NUMPAD0) || CalcKey == (KEY_ALT|KEY_INS)))
|
| 384 | if(!ExcludeMacro && CtrlObject && CtrlObject->Macro.IsRecording() && (CalcKey == (KEY_ALT|KEY_NUMPAD0) || CalcKey == (KEY_ALT|KEY_INS)))
|
| 385 | 385 | {
|
| 386 | 386 | if(CtrlObject->Macro.ProcessKey(CalcKey))
|
| 387 | 387 | {
|
| ... | ...@@ -395,7 +395,7 @@ |
| 395 | 395 | if (!NotMacros)
|
| 396 | 396 | {
|
| 397 | 397 | _KEYMACRO(CleverSysLog Clev(L"CALL(1) CtrlObject->Macro.ProcessKey()"));
|
| 398 | | if (CtrlObject!=NULL && CtrlObject->Macro.ProcessKey(CalcKey))
|
| 398 | if (!ExcludeMacro && CtrlObject!=NULL && CtrlObject->Macro.ProcessKey(CalcKey))
|
| 399 | 399 | {
|
| 400 | 400 | rec->EventType=0;
|
| 401 | 401 | CalcKey=KEY_NONE;
|
| ... | ...@@ -1406,8 +1406,8 @@ |
| 1406 | 1406 | // |
| ... | ...@@ -169,6 +169,7 @@ |
| 169 | 169 | MCODE_F_BM_NEXT, // N=BM.Next() - |
| ... | ...@@ -1230,6 +1230,28 @@ |
| 1230 | 1230 | return Cond;
|
| 1231 | 1231 | }
|
| 1232 | 1232 |
|
| 1233 |
|
| 1234 | // S=trim(S[,N])
|
| 1235 | static bool trimFunc()
|
| 1236 | {
|
| 1237 | int mode = (int) VMStack.Pop().toInteger();
|
| 1238 | TVar Val= VMStack.Pop();
|
| 1239 |
|
| 1240 | wchar_t *p = (wchar_t *)Val.toString();
|
| 1241 | bool Ret=true;
|
| 1242 |
|
| 1243 | switch(mode)
|
| 1244 | {
|
| 1245 | case 0: p=RemoveExternalSpaces(p); break; // alltrim
|
| 1246 | case 1: p=RemoveLeadingSpaces(p); break; // ltrim
|
| 1247 | case 2: p=RemoveTrailingSpaces(p); break; // rtrim
|
| 1248 | default: Ret=false;
|
| 1249 | }
|
| 1250 |
|
| 1251 | VMStack.Push((const wchar_t*)p);
|
| 1252 | return Ret;
|
| 1253 | }
|
| 1254 |
|
| 1233 | 1255 | // S=substr(S,N1[,N2])
|
| 1234 | 1256 | static bool substrFunc()
|
| 1235 | 1257 | {
|
| ... | ...@@ -1241,7 +1263,7 @@ |
| 1241 | 1263 | bool Ret=false;
|
| 1242 | 1264 |
|
| 1243 | 1265 | int len = StrLength(p);
|
| 1244 | | if ( ( p1 > 0 || p1 < 0) && ( p1 < len ) )
|
| 1266 | if ( p2 != 0 && p1 >= 0 && p1 < len )
|
| 1245 | 1267 | {
|
| 1246 | 1268 | if(p1 > 0)
|
| 1247 | 1269 | p += p1;
|
| ... | ...@@ -1574,18 +1596,18 @@ |
| 1574 | 1596 | TVar Result(L"");
|
| 1575 | 1597 | bool Ret=false;
|
| 1576 | 1598 |
|
| 1577 | | if(!ValTitle.isInteger())
|
| 1599 | if(!(ValTitle.isInteger() && !ValTitle.i()))
|
| 1578 | 1600 | {
|
| 1579 | 1601 | const wchar_t *history=NULL;
|
| 1580 | | if(!ValHistory.isInteger())
|
| 1602 | if(!(ValHistory.isInteger() && !ValHistory.i()))
|
| 1581 | 1603 | history=ValHistory.s();
|
| 1582 | 1604 |
|
| 1583 | 1605 | const wchar_t *src=L"";
|
| 1584 | | if(!ValSrc.isInteger())
|
| 1606 | if(!(ValSrc.isInteger() && !ValSrc.i()))
|
| 1585 | 1607 | src=ValSrc.s();
|
| 1586 | 1608 |
|
| 1587 | 1609 | const wchar_t *prompt=L"";
|
| 1588 | | if(!ValPrompt.isInteger())
|
| 1610 | if(!(ValPrompt.isInteger() && !ValPrompt.i()))
|
| 1589 | 1611 | prompt=ValPrompt.s();
|
| 1590 | 1612 |
|
| 1591 | 1613 | const wchar_t *title=NullToEmpty(ValTitle.toString());
|
| ... | ...@@ -1611,11 +1633,11 @@ |
| 1611 | 1633 | TVar ValT = VMStack.Pop();
|
| 1612 | 1634 |
|
| 1613 | 1635 | const wchar_t *title = L"";
|
| 1614 | | if(!ValT.isInteger())
|
| 1636 | if(!(ValT.isInteger() && !ValT.i()))
|
| 1615 | 1637 | title=NullToEmpty(ValT.toString());
|
| 1616 | 1638 |
|
| 1617 | 1639 | const wchar_t *text = L"";
|
| 1618 | | if(!ValB.isInteger())
|
| 1640 | if(!(ValB.isInteger() && !ValB.i()))
|
| 1619 | 1641 | text =NullToEmpty(ValB.toString());
|
| 1620 | 1642 |
|
| 1621 | 1643 | Flags&=~(FMSG_KEEPBACKGROUND|FMSG_ERRORTYPE);
|
| ... | ...@@ -2153,7 +2175,7 @@ |
| 2153 | 2175 | int typePanel=(int)VMStack.Pop().toInteger();
|
| 2154 | 2176 | __int64 Ret=_i64(0);
|
| 2155 | 2177 |
|
| 2156 | | if(!Val.isInteger())
|
| 2178 | if(!(Val.isInteger() && !Val.i()))
|
| 2157 | 2179 | {
|
| 2158 | 2180 | const wchar_t *pathName=Val.s();
|
| 2159 | 2181 |
|
| ... | ...@@ -2616,6 +2638,7 @@ |
| 2616 | 2638 | if(PeekInputRecord(&rec) && rec.EventType==KEY_EVENT && rec.Event.KeyEvent.wVirtualKeyCode == VK_CANCEL)
|
| 2617 | 2639 | {
|
| 2618 | 2640 | GetInputRecord(&rec,true); // |
| ... | ...@@ -1 +1 @@ |
| 0 | | m4_define(BUILD,542)m4_dnl |
| 0 | m4_define(BUILD,543)m4_dnl |
| ... | ...@@ -1,3 +1,25 @@ |
| 1 | svs 06.08.2008 12:50:15 +0300 - build 543
|
| 2 |
|
| 3 | 1. Macro: |
| ... | ...@@ -138,6 +138,7 @@ |
| 138 | 138 | int ProcessKey(int Key);
|
| 139 | 139 | int GetKey();
|
| 140 | 140 | int PeekKey();
|
| 141 | bool IsOpCode(DWORD p);
|
| 141 | 142 |
|
| 142 | 143 | int PushState(bool CopyLocalVars=FALSE);
|
| 143 | 144 | int PopState();
|
| ... | ...@@ -281,6 +281,7 @@ |
| 281 | 281 | {L"SLEEP", 1, 0, MCODE_F_SLEEP}, // N=sleep(N)
|
| 282 | 282 | {L"STRING", 1, 0, MCODE_F_STRING}, // S=string(V)
|
| 283 | 283 | {L"SUBSTR", 3, 1, MCODE_F_SUBSTR}, // S=substr(S,N1[,N2])
|
| 284 | {L"TRIM", 2, 1, MCODE_F_TRIM}, // S=trim(S[,N])
|
| 284 | 285 | {L"UCASE", 1, 0, MCODE_F_UCASE}, // S=ucase(S1)
|
| 285 | 286 | {L"WAITKEY", 1, 1, MCODE_F_WAITKEY}, // S=waitkey([N])
|
| 286 | 287 | {L"XLAT", 1, 0, MCODE_F_XLAT}, // S=xlat(S)
|
| ... | ...@@ -313,7 +314,7 @@ |
| 313 | 314 | if ( nParam )
|
| 314 | 315 | {
|
| 315 | 316 | int i=0;
|
| 316 | | if (nParam > oParam)
|
| 317 | if (nParam >= oParam)
|
| 317 | 318 | {
|
| 318 | 319 | for ( ; i < nParam ; i++ )
|
| 319 | 320 | {
|
| ... | ...@@ -344,7 +345,11 @@ |
| 344 | 345 | for( ; i < nParam-1; ++i)
|
| 345 | 346 | {
|
| 346 | 347 | put(MCODE_OP_PUSHINT);
|
| 347 | | put64(_i64(0));
|
| 348 | // |
To list