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

Text Pastry conflicts with PopClip #17

Closed
bseymore opened this issue Jul 5, 2014 · 17 comments
Closed

Text Pastry conflicts with PopClip #17

bseymore opened this issue Jul 5, 2014 · 17 comments
Assignees
Milestone

Comments

@bseymore
Copy link

bseymore commented Jul 5, 2014

Discovered a conflict between Text Pastry, the OS X utility app PopClip, and Sublime Text 3. When Text Pastry is installed, something keeps PopClip from appearing when text is selected with the mouse.

If you're not familiar with PopClip, it's allows you to do a number of great things with selected text. With Text Pastry disabled, using the mouse to highlight a string reveals a little toolbar. However, with Text Pastry enabled, the doesn't appear. A demo is available at the site above.

My setup is Sublime Text 3 (3062), PopClip 1.4.10, and Text Pastry 1.3.6 running on Mac OS X 10.9.4.

@duydao
Copy link
Owner

duydao commented Jul 5, 2014

I've just installed the trial of PopClip (1.4.10) and it works fine on my Mac (10.9.3). May be an issue with 10.9.4

@duydao
Copy link
Owner

duydao commented Jul 5, 2014

Just updated to 10.9.4, works for me aswell. Please re-confirm the bug

@bseymore
Copy link
Author

bseymore commented Jul 5, 2014

Hmm. Thanks for looking into this!

It happens on both my iMac and on my MacBook Air. The PopClip bar only appears in SublimeText 3 when Text Pastry is in the Ignored Packages list. I've uninstalled and reinstalled Text Pastry (to make certain I'm using the latest release) and trimmed my Settings - User file to:

{
    "ignored_packages":
    [
        "Vintage"
    ],
}

I've also disabled apps like Moom, LaunchBar, and TextExpander and reduced PopClip to just a single task and no change. PopClip will only display in SublimeText if Text Pastry is ignored.

Is there anything at the command line level which might be of use? I'm running zsh instead of the bash shell and I may have upgraded PHP to 5.4.24, I can't remember.

@bseymore
Copy link
Author

bseymore commented Jul 5, 2014

I fired up the Console and this is what appears when Text Pastry is enabled and I try to bring up the PopClip bar in Sublime Text. Nothing appears in the console when Text Pastry is enabled.

7/5/14 10:45:18.683 AM PopClip[2686]: [INFO] NMMenuItemFinder: (copy) counted 100
7/5/14 10:45:18.745 AM PopClip[2686]: [INFO] NMMenuItemFinder: (copy) counted 200
7/5/14 10:45:18.864 AM PopClip[2686]: [INFO] NMMenuItemFinder: (paste) counted 100
7/5/14 10:45:18.929 AM PopClip[2686]: [INFO] NMMenuItemFinder: (paste) counted 200
7/5/14 10:45:19.031 AM PopClip[2686]: [INFO] NMMenuItemFinder: (cut) counted 100
7/5/14 10:45:19.088 AM PopClip[2686]: [INFO] NMMenuItemFinder: (cut) counted 200

Those messages don't appear when bringing up the PopClip bar in other apps, like Mail or Chrome.

@duydao
Copy link
Owner

duydao commented Jul 5, 2014

Could you send me your sublime packages directory as zip OR create a new mac user account with popclip, sublime text and package control/text pastry?

Am 05.07.2014 um 19:50 schrieb Brooks Seymore notifications@github.com:

I fired up the Console and this is what appears when Text Pastry is enabled and I try to bring up the PopClip bar in Sublime Text. Nothing appears in the console when it's enabled.

7/5/14 10:45:18.683 AM PopClip[2686]: [INFO] NMMenuItemFinder: (copy) counted 100
7/5/14 10:45:18.745 AM PopClip[2686]: [INFO] NMMenuItemFinder: (copy) counted 200
7/5/14 10:45:18.864 AM PopClip[2686]: [INFO] NMMenuItemFinder: (paste) counted 100
7/5/14 10:45:18.929 AM PopClip[2686]: [INFO] NMMenuItemFinder: (paste) counted 200
7/5/14 10:45:19.031 AM PopClip[2686]: [INFO] NMMenuItemFinder: (cut) counted 100
7/5/14 10:45:19.088 AM PopClip[2686]: [INFO] NMMenuItemFinder: (cut) counted 200
Those messages don't appear when bringing up the PopClip bar in other apps, like Mail or Chrome.


Reply to this email directly or view it on GitHub.

@bseymore
Copy link
Author

bseymore commented Jul 5, 2014

I installed Package Control and Text Pastry and PopClip a different user account but still running into the same issue: the PopClip bar will not display if Text Pastry is enabled.

More than happy to send my Packages directory. I assume you'll want that sent to the Gmail account listed on your Github page?

@duydao
Copy link
Owner

duydao commented Jul 5, 2014

Yes, please! Meanwhile, I will setup a new account on my mac aswell. Maybee I can reproduce the problem this way

@duydao
Copy link
Owner

duydao commented Jul 6, 2014

Thanks for the zip, I've been able to reproduce the problem and I'm happy to tell you that I have a workaround for it.

Somehow, PopClip seems to hook itself to "Special characters..." (you can see that "Edit" will flash up for a split second on the menu bar), and unfortunately, "Special characters..." uses the same key binding like the text pastry menu (CMD+ALT+T).

To work around this issue, you can follow this steps:

  • Open Sublime Text
  • Menu Bar -> Sublime Text -> Services -> Services Preferences
  • Click on App Shortcuts
  • Click on + to add a new App Shortcut
  • Choose Sublime Text in the Application listbox
  • Enter Special Characters... as Menu Title
  • Click the Keyboard Shortcut field and press CMD+ALT+SHIFT+T
  • Click on Add

This will reassign the Special Chcaracters... menu item to CMD+ALT+SHIFT+Tand PopClip will work alongside with Text Pastry.

Of course you could use whatever shortcut you like, but it has to be a shortcut that isn't used by sublime text or any other Sublime Text plugins.

Please let me know if this works for you, thanks!

@bseymore
Copy link
Author

bseymore commented Jul 6, 2014

Thanks! I've done this on both my MacBook Air (primary dev machine) and on my iMac (secondary dev machine) and while Edit > Special Characters… shows the CMD-ALT-SHIFT-T shortcut, PopClip only shows when Text Pastry is disabled.

To rule out conflicts with other packages, I completely uninstalled Sublime Text on my iMac to create a fresh install on that machine so, aside from Package Control and Text Pastry, that install is stock. I did this after finding another package which conflicted with the Text Pastry CMD-ALT-T key command, File History. Unfortunately, even on a fresh install, this doesn't solve the issue.

My current list of packages — after cleaning out a bunch of stuff I don't use — is now:

{
    "installed_packages":
    [
        "ApplySyntax",
        "AutoBackups",
        "BracketHighlighter",
        "CSScomb JS",
        "EasyDiff",
        "Emmet",
        "Predawn",
        "ReadmePlease",
        "SassBeautify",
        "SCSS",
        "SFTP",
        "SideBarEnhancements",
        "Text Pastry",
        "Theme - Soda"
    ]
}

I'll poke around a bit more after a little while to see if anything else on my setup could be the cause.

@duydao
Copy link
Owner

duydao commented Jul 6, 2014

Could you please try the following steps:

  • create a new folder named Text Pastry in your Sublime Packages folder (Sublime Text 3/Packages/Text Pastry)
  • create a file named Default (OSX).sublime-keymap
  • paste the following settings into it:
[
    { "keys": ["super+alt+n"], "command": "text_pastry_show_command_line", "args": { "text": "" } },
    { "keys": ["super+alt+t"], "command": "text_pastry_show_menu" },
    { "keys": ["super+alt+b"], "command": "text_pastry_redo" }
]

FIY the following line was removed from the 1.3.6 settings file:

    { "keys": ["super+alt+v"], "command": "text_pastry_insert_text", "args": { "clipboard": true, "separator": "\\n" } },

@bseymore
Copy link
Author

bseymore commented Jul 6, 2014

That works! By creating the Default (OSX).sublime-keymap file with those settings, the PopClip bar appears. Should this file have been created when I installed Text Pastry? And, will I need to recreate this file in the future if I ever reinstall Text Pastry, or will this be rolled into a bug fix release?

Not sure if I understand about the bit about the line having been removed from the 1.3.6 settings file. If I hadn't done a fresh install of Text Pastry, would that have been something I'd need to remove?

While I have you... is there a reason why insert_text_threshold is set to three words (?) by default? I discovered that a moment ago while composing a bit about another issue where trying to insert two words resulted in a No text found for Insert Text, cancelled error message; an inaccurate message since words were in the Text Pastry bar. I've overridden that value to two words in my TextPastry.sublime-settings file but by setting it lower, are there any potential issues I should be aware of?

Thanks for all your help on this!

@duydao
Copy link
Owner

duydao commented Jul 6, 2014

By creating the file your installation will prioritize this file and ignore the one from the text pastry package. I will create a bugfix release for this bug (1.3.7).

@duydao duydao added bug labels Jul 6, 2014
@duydao duydao added this to the 1.3.7 milestone Jul 6, 2014
@duydao duydao self-assigned this Jul 6, 2014
@duydao duydao closed this as completed Jul 6, 2014
@duydao
Copy link
Owner

duydao commented Jul 6, 2014

insert_text_threshold was discussed here: #14

tl;dr: its safe to change the value to 2 :-)

Thanks for using Text Pastry!

@duydao
Copy link
Owner

duydao commented Jul 6, 2014

I've created the bugfix release 1.3.7, it should be safe now to remove the created folder/file. Thanks!

@bseymore
Copy link
Author

bseymore commented Jul 6, 2014

Upgraded Text Pastry on my iMac and the fix works there. Plus, cmd-option-t is now brings up the Text Pastry menu when rolling back (as a test) your earlier workaround.

Read the notes in issue #14 about insert_text_threshold. Thanks for pointing me to those.

@pilotmoon
Copy link

Looks like you have it figured out, but if there's anything you need from me I'm here. (Nick, PopClip dev.)

Just some info: PopClip looks through each app's menu for the menu items bound to the ⌘C, ⌘V and ⌘X shortcuts. It doesn't look for ⌘⌥T though, so I am a bit confused by that! I suspect it is a side effect of something else.

The messages "(copy) counted (200)" etc is PopClip warning that it looked at 200 menu items and still not found the ⌘C item. It would appear that somehow Text Pastry's menu items altered the menu structure in such a say PopClip could no longer find these items. I only speculate, though.

@duydao
Copy link
Owner

duydao commented Jul 8, 2014

@invariant thanks alot for this insight! The problematic shortcut was ⌘⌥V, with your statement in mind: maybee PopClip is ignoring modifiers like Option or Shift when looking for these shortcuts.

I've removed the problematic shortcut from the package and added a note, users who still want to use it will be able to do so by simply adding it to the user keybindings file.

Thanks again for looking into this. BTW I'm starting to use PopClip and so far I'm very pleased 👍

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

3 participants