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

Paginator creates pages longer than maxlen when lines longer than maxlen are added. #340

Closed
max-kamps opened this issue Sep 26, 2016 · 1 comment
Labels

Comments

@max-kamps
Copy link
Contributor

@max-kamps max-kamps commented Sep 26, 2016

>>> from discord.ext import commands                               
>>> pag = commands.Paginator()             
>>> pag.add_line('x'*2000)                 
>>> pag.pages                              
['```\n```', '```\nxxxxx...xxxxxxx```']
>>> len(pag.pages[1])                      
2008                                                                                     

Possible solutions:

  • Raise exception
  • Split lines that are too long
  • use textwrap
@Rapptz Rapptz added the bug label Sep 26, 2016
@Rapptz
Copy link
Owner

@Rapptz Rapptz commented Sep 27, 2016

I'll raise an exception (RuntimeError) for now just to deal with this edge case. That way the user can handle it however they want (e.g. splitting at specific points etc) instead of making me do the opinionated choice.

@Rapptz Rapptz closed this in 7c0be1c Sep 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants