Fixed inconsistencies between the text plugins and them not suggesting when called from the menu.

This commit is contained in:
2008-08-10 16:07:14 +00:00
parent fb3a42d0f9
commit 5dad154414
7 changed files with 74 additions and 37 deletions

View File

@@ -1,6 +1,6 @@
#!BPY
"""
Name: 'Function Documentation'
Name: 'Function Documentation | Ctrl I'
Blender: 246
Group: 'TextPlugin'
Shortcut: 'Ctrl+I'
@@ -29,14 +29,22 @@ def main():
# Look backwards for first '(' without ')'
b = 0
found = False
for i in range(c-1, -1, -1):
if line[i] == ')': b += 1
elif line[i] == '(':
b -= 1
if b < 0:
found = True
c = i
break
# Otherwise identify the name under the cursor
if not found:
llen = len(line)
while c<llen and (line[c].isalnum() or line[c]=='_'):
c += 1
pre = get_targets(line, c)
if len(pre) == 0: