Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't be used as external editor in nvAlt #54

Closed
die4live opened this issue Jul 8, 2014 · 8 comments
Closed

Can't be used as external editor in nvAlt #54

die4live opened this issue Jul 8, 2014 · 8 comments

Comments

@die4live
Copy link

die4live commented Jul 8, 2014

Added MacDown in nvALT's edit with list, but it seems unable to active either in app menu or context menu while other editors works well.

screen shot 2014-07-08 at 16 22 43
screen shot 2014-07-08 at 16 22 11

@uranusjr
Copy link
Member

uranusjr commented Jul 8, 2014

I’m not familiar with nvALT, but at least TextEdit doesn’t work for me. Maybe my configuration is off?

Not sure how this works internally for nvALT, but I’ll look into it when I can.

@die4live
Copy link
Author

die4live commented Jul 9, 2014

TextEdit doesn't bind with .md extension, so can't open these markdown
files in nvAlt, while .txt file is ok to open with TextEdit. I guess
maybe MacDown should register .md filetype somewhere in MAC OS (don't
know the inner way how it works), then nvAlt will detect and able to
use MacDown as external editor of .md files.

On 7/9/14, Tzu-ping Chung notifications@github.com wrote:

I’m not familiar with nvALT, but at least TextEdit doesn’t work for me.
Maybe my configuration is off?

Not sure how this works internally for nvALT, but I’ll look into it when I
can.


Reply to this email directly or view it on GitHub:
#54 (comment)

@uranusjr
Copy link
Member

uranusjr commented Jul 9, 2014

OS X uses UTIs instead of extensions to detect file formats, so extensions shouldn’t matter. TextEdit registers itself to public.data, which text formats should conform to, so it is strange to see that it it considered not able to open anything. MacDown does the same thing.

Anyway, I should probably ask the developer of nvALT how exactly I can approach this.

@die4live
Copy link
Author

die4live commented Jul 9, 2014

Well in my nvALT, TextEdit is able to open .txt file and other not registered plain text filetype. By the way, in nvALT preference Notes - Storage tab, you can set default file extension and types of file to recognize if use the Plain Text Files strategy, don't whether it concerns. And maybe you could check which formats Mou registered as it works well as my formal external editor in nvALT. And of course the best way is to contact the author:)

@uranusjr
Copy link
Member

I’ve talked to the developers of nvALT, and they are not sure where the problems, either. According to them there have been similar reports from other editor apps, too.

My current guess is that nvALT is not configured to accept editors that don’t target rich text formats. Which is plausible, since they inherited that part of code from the original nv, which is a rich text editor in essence, without much change. I’ll try to poke around inside nvALT’s source and see what I can find to confirm/reject this.

@uranusjr
Copy link
Member

Alright, here’s the result. nvALT (actually nv) is pretty picky when it decides whether an application can handle a certain type of document. In order to become usable as an external editor you need to declare yourself capable of writing to a file type (in this case UTI public.text). MacDown was originally configured to be only editor to Markdown (UTI net.daringfireball.markdown), and converts public.text files to Markdown when you save the file in it, so nv doesn’t work well with it.

I’ve loosen the restriction to make MacDown capable of being an editor (instead of viewer) to public.text. Other application should now be able to treat it as a standard text editor, including nvALT. I’ve uploaded a test build here so that you can make sure that things work correctly. If no more problem occurs, this will be included in the next release.

@die4live
Copy link
Author

Try the new one and it works well with .md and .txt filetype. Nice job! However, other plain text file with custom extension name still can't be open with MacDown while Mou can:< As a foo.md file can be open within nvALT using MacDown, but once rename it to foo.bar, it will fail to open.

Would you please do some extra work to expand the support to all native plain text?

@uranusjr
Copy link
Member

To make arbitrary extensions work I’ll need to claim editor to all file formats, and I don’t really want to do that. nv doesn’t do a very good job setting appropriate UTIs when it saves things, and I think this should be fixed there instead.

Maybe I’ll look into this problem when I get the time, but the bottom line is that the problem now belongs to nv (and nvALT), not MacDown.

@uranusjr uranusjr added this to the 0.2 milestone Jul 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants