lucasmazza / copy-as-rtf

A package to export highlighted code as RTF
Other
19 stars 14 forks source link

Change syntax to get active editor to latest #7

Closed cfurrow closed 9 years ago

cfurrow commented 9 years ago
lucasmazza commented 9 years ago

How are you triggering the warning/error from #6? I'm using Atom 0.176.0 and nothing pops up in the Developer Tools log here.

cfurrow commented 9 years ago

It may have popped up when I first started atom, or perhaps when I tried to either press the key-combo, or from the command palette. The error was in deprecation cop image

image

I'm not familiar with atom package dev, yet, and my PR doesn't really "fix" #6, but it does update at least that other syntax, and I was able to copy again. Now I'm trying to fix line 16

atom.workspaceView.command 'copy-as-rtf:copy', => @copy()

Which is actually firing the deprecation, but the following did not work:

atom.views.getView(atom.workspace).command 'copy-as-rtf:copy', => @copy()

About to hit the api docs again.

lucasmazza commented 9 years ago

Another piece of the docs mention to use the atom.commands.add 'atom-workspace', ... call to bind commands (https://atom.io/docs/v0.176.0/your-first-package) which sounds more like the canonical syntax for this operation.

cfurrow commented 9 years ago

Ah, yeah, that seems like it.

cfurrow commented 9 years ago

That seems to get rid of the deprecation warning, and copying via the key shortcuts works again.

cfurrow commented 9 years ago

I changed the atom requirement in the packages.json to 0.176.0, because I did not know when this deprecation was added. Do you know of a way to see that info in the api docs?

cfurrow commented 9 years ago

May have been 0.125.0 when getActiveTextEditor() was added: https://github.com/atom/atom/commit/c9e5ff66061788135bcb9ee49640863d1964fa0a#diff-88caa33888e5345667751ee7182b4c36R328

As far as the other command syntax, I don't know.

lucasmazza commented 9 years ago

@cfurrow no idea on how to find that, but I'm merging this anyway. Thanks!

cfurrow commented 9 years ago

Thanks for the package!