javascript - CoffeeScript:Github ATOM,Atom API 的 getSelection 替代品?

标签 javascript coffeescript atom-editor

如果你想获取用户在网页上的选择,你可以在js文件中使用window.getSelection()。

我无法为github的atom找到类似的方法。 (在他们的API或coffeescript中的东西)。

我可以使用什么?

最佳答案

我明白了。 我们可以用: 选择=editor.getSelection() 文本=selection.getText()

关于javascript - CoffeeScript:Github ATOM,Atom API 的 getSelection 替代品?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24910778/

相关文章:

javascript - 切换大小写字符串正则表达式和数字

javascript - getJSON,在调用之前更改 api 调用 url 变量

javascript - jQuery - 返回按钮或等待,您会自动重定向 - 高级返回按钮

javascript - 通过混合使用 Backbone.View 事件方法

windows - 为什么我在 cygwin 中运行咖啡命令时出现错误?

javascript - (React-Native) undefined 不是评估 'new FormData()' 的构造函数

angularjs - 带有 nvd3/d3 的多条形图仅显示 x 轴上每隔一个刻度的标签。我怎样才能让他们全部出现?

ubuntu - 更改 platformio-ide-terminal 中文件夹的颜色

macos - 将本地编辑器与 Vagrant 一起使用

atom-editor - Atom - 强制选项卡宽度 2