Skip to content

Commit

Permalink
• Removing the useless "Triple Quote Selection" commands.
Browse files Browse the repository at this point in the history
• Improved docmate.  Currently, searches a local index file, and loads documentation for
  current word from http://docs.python.org.  If there is more than one possible match,
  displayes a tm_dialog menu.  This is pretty effective, the only drawback is that you
  have to be online to use it.  I will add support for offline docs very soon. The
  command also remembers what docs you look at the most, so will list them in order of
  popularity.
• Added a macro to forward and backward delete two quotes when pressing  ⌫ inside of
  an empty triple-quoted string.
• Made the scope for `Inside String: Insert "…"` more specific.



git-svn-id: http://svn.textmate.org/trunk/Bundles/Python.tmbundle@6312 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information
Alex Ross committed Dec 8, 2006
1 parent c2be0cf commit e4d3a9e
Show file tree
Hide file tree
Showing 11 changed files with 54,066 additions and 117 deletions.
36 changes: 31 additions & 5 deletions Commands/Documentation in Browser.plist
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,19 +5,45 @@
<key>beforeRunningCommand</key> <key>beforeRunningCommand</key>
<string>nop</string> <string>nop</string>
<key>command</key> <key>command</key>
<string>TPY=${TM_PYTHON:-python} <string>#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys
from sys import exit
from os import environ as env
import os.path
sys.path.append(os.path.join(env["TM_BUNDLE_SUPPORT"], "DocMate"))
sys.path.append(os.path.join(env["TM_SUPPORT_PATH"], "lib"))
echo '&lt;html&gt;&lt;body&gt;' from docmate import doc, increment_hitcount
"$TPY" "${TM_BUNDLE_SUPPORT}/browse_pydocs.py" import dialog
echo '&lt;/body&gt;&lt;/html&gt;'</string>
word = env["TM_CURRENT_WORD"]
if "TM_PYTHON_DOCPATH" in env:
path_to_doc = env["TM_PYTHON_DOCPATH"]
else:
path_to_doc = "http://docs.python.org/lib/"
opts = doc(word)
url = dialog.menu(opts)
if url:
increment_hitcount(url)
url = os.path.join(path_to_doc, url)
print "&lt;meta http-equiv='Refresh' content='0;URL=%s'&gt;" % url
exit(205) # show as html.
else:
print "Didn't find any documentation for %s." % word
exit(206) # show as tooltip.
</string>
<key>input</key> <key>input</key>
<string>none</string> <string>none</string>
<key>keyEquivalent</key> <key>keyEquivalent</key>
<string>^h</string> <string>^h</string>
<key>name</key> <key>name</key>
<string>Documentation in Browser</string> <string>Documentation in Browser</string>
<key>output</key> <key>output</key>
<string>showAsHTML</string> <string>showAsTooltip</string>
<key>scope</key> <key>scope</key>
<string>source.python</string> <string>source.python</string>
<key>uuid</key> <key>uuid</key>
Expand Down
28 changes: 0 additions & 28 deletions Commands/Triple Quote Selection (Double Quotes).tmCommand

This file was deleted.

28 changes: 0 additions & 28 deletions Commands/Triple Quote Selection (Single Quotes).tmCommand

This file was deleted.

Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>commands</key>
<array>
<dict>
<key>command</key>
<string>deleteForward:</string>
</dict>
<dict>
<key>command</key>
<string>deleteForward:</string>
</dict>
<dict>
<key>command</key>
<string>deleteBackward:</string>
</dict>
<dict>
<key>command</key>
<string>deleteBackward:</string>
</dict>
</array>
<key>keyEquivalent</key>
<string></string>
<key>name</key>
<string>Inside Empty Block String: Reduce To Single Quoted String</string>
<key>scope</key>
<string>source.python string.quoted.single.block meta.empty-string, source.python string.quoted.double.block meta.empty-string</string>
<key>uuid</key>
<string>8C6C3826-E2AD-410D-9B18-1567F86F7569</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Snippets/Inside String: Insert "…".tmSnippet
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>name</key> <key>name</key>
<string>Inside String: Insert "…"</string> <string>Inside String: Insert "…"</string>
<key>scope</key> <key>scope</key>
<string>source.python meta.empty-string.double.python</string> <string>source.python string.quoted.double.single-line meta.empty-string.double</string>
<key>uuid</key> <key>uuid</key>
<string>44F64180-F86E-4980-895A-2994B0EEDB5D</string> <string>44F64180-F86E-4980-895A-2994B0EEDB5D</string>
</dict> </dict>
Expand Down
2 changes: 1 addition & 1 deletion Snippets/Inside String: Insert '…'.tmSnippet
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>name</key> <key>name</key>
<string>Inside String: Insert '…'</string> <string>Inside String: Insert '…'</string>
<key>scope</key> <key>scope</key>
<string>source.python meta.empty-string.single.python</string> <string>source.python string.quoted.single.single-line meta.empty-string.single</string>
<key>uuid</key> <key>uuid</key>
<string>1BAD838C-8B2A-45FD-9AD2-7F3DCA2DD388</string> <string>1BAD838C-8B2A-45FD-9AD2-7F3DCA2DD388</string>
</dict> </dict>
Expand Down
Loading

0 comments on commit e4d3a9e

Please sign in to comment.