Skip to content

Attempt to address #119 #139

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion vimdoc/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ def FullName(self):
return '{}.{}'.format(self.locals['dict'], attribute)
if 'exception' in self.locals:
return 'ERROR({})'.format(self.locals['exception'] or self.LocalName())
return self.locals.get('namespace', '') + self.LocalName()
if self.locals.get('namespace', '') is None:
print("Warning: skipping None returned by -> `self.locals.get('namespace', '')` for ->", self.LocalName())
else:
return self.locals.get('namespace', '') + self.LocalName()
return self.LocalName()

def TagName(self):
Expand Down
7 changes: 5 additions & 2 deletions vimdoc/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,11 @@ def GetCollection(self, typ):
# Sort by namespace, but preserve order within the same namespace. This
# lets us avoid variability in the order files are traversed without
# losing all useful order information.
collection = sorted(collection,
key=lambda x: x.locals.get('namespace', ''))
try:
collection = sorted(collection,
key=lambda x: x.locals.get('namespace', ''))
except TypeError as e:
print('Module.GetCollection failed sorting collection ->', collection)
elif typ == vimdoc.DICTIONARY:
collection = sorted(collection)
non_default_names = set(x.TagName() for x in collection
Expand Down