From 08e12a83748fa2f54bb24a7760b88546fb3c939b Mon Sep 17 00:00:00 2001 From: liuyongkai Date: Fri, 10 Feb 2023 09:09:11 +0800 Subject: [PATCH] * Add annotation. --- module/repo/js/monaco.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/repo/js/monaco.js b/module/repo/js/monaco.js index d87643d01f..16015dc2aa 100644 --- a/module/repo/js/monaco.js +++ b/module/repo/js/monaco.js @@ -9,6 +9,7 @@ function createTab(filename, filepath) { $('[data-path="' + decodeURIComponent(filepath) + '"]').closest('li').addClass('selected'); + /* encode twice for resolving chinese character. */ var tabID = Base64.encode(Base64.encode(filepath).replaceAll('=', '-')).replaceAll('=', '-'); return { id: tabID, @@ -56,6 +57,7 @@ $(function() /* Remove file path for opened files. */ $('#fileTabs').on('onClose', function(event, tab) { + /* encode twice for resolving chinese character. */ var filepath = decodeURIComponent(Base64.decode(Base64.decode(tab.id.replaceAll('-', '=')).replaceAll('-', '='))); var index = openedFiles.indexOf(filepath); if(index > -1)