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

Discussion: solving multiline text render issues #348

Open
guysalt opened this issue Feb 3, 2023 · 7 comments
Open

Discussion: solving multiline text render issues #348

guysalt opened this issue Feb 3, 2023 · 7 comments
Assignees
Labels
enhancement New feature or request python Pull requests that update Python code question Further information is requested

Comments

@guysalt
Copy link

guysalt commented Feb 3, 2023

hi there,

i see there is a lot of issues about solving the render bugs that appear when a line is longer then the terminal width.
i really want to help this repo to be better, and i think i have enough time to do so.
so i'm wanting to try to fix these bugs and making pr's for this.
and i wanted to ask in advance if it's ok before i'm starting to put a lot of hours in these. and also how can i communicate with you if i have any questions about anything in the code?

thank you :)

@Cube707
Copy link
Collaborator

Cube707 commented Feb 4, 2023

Hey, we would be happy to accept PRs on this (and its a really big issue and fixing would be a great advancement)

However keep in mind that this will probably more work, as it might require rewriting the renderer pretty much completely.


As for questions, feel free to ask questions you have here and if you have a working example, open a PR and we can discuss it there. I can also open a development branch for this feature, which you can target with your PRs (if you plan on multiple PRs)

My knowledge on the codebase is not super deep though. I mostly know about the handeling of input and the interactions with readchar (which I maintain). Staticdev is leaving the project right now and the original author is very rarly available.

@guysalt
Copy link
Author

guysalt commented Feb 4, 2023

great!

yea i understand this will require a lot of work and rewriting and that why i ask before starting to work.

and i think it will be great to open a development branch that i can target!

thank you!

@guysalt guysalt changed the title PR to solve the multiline render issues multiline text render issues Feb 6, 2023
@guysalt
Copy link
Author

guysalt commented Feb 6, 2023

msg_template = (
"{t.move_up}{t.clear_eol}{tq.brackets_color}[" "{tq.mark_color}?{tq.brackets_color}]{t.normal} {msg}"
)

def print_str(self, base, lf=False, **kwargs):
if lf:
self._position += 1
print(base.format(t=self.terminal, **kwargs), end="\n" if lf else "")
sys.stdout.flush()

hey,

there is a specific reason why the print_str formatting instead of just get the message and print it?

i think it will be better if print_str function just print the output and handle the position attribute. and everything that relate to the formatting will be outside the function...

@Cube707
Copy link
Collaborator

Cube707 commented Feb 7, 2023

I dont know why it was done this way.

I assume there where plans on making this more cabale of different output devices (for example, to files or non-tty consoles or similar). This way the theming would be present in all higher functions and only the last step would be specific to a rendering device and implement how to apply the theming.

But I think its safe to assume a TTY output and work from there (readchar also requires it for the most part)

@Cube707 Cube707 changed the title multiline text render issues Discussion: solving multiline text render issues Feb 7, 2023
@Cube707 Cube707 added enhancement New feature or request question Further information is requested python Pull requests that update Python code labels Feb 7, 2023
@guysalt
Copy link
Author

guysalt commented Feb 8, 2023

hey, do you want to open a development branch?

i have already some changes you can look at and i think it will be great to go over features/bug fixes one by one for convenience

i can do all the changes in one branch and open a pr to main, but it will be include more than one issue... so it's for your decision :)

@Cube707
Copy link
Collaborator

Cube707 commented Feb 9, 2023

No, i will open a dev branch. But I am currently on holiday and didn't bother to to it on mobile. Will do it in the weekend

@Cube707
Copy link
Collaborator

Cube707 commented Feb 11, 2023

@guysalt

new branch is at dev/renderer-update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Pull requests that update Python code question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants