Skip to content

Commit

Permalink
20.7.19 Adjusted: Command line parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
tablacus committed Jul 19, 2020
1 parent 38fe11b commit 2f46252
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 21 deletions.
6 changes: 3 additions & 3 deletions Debug/addons/tabplus/config.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<TablacusExplorer>
<General>
<Version>1.58</Version>
<MinVersion>2020.7.4</MinVersion>
<pubDate>Sat, 04 Jul 2020 00:00:00 GMT</pubDate>
<Version>1.59</Version>
<MinVersion>2020.7.15</MinVersion>
<pubDate>Thu, 16 Jul 2020 00:00:00 GMT</pubDate>
<Options>Common:0:0</Options>
<Creator>Gaku</Creator>
<URL>http://tablacus.github.io/TablacusExplorerAddons/</URL>
Expand Down
29 changes: 22 additions & 7 deletions Debug/addons/tabplus/script.js
Expand Up @@ -39,7 +39,7 @@ if (window.Addon == 1) {
this.Tab(s, TC, i);
}
if (this.opt.New) {
s.push('<li class="tab3" onclick="Addons.TabPlus.New(', Id, ');return false" title="', this.opt.Tooltips ? GetText("New Tab") : "", '"');
s.push('<li class="tab3" onclick="Addons.TabPlus.New(', Id, ');return false" title="', this.opt.Tooltips ? GetText("New tab") : "", '"');
if (this.opt.Align > 1 && this.opt.Width) {
s.push(' style="text-align: center; width: 100%"');
}
Expand Down Expand Up @@ -211,13 +211,29 @@ if (window.Addon == 1) {
style.color = "";
style.backgroundColor = "";
}
this.Class(TC, i);
}
},

Class: function (TC, i) {
var o = document.getElementById("tabplus_" + TC.Id + "_" + i);
if (o) {
arClass = [];
var FV = TC[i];
if (FV.Data.Lock) {
arClass.push("locked");
}
if (FV.Data.Protect) {
arClass.push("protected");
}
if (i == TC.SelectedIndex) {
o.className = 'activetab';
style.zIndex = TC.Count + 1;
arClass.unshift('activetab');
o.style.zIndex = TC.Count + 1;
} else {
o.className = i < TC.SelectedIndex ? 'tab' : 'tab2';
style.zIndex = TC.Count - i;
arClass.push(i < TC.SelectedIndex ? 'tab' : 'tab2');
o.style.zIndex = TC.Count - i;
}
o.className = arClass.join(" ");;
}
},

Expand All @@ -240,8 +256,7 @@ if (window.Addon == 1) {
if (o && HitTest(o, this.pt)) {
} else {
TC.SelectedIndex = n;
var o = document.getElementById("tabplus_" + TC.Id + "_" + n);
o.className = "activetab";
this.Class(TC, n);
}
if (g_.IEVer < 10) {
(function (Id, n) {
Expand Down
2 changes: 1 addition & 1 deletion Debug/script/common.js
Expand Up @@ -2,7 +2,7 @@

function AboutTE(n) {
if (n == 0) {
return te.Version < 20200715 ? te.Version : 20200715;
return te.Version < 20200719 ? te.Version : 20200719;
}
if (n == 1) {
var v = AboutTE(0);
Expand Down
2 changes: 1 addition & 1 deletion TE/Resource.h
Expand Up @@ -9,7 +9,7 @@
#define STRING2(str) #str
#define VER_Y 20
#define VER_M 7
#define VER_D 15
#define VER_D 19

//Icon
#define IDI_TE 1
Expand Down
37 changes: 28 additions & 9 deletions TE/TE.cpp
Expand Up @@ -6656,6 +6656,31 @@ VOID teApiPathMatchSpec(int nArg, teParam *param, DISPPARAMS *pDispParams, VARIA
teSetBool(pVarResult, tePathMatchSpec(param[0].lpcwstr, param[1].lpwstr));
}

VOID teSzToArgv(IDispatch *pArray, LPTSTR lpsz)
{
BSTR bs = ::SysAllocString(lpsz);
LPWSTR lpszQuote = StrChr(bs, '"');
if (lpszQuote) {
lpszQuote[0] = '\\';
int i = 0;
while (lpszQuote[++i] == ' ') {}
if (i > 1) {
lpszQuote[1] = NULL;
teSzToArgv(pArray, bs);
if (lpszQuote[i]) {
teSzToArgv(pArray, &lpszQuote[i]);
}
teSysFreeString(&bs);
return;
}
}
VARIANT v;
v.vt = VT_BSTR;
v.bstrVal = bs;
teExecMethod(pArray, L"push", NULL, -1, &v);
VariantClear(&v);
}

VOID teApiCommandLineToArgv(int nArg, teParam *param, DISPPARAMS *pDispParams, VARIANT *pVarResult)
{
int nLen = 0;
Expand All @@ -6664,14 +6689,8 @@ VOID teApiCommandLineToArgv(int nArg, teParam *param, DISPPARAMS *pDispParams, V
GetNewArray(&pArray);
if (param[0].lpcwstr && param[0].lpcwstr[0]) {
lplpszArgs = CommandLineToArgvW(param[0].lpcwstr, &nLen);
for (int i = nLen; --i >= 0;) {
VARIANT v;
teSetSZ(&v, lplpszArgs[i]);
int n = ::SysStringLen(v.bstrVal);
if (v.bstrVal[n - 1] == '"') {
v.bstrVal[n - 1] = '\\';
}
tePutPropertyAt(pArray, i, &v);
for (int i = 0; i < nLen; ++i) {
teSzToArgv(pArray, lplpszArgs[i]);
}
LocalFree(lplpszArgs);
}
Expand Down Expand Up @@ -13289,7 +13308,7 @@ VOID CteShellBrowser::SetColumnsStr(BSTR bsColumns)
nAllWidth += 100;
}
}
if (nCount == 0 || nAllWidth > nCount + 4) {
if (m_pShellView && (nCount == 0 || nAllWidth > nCount + 4)) {
IColumnManager *pColumnManager;
if SUCCEEDED(m_pShellView->QueryInterface(IID_PPV_ARGS(&pColumnManager))) {
//Default Columns
Expand Down

0 comments on commit 2f46252

Please sign in to comment.