Skip to content

add_text() on Paragraph #71

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 8 commits into
base: master
Choose a base branch
from

Conversation

evandempsey
Copy link

Someone opened an issue for this a while ago, so I implemented it. This method allows you to easily add new text to the end of a paragraph and continue the style of the last run.

I experimented with some different ways to do it and came to the conclusion that the following behaviour is the most intuitive:

If you call add_text(t) on an empty paragraph, it adds a run with the given text and no style.
If you call add_text(t) on a non-empty paragraph, it adds the text to the last run, keeping the style of the last run.

The .idea in .gitignore is for PyCharm project files. Probably worth having it in there.

@scanny
Copy link
Contributor

scanny commented Jul 8, 2014

Nice! Thanks Evan :)

I'll merge this in.

On the .idea item in the .gitignore, that's probably best kept in your user-level gitignore (mine's at ~/.config/git/ignore). That way they stay out of all your Git projects and it keeps the project-level ignore file well focused :)

@evandempsey
Copy link
Author

Cool. I removed the .idea, as you suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants