diff --git a/README.md b/README.md index 05a73a8e..a4382931 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ yarn run start ## 更新日志 [最新发布](https://github.com/purocean/yn/releases) -### [v2.0.0-beta7.11](https://github.com/purocean/yn/releases/tag/v2.0.0-beta7.11) 2019-08-21 +### [v2.0.0-beta7.12](https://github.com/purocean/yn/releases/tag/v2.0.0-beta7.12) 2019-08-22 1. 增加 2.0 计划 1. Electron 打包 1. 增加 HTML 小工具渲染 @@ -172,6 +172,9 @@ yarn run start 1. 重构前端代码便于拓展 1. 前端重构文件接口 + +展开查看更多版本记录 + ### [v1.23.0](https://github.com/purocean/yn/releases/tag/v1.23.0) 2019-07-09 1. 增加转换所有外链图片到本地功能 `Ctrl + Alt + L` @@ -300,3 +303,5 @@ yarn run start 1. 调整为暗色主题 1. 图片新标签预览 1. 增加文件筛选面板 Ctrl + p + + diff --git a/frontend/src/components/ContextMenu.vue b/frontend/src/components/ContextMenu.vue index 9893dfb0..0b53884a 100644 --- a/frontend/src/components/ContextMenu.vue +++ b/frontend/src/components/ContextMenu.vue @@ -24,9 +24,11 @@ export default { mounted () { this.mouseX = 0 this.mouseY = 0 + window.addEventListener('blur', this.hide) window.addEventListener('mousemove', this.recordMousePosition) }, beforeDestroy () { + window.removeEventListener('blur', this.hide) window.removeEventListener('mousemove', this.recordMousePosition) }, methods: { diff --git a/frontend/src/components/MonacoEditor.vue b/frontend/src/components/MonacoEditor.vue index 9d6ddd95..7ea04a01 100644 --- a/frontend/src/components/MonacoEditor.vue +++ b/frontend/src/components/MonacoEditor.vue @@ -126,7 +126,13 @@ export default { }) this.editor.addCommand(KM.Shift | KC.Enter, () => { - this.insert(this.editor.getModel().getOneIndent()) + // getOneIndent 接口被移除了 https://github.com/microsoft/monaco-editor/issues/1565 + const getOneIndent = editor => { + const options = editor.getModel().getOptions() + return options.insertSpaces ? ' '.repeat(options.tabSize) : '\t' + } + + this.insert(getOneIndent(this.editor)) }) this.editor.addCommand(KM.CtrlCmd | KM.Shift | KC.UpArrow, () => { @@ -172,15 +178,6 @@ export default { { beforeText: /^\s*1. .*$/, action: { indentAction: window.monaco.languages.IndentAction.None, appendText: '1. ' } } ] }) - - // this.editor.addCommand(KC.Enter, () => { - // const p = this.editor.getPosition() - // this.editor.executeEdits('', [{ - // range: new window.monaco.Range(p.lineNumber, p.column, p.lineNumber, p.column), - // text: '\nresult', - // forceMoveMarkers: true - // }]) - // }) }, paste (e) { if (this.editor.hasTextFocus()) { diff --git a/frontend/src/components/TitleBar.vue b/frontend/src/components/TitleBar.vue index 32b177a9..a45662cb 100644 --- a/frontend/src/components/TitleBar.vue +++ b/frontend/src/components/TitleBar.vue @@ -1,5 +1,6 @@ + {{statusText}} @@ -8,16 +9,16 @@ - + - + - + - + @@ -162,7 +163,6 @@ export default {