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

Implement additional indentation for line breaking when word wrap is on #26984

Open
rogeriodec opened this issue Mar 12, 2019 · 6 comments
Open

Comments

@rogeriodec
Copy link

Godot version:
3.1 rc2

OS/device including version:
Windows 10 x64

Issue description:
When word wrap option in on, the line breaking put the broken part left aligned with the starting line:
image

This is not aesthetically good and can lead to confusion in reading the code.
It would be best to insert an additional indentation for the broken parts, thus differentiating them from the first line:
image

@bojidar-bg
Copy link
Contributor

bojidar-bg commented Apr 17, 2019

It should be possible to fix this here:

int indent_px = line_wrap_index != 0 ? get_indent_level(line) * cache.font->get_char_size(' ').width : 0;

Note that the amount of additional indent should be configurable on the TextEdit instance.

@satyayelgatte
Copy link

is anyone working on it? coz i would like to work on it

@bojidar-bg
Copy link
Contributor

@satyayelgatte Feel free to work on it, I don't know of anyone having "claimed" it. Worst case, we will get two identical PRs.

satyayelgatte added a commit to satyayelgatte/godot that referenced this issue May 2, 2019
Removed if-else
@Chinmaygoyal
Copy link

Is the issue still up for grabs?

@Calinou
Copy link
Member

Calinou commented Oct 7, 2019

@Chinmaygoyal It seems nobody is currently working on it, so go ahead 🙂

@DaGamingWolf
Copy link

DaGamingWolf commented Sep 24, 2022

I must express a deep need for this to work. there is no getting around it. writing paragraphs in a literary way for npc dialogue is a nightmare. either all the indentation being gone makes your code look like this:

image

or you are forced to write your big paragraphs without word wrap and manually reformat for entire minutes any time you want to change a sentence in the middle of it. there is no winning in this situation.

if word wrap worked properly with indenting strings specifically, your code wouldn't look bad while your large string blocks would stay readable. Word wrap being used on strings only would be better than simply uniformly adding indents.

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

Successfully merging a pull request may close this issue.

7 participants