topfunky / PeepOpen-Issues

Bug reports and feature requests for the PeepOpen application
http://peepcode.com/products/peepopen
41 stars 1 forks source link

Support TextMate 2 (no plugins available yet) #272

Open dmilith opened 12 years ago

dmilith commented 12 years ago

Is there any way to spawn Peep Open window from Tm2 through a bundle command?

seangaffney commented 12 years ago

+1

topfunky commented 12 years ago

I haven't received a copy of TextMate 2 yet, but will try it out as soon as it's open to the public again.

I've heard that the problem is with activating TextMate from PeepOpen. See #273

dmilith commented 12 years ago

You may treat TM2 as TM1 without plugin support. I saw this feature done through ruby and it was tmbundle. Can You see for it in old peepOpen builds?

RobertLowe commented 12 years ago

@topfunky now that TM2 is open sourced can you look into this again?

Cheers

karldanninger commented 12 years ago

+1

Would like to see tmbundle version of peepopen

carlosbrando commented 12 years ago

+1

wigsgiw commented 12 years ago

+1

joshgoebel commented 12 years ago

+1

9mm commented 12 years ago

+1

joshgoebel commented 12 years ago

Patch PeepOpen's AppDelegate.rb as shown:

if customUrl.query
        # Don't try to gsub unless there is a query to work with.
        editorName = customUrl.query.gsub('editor=', '')
        editorName.gsub!("+"," ") # YOU ARE ADDING THIS LINE

Then you can add your own menu command to any TextMate 2 bundle manually such as:

#!/bin/sh
open "peepopen://${TM_PROJECT_DIRECTORY}?editor=TextMate+2"

This only seems to work if you pass the correct "TextMate 2" name to the binary (recompiling it first). I tried to just rename TextMate 2 to "TextMate2" and use the current release of PeepOpen but that didn't seem to do the trick. Perhaps it might if you dig around in the app's plist file or something, but that seems quite icky to maintain (since they are pushing out new builds every day).

I've emailed topfunky about getting this fix in the upstream binary so we can at least get it working pretty well until the official plugin/installer is fixed.

joshgoebel commented 12 years ago

I should clarify the plugin script alone will currently pop open PeepOpen, but it won't switch back to TextMate 2 unless you apply the patch and recompile the binary first. :(

joshgoebel commented 12 years ago

Hacked it.

defaults write com.topfunky.PeepOpen editorApplicationName "TextMate 2"

Any time you change any PeepOpen setting you'd have to rewrite this default. This "fixes" it be setting the default editor to "TextMate 2" so you don't have to pass the editor in the URL (which currently isn't possible because it contains a space).

Plugin command:

#!/bin/sh
open "peepopen://${TM_PROJECT_DIRECTORY}?editor="
joshgoebel commented 12 years ago

Of course you could probably add the defaults write command to the sh script as well... this shouldn't interfere with any other apps using PeepOpen as long as they are passing the editor in the URL.

joshgoebel commented 12 years ago

For the lazy:

https://github.com/yyyc514/PeepOpenTM2.tmbundle

This does just what I said above.

9mm commented 12 years ago

Stupid question... where do custom .tmbundles go for textmate 2? I only see it's builtin option of installing existing ones from the server. I tried making folder and it didn't recognize it.

joshgoebel commented 12 years ago

Library/Application Support/Avian/Bundles I think

topfunky commented 12 years ago

Thanks, Josh. I'll try this out and issue a release.

joshgoebel commented 12 years ago

One could argue the binary plugin is better but I find the sh plugin way more than fast. So as long as TM_PROJECT_PATH or whatever can be trusted I'm not really sure the binary is necessary any longer. I've been using it for real coding today on a project and no issues so far.

Thanks, Josh Goebel

On Sep 4, 2012, at 12:09 PM, Geoffrey Grosenbach notifications@github.com wrote:

Thanks, Josh. I'll try this out and issue a release.

— Reply to this email directly or view it on GitHub.

wakiki commented 10 years ago

I stumbled upon this thread and tried the

https://github.com/yyyc514/PeepOpenTM2.tmbundle

bundle which didn't work.

After much googling I found that the name for TM2 is actually now 'TextMate' not 'TextMate 2' - just edit that in your bundle files and it worked fine.

joshgoebel commented 10 years ago

@wakiki It depends on what your executable is named. Mine is named "TextMate 2". Is the TextMate 2 download named "TextMate" now?

travisnewman commented 10 years ago

@yyyc514 It is on mine, yes.

travisnewman commented 10 years ago

I just submitted a pull request for what works on mine.

joshgoebel commented 10 years ago

@wakiki

Why were you trying my solution in the first place? The only reason I posted this was to deal with the name change... If the executable is named TextMate doesn't the built-in binary version provided with PeepOpen do the trick?

travisnewman commented 10 years ago

I'm not @wakiki but I will say it did not work for me using the built-in version. I was only able to get it to work using the forked version that I submitted to you.

wakiki commented 10 years ago

Josh, no it didn't work in the first place, which is why I had to find an alternative solution. I can't remember exactly what problems I had, but changing the name in the forked repository did work.

Steve

On Tuesday, February 18, 2014, Josh Goebel notifications@github.com wrote:

@wakiki https://github.com/wakiki

Why were you trying my solution in the first place? The only reason I posted this was to deal with the name change... If the executable is named TextMate doesn't the built-in binary version provided with PeepOpen do the trick?

Reply to this email directly or view it on GitHubhttps://github.com/topfunky/PeepOpen-Issues/issues/272#issuecomment-35336713 .

joshgoebel commented 10 years ago

I've updated my repository to reflect the "TextMate" naming.

travisnewman commented 10 years ago

Awesome, thanks @yyyc514

wakiki commented 10 years ago

Thanks!

On 27 February 2014 16:34, Josh Goebel notifications@github.com wrote:

I've updated my repository to reflect the "TextMate" naming.

Reply to this email directly or view it on GitHubhttps://github.com/topfunky/PeepOpen-Issues/issues/272#issuecomment-36261114 .