chinakids / atom-simplified-chinese-menu

Atom 的简体中文汉化扩展,目前最全的汉化包。包含菜单汉化、右键菜单汉化以及设置汉化
MIT License
1.33k stars 141 forks source link

Uncaught TypeError: Cannot read property 'uri' of undefined #6

Closed shunia closed 9 years ago

shunia commented 9 years ago

To reproduce: Right-click tab, then select "close all tabs".

Stack trace:

/C:/Users/qingfenghuang/.atom/packages/simplified-chinese-menu/lib/main.coffee:32
Hide Stack Trace
TypeError: Cannot read property 'uri' of undefined
  at C:\Users\qingfenghuang\.atom\packages\simplified-chinese-menu\lib\main.coffee:31:16
  at Emitter.module.exports.Emitter.emit (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\node_modules\event-kit\lib\emitter.js:82:11)
  at C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\src\pane-container.js:320:34
  at Emitter.module.exports.Emitter.emit (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\node_modules\event-kit\lib\emitter.js:82:11)
  at Pane.module.exports.Pane.setActiveItem (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\src\pane.js:250:22)
  at Pane.module.exports.Pane.removeItem (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\src\pane.js:392:16)
  at Pane.module.exports.Pane.destroyItem (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\src\pane.js:466:16)
  at TabBarView.module.exports.TabBarView.closeTab (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\node_modules\tabs\lib\tab-bar-view.js:419:26)
  at TabBarView.module.exports.TabBarView.closeAllTabs (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\node_modules\tabs\lib\tab-bar-view.js:499:28)
  at Object.addElementCommands.tabs:close-all-tabs (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\node_modules\tabs\lib\tab-bar-view.js:115:26)
  at space-pen-ul.commandsWithPropagationStopped.(anonymous function) (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\node_modules\tabs\lib\tab-bar-view.js:86:36)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\src\command-registry.js:245:29)
  at CommandRegistry.handleCommandEvent (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\src\command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\src\command-registry.js:145:19)
  at [object Object].jQuery.fn.trigger (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\src\space-pen-extensions.js:64:23)
  at EventEmitter.<anonymous> (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\src\window-event-handler.js:75:67)
  at emitTwo (events.js:87:13)
  at EventEmitter.emit (events.js:172:7)
  at EventEmitter.ipc.sendSync (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\atom.asar\renderer\api\lib\ipc.js:21:31)
  at BrowserWindow.RemoteMemberFunction [as emit] (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\atom.asar\renderer\api\lib\remote.js:140:29)
  at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\src\context-menu-manager.js:170:31)
  at HTMLDocument.<anonymous> (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\src\window-event-handler.js:157:33)
  at HTMLDocument.handler (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\src\space-pen-extensions.js:112:34)
  at HTMLDocument.jQuery.event.dispatch (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4681:9)
  at HTMLDocument.elemData.handle (C:\Users\qingfenghuang\AppData\Local\atom\app-1.0.15\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4359:46)
shunia commented 9 years ago

Ok forget about this, it's caused by Atom itself for not completely uninstall packages, after a reopen of Atom app, it's fine now.

chinakids commented 9 years ago

你好,这个问题确实存在,我稍后将修复本问题,请留意3.3.4版本

chinakids commented 9 years ago

你好,新版本(3.3.4)已经发布,解决了本问题 请更新

shunia commented 9 years ago

感谢,一会儿试试. 另外想问一下,这种包里能使用样式定义吗? 因为在windows下,如果使用默认的one-dark之类的样式的话,有个问题就是_设置页面_中文化之后,默认字体锯齿化严重,而且_设置页面_的_左侧列表_和其他几个小地方,字体过小,几乎无法看清. 我自己目前是通过自定义样式修改掉了这个问题.如果您的插件里可以包含这部分就最好了,或者提供一个说明.

chinakids commented 9 years ago

请附上截图,以及解决方案,我是mac,window很少测,我将对平台问题做针对适配,谢谢(〜 ̄▽ ̄)〜,再次感谢支持(。・ω・。)ノ♡

shunia commented 9 years ago

根据Atom里的开发者工具找到的样式定义选择器.修改~/.atom/styles.less:

...
// to fix chinese charactor style in settings-view
.settings-view {

  .setting-description,
  .text,
  .config-menu {
    font-size: 12px;
  }

  .setting-description,
  .setting-title,
  .text,
  .section,
  .config-menu,
  .btn {
    font-family: 'Microsoft Yahei';
  }
}

之前: image

修改之后: image

chinakids commented 9 years ago

已收到您的相关意见,请留意后续更新 (〜 ̄▽ ̄)〜

chinakids commented 9 years ago

已更新版本3.3.5,麻烦测试下哈~~~