diff --git a/CHANGELOG.md b/CHANGELOG.md index ac48826..b521d30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --> +## 1.0.11 + +### Improvement + +- Imperfect support: When a sub window is activated, clicking on the status bar of the main window can correctly bring up the QuickPick menu. 不完美支持:当子窗口激活时,点击主窗口状态栏能够正确弹出快速拾取菜单 + ## 1.0.10 ### Added @@ -59,7 +65,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix bug: The infobox showed `editor is undefined` when the current active TAB was not an editor - ## 1.0.4 ### Added diff --git a/package-lock.json b/package-lock.json index a1be089..3293b51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "variable-conversion", - "version": "0.0.1", + "version": "1.0.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "variable-conversion", - "version": "0.0.1", + "version": "1.0.11", "devDependencies": { "@types/mocha": "^10.0.6", "@types/node": "18.x", diff --git a/package.json b/package.json index a09765d..9859852 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "variable-conversion", "displayName": "Variable Conversion", "description": "一个强大的变量名转换插件,支持右键菜单、快捷键、状态栏等多种方式使用,支持小驼峰、大驼峰(帕斯卡)、下划线(蛇形)、中划线(连字符/脊柱式)、空格分隔、点分隔、全小写、全大写等常用命名方式(及组合)转换。 \nA powerful variable naming conversion extension. You can use it through the editer menu, shortcut keys and bottom bar. Support camel, pascal, snake, kebab(spinal), space, dot, lower, upper case, and more.", - "version": "1.0.10", + "version": "1.0.11", "icon": "image/logo.png", "publisher": "coder-xiaomo", "engines": { diff --git a/src/extension.ts b/src/extension.ts index af5d0f0..f99605c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -57,8 +57,17 @@ export function activate(context: vscode.ExtensionContext) { */ vscode.window.onDidChangeActiveTextEditor(event => { console.log('onDidChangeActiveTextEditor', event); - // 判断是否展示状态栏按钮 - updateStatusBarItemVisable(selectTextLength); + + // 小窗中编辑器选中后,不做其他点击鼠标点击操作,直接点击主窗口任务栏[变量转换]按钮 + // 能够在主窗口 QuickPick 中对小窗中所选文字进行转换操作 (不太完美的兼容) + let textEditor = vscode.window.activeTextEditor; + if (textEditor) { + const selections = textEditor.selections; + onTextEditorSelectionChangeCallback(textEditor, selections); + } else { // 进入 else 的场景举例: 从[代码编辑器]切换到[设置页] + // 判断是否展示状态栏按钮 + updateStatusBarItemVisable(selectTextLength); + } }); /**