Skip to content

Partially address #116 #142

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
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
11 changes: 8 additions & 3 deletions vimdoc/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,14 @@ def WriteCodeLine(self, text, namespace, indent=0):
wrapper = textwrap.TextWrapper(
width=self.WIDTH,
initial_indent=(indent * self.TAB),
subsequent_indent=((indent + 2) * self.TAB))
subsequent_indent=((indent + 2) * self.TAB),
break_long_words=False,
replace_whitespace=False,
break_on_hyphens=False)
# wrap returns empty list for ''. See http://bugs.python.org/issue15510.
lines = wrapper.wrap(self.Expand(text, namespace)) or ['']
for line in lines:
self.Print(line)
self.Print(line, wide=True)

def Print(self, line, end='\n', wide=False):
"""Outputs a line to the file."""
Expand All @@ -213,6 +216,8 @@ def WriteLine(self, text='', right='', indent=0, leader=None, fill=' '):
width=self.WIDTH,
initial_indent=initial_indent,
subsequent_indent=subsequent_indent,
break_long_words=False,
replace_whitespace=False,
break_on_hyphens=False)
lines = wrapper.wrap(text)
# wrap returns empty list for ''. See http://bugs.python.org/issue15510.
Expand All @@ -228,7 +233,7 @@ def WriteLine(self, text='', right='', indent=0, leader=None, fill=' '):
assert padding >= 0
lines[-1] += (fill * padding) + right
for line in lines:
self.Print(line)
self.Print(line, wide=True)

def Slug(self, slug, sep='-'):
return '{}{}{}'.format(self.module.name, sep, slug)
Expand Down