Search Issue Tracker
By Design
Votes
1
Found in [Package]
2.0.1
Issue ID
1184177
Regression
No
[TMP] Text is overlapped when pasted text's line breaks are deleted
How to reproduce:
1. Open the attached '1184177-TMP-text-overlap.zip' project
2. Open 'SampleScene' scene
3. Select Text (TMP) GameObject in the Hierarchy
4. Copy and paste some text to the TMP Text field in the Inspector
5. Delete line-breaks
6. Observe the text field in the Scene View
Expected result: Pasted text is not overlapped
Actual result: Pasted text is overlapped
Reproducible with: 2017.4.32f1, 2018.4.9f1, 2019.2.7f1(TMP 1.4.0, 2.0.1), 2019.3.0b4 (TMP 1.4.0, 2.0.1), 2020.1.0a5 (TMP 1.4.0, 2.0.1)
Note: TMP for 2017.4, 2018.4 downloaded from Asset Store
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Channel remapping dropdown in the Terrain Layer does not open when clicked on the title
- The Editor freezes indefinitely when a large number of elements are entered in the Subgraphs or Categories lists
- Some Visual Effects package Assets links to documentation are not working
- Heatmap asset’s documentation button in the Inspector window leads to “Sorry... that page seems to be missing!” page when clicked
- Crash on MonoBehaviour::CallMethodIfAvailable when performing various actions
Resolution Note:
The reported behavior is by design.
The original text contained both Carriage Return (CR) (\r) and Line Feed (LF) (\n). Deleting the LF leaves the CR in the text and as such since Carriage Return's function is to return the carriage to the start position of the line, the text is overwritten. Carriage Return does not add a new line.
I realize that text containing control characters (which are not visible) makes it hard to understand / decipher these types of behavior. At some point I do plan to add a mode where these control characters will be visible in the Text Input Box which should help alleviate this type of confusion.