godot: TextEdit: wrap is not implemented
Issue description (what happened, and what was expected):
TextEdit has method set_wrap(bool)
which is a setter for the variable wrap. This variable is never used, so I assume this option was never implemented (or was removed).
This should be either implemented or the method should be removed to avoid confusion (like this one).
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 3
- Comments: 54 (26 by maintainers)
Commits related to this issue
- TextEdit bug note https://github.com/godotengine/godot/issues/3985 — committed to lesleyrs/clipboard-narrator by lesleyrs 2 years ago
Another quick update: I’ve managed to get the text to display in the proper position on subsequent lines (no longer writes ON TOP of previous wrapped lines, but moves down to accommodate them). I’ve also disabled the horizontal scrollbar when wrap is enabled. Currently working on getting the viewport adjustment and vertical scrollbar to respond appropriately to wrapped lines so that they don’t start getting drawn off the edge of the TextEdit.
If you came here because
wrap_enabled
orset_wrap_enabled
is still not working in 2022: make sure you set thetext
property after you setwrap_enabled
, otherwise it will silently fail.@blurymind @Supergeek there is already a PR for this ready to go. It’s scheduled for the 3.1 release.
Ok, I’m going to go ahead and try to tackle this (first real bug fix challenge). Specifically because I have about 3 different tool concepts I wanna work on for Godot and ALL of them would require textedit wrapping to have the right feel, haha.
Symptoms I’ve noticed (in summary):
Edit: seems that the last bug just triggers automatically so long as you are in block mode and the cursor is not at the end of a line. Everything from the curser to the end of the file will start blinking in inverted colors.
I’ll try to work on these. I also plan to implement a max_line_chars variable so that you can specify a max length per line.
@pwab turns out I was using an old alpha version. Downloaded the latest and there is no issue!
@stubbsy345 Hey, sorry, I saw this in an email notification, and then forgot to respond.
Unfortunately, I don’t think I’ll be able to get it in for the 3.0 release. I MIGHT be able to isolate the max_chars fixes / features I mentioned if I can isolate them out of my branch, but I’ve been having really weird problems in getting my version of godot to build correctly as of late.
I was working on a different project for the last month - something I could do without having to compile the engine from source, cause I was starting to get burnt out / frustrated. I wanna try re-tackling my engine compilation issues though, so hopefully I can resume work on this.
Update: I have implemented the following bug fixes / features:
I am now moving on to the actual wrap implementation (already have an initial implementation caching the appropriate string indexes during insertion for later wrapping).
Probably the best is to use, for each line, a sub-line array (starting positions of sub-lines, like, Vector<int> that is cached and re-computed on screen resize (width) or line modification.
On Fri, Jul 28, 2017 at 11:41 AM, Will Nations notifications@github.com wrote:
Color regions can span multiple lines for comments, line constants, etc.
On Jul 23, 2017 9:05 PM, “Will Nations” notifications@github.com wrote: