Skip to content

Commit

Permalink
deploy: 606b7d0
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixide committed Dec 11, 2024
1 parent a40c1ea commit ebeb6b0
Show file tree
Hide file tree
Showing 55 changed files with 217 additions and 85 deletions.
4 changes: 2 additions & 2 deletions appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ window.AppConfig = {
"app_notification_url": "assets/notifications/dev/",
"app_update_url": "https://updates.phcode.io/tauri/update-latest-experimental-build.json",
"linting.enabled_by_default": true,
"build_timestamp": "2024-12-11T09:36:18.465Z",
"build_timestamp": "2024-12-11T10:59:23.939Z",
"googleAnalyticsID": "G-P4HJFPDB76",
"googleAnalyticsIDDesktop": "G-VE5BXWJ0HF",
"mixPanelID": "49c4d164b592be2350fc7af06a259bf3",
Expand All @@ -38,7 +38,7 @@ window.AppConfig = {
"bugsnagEnv": "development"
},
"name": "Phoenix Code",
"version": "3.11.0-20741",
"version": "3.11.0-20742",
"apiVersion": "3.11.0",
"homepage": "https://core.ai",
"issues": {
Expand Down
Binary file modified assets/default-project/en.zip
Binary file not shown.
Binary file modified assets/sample-projects/HTML5.zip
Binary file not shown.
Binary file modified assets/sample-projects/bootstrap-blog.zip
Binary file not shown.
Binary file modified assets/sample-projects/dashboard.zip
Binary file not shown.
Binary file modified assets/sample-projects/explore.zip
Binary file not shown.
Binary file modified assets/sample-projects/home-pages.zip
Binary file not shown.
18 changes: 17 additions & 1 deletion brackets-min.js
Original file line number Diff line number Diff line change
Expand Up @@ -33403,6 +33403,7 @@ define("extensionsIntegrated/CSSColorPreview/main", function (require, exports,
// Add listener for all editor changes
EditorManager.on("activeEditorChange", function (event, newEditor, oldEditor) {
if (newEditor && newEditor.isGutterActive(GUTTER_NAME)) {
console.time("xxxxxxxxxxx");
newEditor.off("cursorActivity.colorPreview");
newEditor.on("cursorActivity.colorPreview", _cursorActivity);
// Unbind the previous editor's change event if it exists
Expand All @@ -33413,6 +33414,7 @@ define("extensionsIntegrated/CSSColorPreview/main", function (require, exports,
newEditor.on("change", onChanged);
showColorMarks();
_cursorActivity(null, newEditor);
console.timeEnd("xxxxxxxxxxx");
}
});

Expand Down Expand Up @@ -33490,6 +33492,16 @@ define("extensionsIntegrated/CSSColorPreview/main", function (require, exports,
return token.type !== "comment";
}

function isAlphanumeric(char) {
return /^[a-z0-9-@$]$/i.test(char);
}
function _isColor(segment, colorInSegment, colorIndex) {
const previousChar = colorIndex === 0 ? "" : segment.charAt(colorIndex-1);
const endIndex = colorIndex + colorInSegment.length;
const nextChar = endIndex === segment.length ? "" : segment.charAt(endIndex);
return !isAlphanumeric(previousChar) && !isAlphanumeric(nextChar);
}

/**
* Detects valid colors in a given line of text
*
Expand All @@ -33502,7 +33514,7 @@ define("extensionsIntegrated/CSSColorPreview/main", function (require, exports,
const languageID = editor.document.getLanguage().getId();

// to make sure that code doesn't break when lineText is null.
if (!lineText) {
if (!lineText || lineText.length > 1000) { // too long lines we cant scan, maybe minified?
return [];
}

Expand All @@ -33518,6 +33530,10 @@ define("extensionsIntegrated/CSSColorPreview/main", function (require, exports,

colorMatches.forEach(colorMatch => {
const colorIndex = lineMatch.index + colorMatch.index;
// this will also allow color name like vars eg: --red-main or @heading-green. we need to omit those
if(!_isColor(lineMatch[0], colorMatch[0], colorMatch.index)) {
return;
}

// Check if the color is within a comment
const token = editor.getToken({ line: lineNumber, ch: colorIndex }, true);
Expand Down
26 changes: 13 additions & 13 deletions cacheManifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"appConfig.js": "bc916228fe4b18c56fcb9b05ba546cf32528a402042fff8827196d6978279707",
"assets/default-project/en.zip": "7ac8de294c7380a7241390c42b1725719a4a77996a6729eb036a6d2547719c88",
"appConfig.js": "ce75ce8e8d1f4fc4e3fea3e933306416636808f8275dbe1a07b399d238aa158e",
"assets/default-project/en.zip": "e8b0256a1245a0f633e15853d65c89ac784b2d3957ce8c41a61369b7e868c84d",
"assets/default-project/en/images/cloud1.svg": "527399dadfa3357c3ee1a63d6c1c7dda81ecebb832f7383db26f1aaeaf722a8d",
"assets/default-project/en/images/cloud2.svg": "8127c63c0987bc674e2d25f7d24ead017853326c1e43d07706fec46091904418",
"assets/default-project/en/images/cloud3.svg": "15de53aa41dea3b0f685292814563f97213a9736c3cec2f8e17b5d9d45b3ae3d",
Expand Down Expand Up @@ -125,7 +125,7 @@
"assets/pwa/32x32.png": "4f8f75bfcdb6efbbed1732f49edab4e292274cdeb1841e285ccc8194f4c9d8ac",
"assets/pwa/phoenix.png": "d292bf76d6d61fdece2f97fb4cd71b8b0060d1058e9c1d02c94bfb20da8b7f0d",
"assets/pwa/Square284x284Logo.png": "9887c2967039b4fae1214817925f1fb4f9227cba12d37612457c1c8ee1110c67",
"assets/sample-projects/bootstrap-blog.zip": "2d348647ca024419ed41a681be8fdf9034106afc77e57045a25fe99f1ca2f31a",
"assets/sample-projects/bootstrap-blog.zip": "a0992139fcdebbe0754707d2c258c4454cb8d6dbb2e109e56f2aa5afa3aa12ba",
"assets/sample-projects/bootstrap-blog/assets/brand/bootstrap-logo-white.svg": "203d56e7e5e15d8203e596d4a711cec986f6380064591de21850f4563fb840bf",
"assets/sample-projects/bootstrap-blog/assets/brand/bootstrap-logo.svg": "df11d37a123e36a768f2a6064973c4c6ab17d1e3c6501c8bf434ca5c0134c9a2",
"assets/sample-projects/bootstrap-blog/assets/dist/css/bootstrap.min.css": "fb1763b59f9f5764294b5af9fa5250835ae608282fe6f2f2213a5952aacf1fbf",
Expand All @@ -135,7 +135,7 @@
"assets/sample-projects/bootstrap-blog/blog.rtl.css": "33f49d02bbcb2e78f019b7582408fad2b5a76a2ecf79fe09d5b3c08c6ee3872b",
"assets/sample-projects/bootstrap-blog/index-rtl.html": "c582278884060098ff51b9d350b0739e1a0396debdc76772c62b6ec375b6efcb",
"assets/sample-projects/bootstrap-blog/index.html": "f4716c2affa299a27ab6f8c74c22fe67564f1b1d36ff2f0b322672bf0479d739",
"assets/sample-projects/dashboard.zip": "4cecea38075f0ad8506bfcad3bc0f5f1634b3fba0b96e4b9ecf53166fa925786",
"assets/sample-projects/dashboard.zip": "dedb2dd3d9f18c1e62a7af6eba12226a71013d05a0e0ef5d84f2a84faea65edf",
"assets/sample-projects/dashboard/assets/brand/bootstrap-logo-white.svg": "203d56e7e5e15d8203e596d4a711cec986f6380064591de21850f4563fb840bf",
"assets/sample-projects/dashboard/assets/brand/bootstrap-logo.svg": "df11d37a123e36a768f2a6064973c4c6ab17d1e3c6501c8bf434ca5c0134c9a2",
"assets/sample-projects/dashboard/assets/dist/css/bootstrap.min.css": "fb1763b59f9f5764294b5af9fa5250835ae608282fe6f2f2213a5952aacf1fbf",
Expand All @@ -147,7 +147,7 @@
"assets/sample-projects/dashboard/index.html": "1fb0c934f816d728cad85e180f78369679dc9edb1eca2d5c625b9360e6264235",
"assets/sample-projects/dashboard/signin.css": "083bef710a6170a5112ce257c2ecf8580ca97ce19136d770f10460e5b85862de",
"assets/sample-projects/dashboard/signin.html": "8c602e656631aeee624673397c0dc00c339498914ed930ab177478c4662a8d26",
"assets/sample-projects/explore.zip": "cde5620620f0938214b9d7d0794c7c990d6476c9469414955d1591ffea933183",
"assets/sample-projects/explore.zip": "5dc26ef5ef3ec0c36d4be97f2a952066c08076c46de49d75a5aa2c5d3c693a4b",
"assets/sample-projects/explore/A-tribute-page.html": "bd510c60f444058b7fcb71d83841f32b1cb5193c1a39421d7739bd6af9fef248",
"assets/sample-projects/explore/adjustable-fireworks.html": "11e69bb2dd8708ed8fbf1acc62b0aaaf88c7ffec859ee958dc1ae51cd53ddac8",
"assets/sample-projects/explore/ant_colony.html": "bc9435ed1b9868f2fbc7212d526f7532c533a5fdf45da988fa5e575bc5f363b7",
Expand Down Expand Up @@ -236,7 +236,7 @@
"assets/sample-projects/explore/watermelon-pixel.html": "765a3fbffb5db97910512fbabaa7c55c0b52dc8eedfcc630811be39d0af98663",
"assets/sample-projects/explore/webmine.html": "6b808f52812dc03db28483411500c04daf8ee0226f535c600a36999d6b7837c0",
"assets/sample-projects/explore/whack-a-mole.html": "25be94a3640553b4801f80edd49998bae3a360988e8a26ff3bdfdc2a76b77191",
"assets/sample-projects/home-pages.zip": "07266063792501e66342eba2a9afc24a90e1d99e13dc6d26e94d9a18dd54ce9e",
"assets/sample-projects/home-pages.zip": "8571cbc56d4ea9f1934956965e987e0f30f98fad850c92265acf27d6ff618489",
"assets/sample-projects/home-pages/album/index.html": "e29a1e96644bc17bab1a7e3724e822d65a479e10df182725ee1afa916efbfdc1",
"assets/sample-projects/home-pages/assets/brand/bootstrap-logo-white.svg": "203d56e7e5e15d8203e596d4a711cec986f6380064591de21850f4563fb840bf",
"assets/sample-projects/home-pages/assets/brand/bootstrap-logo.svg": "df11d37a123e36a768f2a6064973c4c6ab17d1e3c6501c8bf434ca5c0134c9a2",
Expand All @@ -248,19 +248,19 @@
"assets/sample-projects/home-pages/carousel/index.html": "235d650043a09f2954f24e4659f64d99ef3988858567fb2221fb1cf34df057e6",
"assets/sample-projects/home-pages/cover/cover.css": "2fbb596077c570cad7ee9e98fb88f5665e0ecfc11e7085c3e04639ad03f7bc10",
"assets/sample-projects/home-pages/cover/index.html": "759214701ff759432711b3421d80aca692c7a2b4c978c516a0bcd0c81a43f381",
"assets/sample-projects/HTML5.zip": "b1171b0a7b7b3db57f7374749320bc971952663b7bdce1a3a1aaa45e8d66647c",
"assets/sample-projects/HTML5.zip": "062985ff9b1170ef91666f8cc6f8618011965fca5e3f22d2eebab601cec34502",
"assets/sample-projects/HTML5/index.html": "2dc94c7d3e33aeeb44ec4f75bc7df86a5fd19f3121f2fd3638636fbf7c476c6a",
"assets/sample-projects/HTML5/script.js": "c49e4b01cded4defbc21f5d5d0102719ce4cccbe1b9cb19f9232c5a05df658da",
"assets/sample-projects/HTML5/styles.css": "744b85a9c31affbb00976694c4b9c9149b31e575ed9efdec386231d062ae93f2",
"assets/sample-projects/new-project-list.json": "be1c907279163610779b000aa9ea6e4b035e07429203f16445a914c7045f2d64",
"assets/sample-projects/zips/bootstrap.zip": "6f10407c00ce5d598e77f890528743dc645bc28014335483992b481e63fd7b97",
"base-config/keyboard.json": "f3380c609a293a95644965958286b31863d733293824d56b7087fa0ce4c2d618",
"base-config/readme-keyboard.md": "27e98128176dbd060e93b1f321a4ddcd609571b7b8eb8c9112588f4767d08a03",
"brackets-min.js": "dffe9b9980808619eb8d3586acf61848e00d08644f8e607fe3fa32d19499a376",
"brackets-min.js": "e6a180be3e5759d7e3d8b3cd42d10f3dfed70410915e28be824cdff94269032a",
"brackets.config.dist.json": "8faa5c0a82bb4f49784e93d1225dbd5e1fd8ec6ab07b95f5f874c7c7bd7bb234",
"brackets.config.staging.json": "c0e1f22c772c80f4f5756ab947e40538bcaf7fb7f8925834cfd4ef57c55e477a",
"brackets.js": "f7a3164510e76e012591c9758acb47f2445526642503180c57209d30faa24d69",
"cacheManifest.json": "c36c979562ac4bb56f22b79d4cc9833280c2227d50ffba10aaa475c659258c72",
"cacheManifest.json": "74b3a0d9e9396415062586c7ef4703a47bac8f67f1cbbdfcc7a87555cc22b39b",
"command/ChangeShortcutTemplate.html": "345d682d8bde29380822824778cf09acc79affae6e82b9db00c6205b2b3dd2ee",
"command/CommandManager.js": "10181902fc2e55a780981a17b95c7b579427fdfd12c92ed49df35d3b70f64c15",
"command/Commands.js": "1865297506325887a66cf11113c5cef905676fdc4b594b707bee381d968f15b0",
Expand All @@ -269,7 +269,7 @@
"command/KeyboardOverlayMode.js": "7170dfcfca59b41252146ef8a5ca4f652c666e33b7a4b411e30e72951bd35b49",
"command/Keys.js": "36545bbbca56d2a909779c5873fa860bf737977588ad61a398acb86f6bcbe4ee",
"command/Menus.js": "b0c5031f13e4ca6efd594e9fcb973f0e591a1af6cc0c0df8ec32024f6bdd0f08",
"config.json": "3b21b3682ebcbbeddbbfda10f57357e2a50865afc50c0b5dae16f4136ac5f34a",
"config.json": "12c7541da501f1e138d8e3dcbbc690f4093f0c183ebe0fc25e543fdd59332f53",
"desktop-metrics.html": "66f87550ddf04f284a6c1e81567b7dfbefb2b8007f48f0bad7d8f7aacdb11bac",
"devEnable.html": "44aa1a496a8be413299f651e6b0c3e62ac50cd5d40126ad1bb6b70b9b2b818c4",
"document/ChangedDocumentTracker.js": "03b0eaf0995fee6d27c782a8028a1314f61214e383f5f5e198320b2faac4cf40",
Expand Down Expand Up @@ -516,9 +516,9 @@
"extensions/default/UrlCodeHints/requirejs-config.json": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
"extensions/default/UrlCodeHints/unittests.js": "c60ecbe81555d435437dc5b7294f4e89b3befb7b34d60c44285c6009807c29c2",
"extensions/dev/README.md": "3fd897e55e0e05e503c898555cfa3b20e820b32946fc7c426ea9bb2afbed449f",
"extensions/registry/popularity.json": "0e7a1541a9d2c36c48893b06cf232b5812c3b89817f5aab836d9572e348b8fd9",
"extensions/registry/popularity.json": "b4ad7fe45b5c6c966db5b140de4c6da169a38280f5c017e0d7ea5e5c67fda223",
"extensions/registry/registry_version.json": "8b37ddfc93aade27f06d02ca6b539106109bd04442a105c5d03c8a3d6775f48d",
"extensions/registry/registry.json": "e295992b9ee333c61d074cfe2f2f6b32a41c3d639f51672110d735ec011443ee",
"extensions/registry/registry.json": "4b2bc5a696f75168f8c9552055413db4cd7ebd5cab12d5dab5ea1b178cd7c781",
"extensions/samples/BracketsConfigCentral/htmlContent/Config.html": "6ac3ce03e2fb8913ec5da3e8835c0646894f242600c64d95b77c7d7dc0a156f7",
"extensions/samples/BracketsConfigCentral/htmlContent/logo-sm.png": "006f025fecd24c292e87a1eb0e123ee21178ec9c09517a1f16fe362fe2fbcbb5",
"extensions/samples/BracketsConfigCentral/main.js": "f2c36decadb7d98e2a89cfdb9aff8a74cc130ea8c3ad084b7af62ee21e3a8181",
Expand All @@ -542,7 +542,7 @@
"extensions/samples/README.md": "381c6647cc6f90bd8c609b5896cfcdf78bcae2b3a9660c204d8b744a21436df6",
"extensions/samples/TypingSpeedLogger/main.js": "87327584d6ebaa4e69ee7a8b4972951baeb01869f22b7c971736524cecd3137f",
"extensionsIntegrated/appUpdater/main.js": "1d0c06f3bfb951d6293e0a69ea10def6d4f3addec459e8df78f3c88ea0a26fb6",
"extensionsIntegrated/CSSColorPreview/main.js": "2c8b078105718a6e057403bc15944ea3d8eee6a275f04c083af14b43d34a4769",
"extensionsIntegrated/CSSColorPreview/main.js": "2c8e746b2132370335f3e581d222a848e803bbc2dcb9504d1343383f66d7eb50",
"extensionsIntegrated/DisplayShortcuts/main.js": "1f03c6526af816a730f4a72d596a8b3db7294de8c8c26756e331aa442b0e91a6",
"extensionsIntegrated/DisplayShortcuts/package.json": "385efa285cafdd7695557c66ac1d7a925aab824362a2a8f6e60dbf195d3239dd",
"extensionsIntegrated/DisplayShortcuts/templates/bottom-panel.html": "1687fe6eb9d71c808d34745a7c68b235d1aa8c948339a17ce0d98aa8654fd280",
Expand Down
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"app_notification_url": "assets/notifications/dev/",
"app_update_url": "https://updates.phcode.io/tauri/update-latest-experimental-build.json",
"linting.enabled_by_default": true,
"build_timestamp": "2024-12-11T09:36:18.465Z",
"build_timestamp": "2024-12-11T10:59:23.939Z",
"googleAnalyticsID": "G-P4HJFPDB76",
"googleAnalyticsIDDesktop": "G-VE5BXWJ0HF",
"mixPanelID": "49c4d164b592be2350fc7af06a259bf3",
Expand All @@ -37,7 +37,7 @@
"bugsnagEnv": "development"
},
"name": "Phoenix Code",
"version": "3.11.0-20741",
"version": "3.11.0-20742",
"apiVersion": "3.11.0",
"homepage": "https://core.ai",
"issues": {
Expand Down
2 changes: 1 addition & 1 deletion extensions/registry/popularity.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion extensions/registry/registry.json

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion extensionsIntegrated/CSSColorPreview/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ define(function (require, exports, module) {
// Add listener for all editor changes
EditorManager.on("activeEditorChange", function (event, newEditor, oldEditor) {
if (newEditor && newEditor.isGutterActive(GUTTER_NAME)) {
console.time("xxxxxxxxxxx");
newEditor.off("cursorActivity.colorPreview");
newEditor.on("cursorActivity.colorPreview", _cursorActivity);
// Unbind the previous editor's change event if it exists
Expand All @@ -240,6 +241,7 @@ define(function (require, exports, module) {
newEditor.on("change", onChanged);
showColorMarks();
_cursorActivity(null, newEditor);
console.timeEnd("xxxxxxxxxxx");
}
});

Expand Down Expand Up @@ -317,6 +319,16 @@ define(function (require, exports, module) {
return token.type !== "comment";
}

function isAlphanumeric(char) {
return /^[a-z0-9-@$]$/i.test(char);
}
function _isColor(segment, colorInSegment, colorIndex) {
const previousChar = colorIndex === 0 ? "" : segment.charAt(colorIndex-1);
const endIndex = colorIndex + colorInSegment.length;
const nextChar = endIndex === segment.length ? "" : segment.charAt(endIndex);
return !isAlphanumeric(previousChar) && !isAlphanumeric(nextChar);
}

/**
* Detects valid colors in a given line of text
*
Expand All @@ -329,7 +341,7 @@ define(function (require, exports, module) {
const languageID = editor.document.getLanguage().getId();

// to make sure that code doesn't break when lineText is null.
if (!lineText) {
if (!lineText || lineText.length > 1000) { // too long lines we cant scan, maybe minified?
return [];
}

Expand All @@ -345,6 +357,10 @@ define(function (require, exports, module) {

colorMatches.forEach(colorMatch => {
const colorIndex = lineMatch.index + colorMatch.index;
// this will also allow color name like vars eg: --red-main or @heading-green. we need to omit those
if(!_isColor(lineMatch[0], colorMatch[0], colorMatch.index)) {
return;
}

// Check if the color is within a comment
const token = editor.getToken({ line: lineNumber, ch: colorIndex }, true);
Expand Down
4 changes: 2 additions & 2 deletions src/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ window.AppConfig = {
"app_notification_url": "assets/notifications/dev/",
"app_update_url": "https://updates.phcode.io/tauri/update-latest-experimental-build.json",
"linting.enabled_by_default": true,
"build_timestamp": "2024-12-11T09:36:18.465Z",
"build_timestamp": "2024-12-11T10:59:23.939Z",
"googleAnalyticsID": "G-P4HJFPDB76",
"googleAnalyticsIDDesktop": "G-VE5BXWJ0HF",
"mixPanelID": "49c4d164b592be2350fc7af06a259bf3",
Expand All @@ -38,7 +38,7 @@ window.AppConfig = {
"bugsnagEnv": "development"
},
"name": "Phoenix Code",
"version": "3.11.0-20741",
"version": "3.11.0-20742",
"apiVersion": "3.11.0",
"homepage": "https://core.ai",
"issues": {
Expand Down
Binary file modified src/assets/default-project/en.zip
Binary file not shown.
Binary file modified src/assets/sample-projects/HTML5.zip
Binary file not shown.
Binary file modified src/assets/sample-projects/bootstrap-blog.zip
Binary file not shown.
Binary file modified src/assets/sample-projects/dashboard.zip
Binary file not shown.
Binary file modified src/assets/sample-projects/explore.zip
Binary file not shown.
Binary file modified src/assets/sample-projects/home-pages.zip
Binary file not shown.
18 changes: 17 additions & 1 deletion src/brackets-min.js
Original file line number Diff line number Diff line change
Expand Up @@ -33403,6 +33403,7 @@ define("extensionsIntegrated/CSSColorPreview/main", function (require, exports,
// Add listener for all editor changes
EditorManager.on("activeEditorChange", function (event, newEditor, oldEditor) {
if (newEditor && newEditor.isGutterActive(GUTTER_NAME)) {
console.time("xxxxxxxxxxx");
newEditor.off("cursorActivity.colorPreview");
newEditor.on("cursorActivity.colorPreview", _cursorActivity);
// Unbind the previous editor's change event if it exists
Expand All @@ -33413,6 +33414,7 @@ define("extensionsIntegrated/CSSColorPreview/main", function (require, exports,
newEditor.on("change", onChanged);
showColorMarks();
_cursorActivity(null, newEditor);
console.timeEnd("xxxxxxxxxxx");
}
});

Expand Down Expand Up @@ -33490,6 +33492,16 @@ define("extensionsIntegrated/CSSColorPreview/main", function (require, exports,
return token.type !== "comment";
}

function isAlphanumeric(char) {
return /^[a-z0-9-@$]$/i.test(char);
}
function _isColor(segment, colorInSegment, colorIndex) {
const previousChar = colorIndex === 0 ? "" : segment.charAt(colorIndex-1);
const endIndex = colorIndex + colorInSegment.length;
const nextChar = endIndex === segment.length ? "" : segment.charAt(endIndex);
return !isAlphanumeric(previousChar) && !isAlphanumeric(nextChar);
}

/**
* Detects valid colors in a given line of text
*
Expand All @@ -33502,7 +33514,7 @@ define("extensionsIntegrated/CSSColorPreview/main", function (require, exports,
const languageID = editor.document.getLanguage().getId();

// to make sure that code doesn't break when lineText is null.
if (!lineText) {
if (!lineText || lineText.length > 1000) { // too long lines we cant scan, maybe minified?
return [];
}

Expand All @@ -33518,6 +33530,10 @@ define("extensionsIntegrated/CSSColorPreview/main", function (require, exports,

colorMatches.forEach(colorMatch => {
const colorIndex = lineMatch.index + colorMatch.index;
// this will also allow color name like vars eg: --red-main or @heading-green. we need to omit those
if(!_isColor(lineMatch[0], colorMatch[0], colorMatch.index)) {
return;
}

// Check if the color is within a comment
const token = editor.getToken({ line: lineNumber, ch: colorIndex }, true);
Expand Down
Loading

0 comments on commit ebeb6b0

Please sign in to comment.