Skip to content

Commit 82548c5

Browse files
authored
Merge branch 'main' into capacitor
2 parents 027f72e + 71d2fef commit 82548c5

File tree

11 files changed

+834
-322
lines changed

11 files changed

+834
-322
lines changed

config.xml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,7 @@
4646
<action android:name="android.intent.action.EDIT" />
4747
<category android:name="android.intent.category.DEFAULT" />
4848
<category android:name="android.intent.category.LAUNCHER" />
49-
<data android:mimeType="text/*"/>
50-
<data android:mimeType="xml/*" />
51-
<data android:mimeType="application/text" />
52-
<data android:mimeType="application/xml" />
53-
<data android:mimeType="application/json" />
54-
<data android:mimeType="application/javascript" />
55-
<data android:mimeType="application/x-sh" />
56-
<data android:mimeType="application/octet-stream"/>
57-
<data pathPattern=".*\.txt"/>
58-
<data pathPattern=".*\.xml"/>
59-
<data pathPattern=".*\.json"/>
49+
<data android:mimeType="*/*"/>
6050
</intent-filter>
6151
<!-- Allow app to open using url from browser -->
6252
<intent-filter android:autoVerify="true">

src/ace/modelist.js

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,44 @@ export function initModes() {
66
"ace/ext/modelist",
77
["require", "exports", "module"],
88
function (require, exports, module) {
9+
/**
10+
* Calculates a specificity score for a mode.
11+
* Higher score means more specific.
12+
* - Anchored patterns (e.g., "^Dockerfile") get a base score of 1000.
13+
* - Non-anchored patterns (extensions) are scored by length.
14+
*/
15+
function getModeSpecificityScore(modeInstance) {
16+
const extensionsStr = modeInstance.extensions;
17+
if (!extensionsStr) return 0;
18+
19+
const patterns = extensionsStr.split("|");
20+
let maxScore = 0;
21+
22+
for (const pattern of patterns) {
23+
let currentScore = 0;
24+
if (pattern.startsWith("^")) {
25+
// Exact filename match or anchored pattern
26+
currentScore = 1000 + (pattern.length - 1); // Subtract 1 for '^'
27+
} else {
28+
// Extension match
29+
currentScore = pattern.length;
30+
}
31+
if (currentScore > maxScore) {
32+
maxScore = currentScore;
33+
}
34+
}
35+
return maxScore;
36+
}
937
module.exports = {
1038
getModeForPath(path) {
1139
let mode = modesByName.text;
1240
let fileName = path.split(/[\/\\]/).pop();
13-
for (const iMode of modes) {
41+
// Sort modes by specificity (descending) to check most specific first
42+
const sortedModes = [...modes].sort((a, b) => {
43+
return getModeSpecificityScore(b) - getModeSpecificityScore(a);
44+
});
45+
46+
for (const iMode of sortedModes) {
1447
if (iMode.supportsFile?.(fileName)) {
1548
mode = iMode;
1649
break;

src/components/sidebar/style.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ body.no-animation {
124124
width: 100%;
125125
height: 100%;
126126

127+
&.files {
128+
overflow-x: auto;
129+
}
130+
127131
> .list {
128132
width: 100%;
129133
max-width: 100%;

src/lang/he-il.json

Lines changed: 408 additions & 0 deletions
Large diffs are not rendered by default.

src/lib/keyBindings.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,12 @@ export default {
325325
},
326326
pagedown: {
327327
description: "Page down",
328-
key: "PageUp",
328+
key: null,
329329
readOnly: true,
330330
},
331331
gotopagedown: {
332332
description: "Go to page down",
333-
key: null,
333+
key: "PageDown",
334334
readOnly: false,
335335
},
336336
selectpageup: {

src/lib/lang.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ const langMap = {
179179
return await import("../lang/it-it.json");
180180
},
181181
},
182+
"he-il": {
183+
name: "Hebrew",
184+
async strings() {
185+
return await import("../lang/he-il.json");
186+
},
187+
},
182188
};
183189

184190
export default {

src/lib/openFolder.js

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ function openFolder(_path, opts = {}) {
7272
}
7373

7474
const $root = collapsableList(title, "folder", {
75-
tail: <Tail target={() => $root.$title} />,
7675
allCaps: true,
7776
ontoggle: () => expandList($root),
7877
});
@@ -747,7 +746,6 @@ function appendList($target, $list) {
747746
*/
748747
function createFolderTile(name, url) {
749748
const $list = collapsableList(name, "folder", {
750-
tail: <Tail target={() => $list.$title} />,
751749
ontoggle: () => expandList($list),
752750
});
753751
const { $title } = $list;
@@ -768,7 +766,6 @@ function createFileTile(name, url) {
768766
const $tile = tile({
769767
lead: <span className={helpers.getIconForFile(name)}></span>,
770768
text: name,
771-
tail: <Tail target={() => $tile} />,
772769
});
773770
$tile.dataset.url = url;
774771
$tile.dataset.name = name;
@@ -783,22 +780,22 @@ function createFileTile(name, url) {
783780
* @param {HTMLElement} param0.target
784781
* @returns {HTMLElement}
785782
*/
786-
function Tail({ target }) {
787-
return (
788-
<span
789-
className="icon more_vert"
790-
attr-action="close"
791-
onclick={(e) => {
792-
e.stopPropagation();
793-
e.preventDefault();
794-
handleItems({
795-
target: target(),
796-
type: "contextmenu",
797-
});
798-
}}
799-
></span>
800-
);
801-
}
783+
// function Tail({ target }) {
784+
// return (
785+
// <span
786+
// className="icon more_vert"
787+
// attr-action="close"
788+
// onclick={(e) => {
789+
// e.stopPropagation();
790+
// e.preventDefault();
791+
// handleItems({
792+
// target: target(),
793+
// type: "contextmenu",
794+
// });
795+
// }}
796+
// ></span>
797+
// );
798+
// }
802799

803800
/**
804801
* Add file or folder to the list if expanded

src/lib/run.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ async function run(
6161
const uuid = helpers.uuid();
6262

6363
let isLoading = false;
64+
let isFallback = false;
6465
let filename, pathName, extension;
6566
let port = appSettings.value.serverPort;
6667
let EXECUTING_SCRIPT = uuid + "_script.js";
@@ -253,7 +254,7 @@ async function run(
253254

254255
let file = activeFile.SAFMode === "single" ? activeFile : null;
255256

256-
if (pathName) {
257+
if (pathName && isFallback) {
257258
const projectFolder = addedFolder[0];
258259

259260
//set the root folder to the file parent if no project folder is set

src/sidebarApps/files/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function initApp(el) {
2222
container = el;
2323
container.classList.add("files");
2424
container.setAttribute("data-msg", strings["open folder"]);
25+
container.style.overflowX = "auto";
2526
container.addEventListener("click", clickHandler);
2627
editorManager.on(
2728
["new-file", "int-open-file-list", "remove-file"],

src/sidebarApps/files/style.scss

Lines changed: 82 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,88 @@
1212
}
1313
}
1414

15-
.list .icon.more_vert {
16-
position: sticky;
17-
right: 0;
15+
/* Make the container horizontally scrollable */
16+
overflow-x: auto !important;
17+
max-width: 100%;
18+
19+
&::-webkit-scrollbar {
20+
height: 5px;
21+
width: 5px;
22+
}
23+
24+
&::-webkit-scrollbar-thumb {
25+
background-color: rgba(0, 0, 0, 0.3);
26+
border-radius: 3px;
27+
}
28+
29+
&::-webkit-scrollbar-corner {
30+
background: transparent;
31+
}
32+
33+
scrollbar-width: thin;
34+
scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
35+
36+
.list {
37+
min-width: 100%;
38+
width: max-content;
39+
max-width: none;
40+
}
41+
42+
ul {
43+
min-width: 100%;
44+
width: max-content;
45+
overflow-x: visible !important;
46+
max-width: none;
47+
margin-left: 0;
48+
&::-webkit-scrollbar-corner {
49+
background: transparent;
50+
}
1851
}
1952

20-
.tile:not(.light) .icon.more_vert::before {
21-
background-color: rgb(153, 153, 255);
22-
background-color: var(--primary-color);
23-
color: rgb(255, 255, 255);
24-
color: var(--primary-text-color);
25-
box-shadow: 0 0 5px 0 rgb(153, 153, 255);
26-
box-shadow: 0 0 5px 0 var(--primary-color);
53+
li {
54+
min-width: 100%;
55+
width: max-content;
56+
}
57+
58+
.tile {
59+
> .text {
60+
white-space: nowrap !important;
61+
overflow: visible !important;
62+
width: max-content !important;
63+
text-overflow: clip !important;
64+
}
65+
}
66+
67+
/* Add indent guides for folders (excluding first level) */
68+
.list.collapsible > ul > .collapsible > ul {
69+
position: relative;
70+
padding-left: 24px;
71+
72+
&::before {
73+
content: "";
74+
position: absolute;
75+
left: 14px;
76+
top: 0;
77+
height: 100%;
78+
width: 1px;
79+
background: var(--border-color);
80+
z-index: 0;
81+
}
82+
83+
/* Add guides for deeper nesting */
84+
.collapsible > ul {
85+
padding-left: 24px;
86+
87+
&::before {
88+
content: "";
89+
position: absolute;
90+
left: 14px;
91+
top: 0;
92+
height: 100%;
93+
width: 1px;
94+
background: var(--border-color);
95+
z-index: 0;
96+
}
97+
}
2798
}
28-
}
99+
}

0 commit comments

Comments
 (0)