question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrap on typing and Table format do not take actual character widths into account for multi-byte characters

See original GitHub issue

copied from #219

Table formatting produces unexpected results when typing multibyte characters. Would you have any plans to fix it? In case it is difficult to handle multibyes, it would be nice if we could disable auto formatting feature for table.

Environment:

  • Ubuntu 14.04 LTS
  • IntelliJ IDEA 2016.1
  • Build #IU-145.970, built on April 18, 2016
  • JRE: 1.8.0_76-release-b47 amd64
  • JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
  • Multimarkdown: 1.4.10 (Enhanced edition)

Expected result:

| マルチバイト |
|:-----------|
| Cell       |
| Alphabet   |
|:-----------|
| マルチバイト |

Actual result:

| マルチバイト |
|:-------|
| Cell   |
| Alphabet |
|:---------|
| マルチバイト   |

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:20 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
vschcommented, May 25, 2016

@cuiguojie, pre-releas EAP version with proper wrapping and table alignment based on character widths is now available: https://github.com/vsch/idea-multimarkdown/raw/master/dist/idea-multimarkdown.1.6.3.92.zip

Table column width matching is done +/- 1/2 space width of the display font, cumulative for the line.

Please let me know if you encounter any issues.

Here is the result of wrapping and formatting tables for source given below:

screen shot 2016-05-25 at 11 44 01 am

Source:

| マルチバイト |
|:-----------|
| Cell       |

| Alphabet   |
|:-----------|
| マルチバイト |

マルチバイト マルチバイト マルチバイト マルチバイト tests マルチバイト マルチバイト マルチバイト マルチバイト
マルチバイト マルチバイト

| 字段名   | 说明                         | 是否必须 | 备注    |
|---------|-----------------------------|---------|--------|
| status  | 状态码                       | 是       | String |
| result  | 内容主体                      | 否       | Object |
| message | 异常情况的错误信息,供显示给用户 | 否       | String |

异常情况的错误信息, mixed chars width wrapping mode test 供显示给用户 异常情况的错误信息 供显示给用户
异常情况的错误信息,供显示给用户 异常情况的错误信息,供显示给用户 异常情况的错误信息,供显示给用户
异常情况的错误信息,供显示给用户
0reactions
vschcommented, May 29, 2016

@cuiguojie, just verified and the IDE does generate typing handler calls when multiple characters are used for a word.

It was the plugin code that detected an unexpected difference between Psi and Document length that was skipping auto-format. I changed the code to allow negative difference caused by multi-char to single word changes when a character is typed to account for this condition.

https://github.com/vsch/idea-multimarkdown/raw/master/dist/idea-multimarkdown.1.6.3.102.zip

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wrap text in a cell - Microsoft Support
Microsoft Excel can wrap text so it appears on multiple lines in a cell. You can format the cell so the text wraps...
Read more >
nchar: Count the Number of Characters (or Bytes or Width)
The default for nchar() , NA , means to use keepNA = TRUE unless type is "width" . Details. The 'size' of a...
Read more >
Terminal prompt not wrapping correctly - Unix Stack Exchange
The prompt is believed to be 8 characters and not 1. As such if terminal window is 20 columns, after typing 12 characters,...
Read more >
Wrapping and breaking text - CSS: Cascading Style Sheets
This guide explains the various ways in which overflowing text can be managed in CSS.
Read more >
wordwrap - Manual - PHP
If the cut_long_words is set to true , the string is always wrapped at or before ... When false the function does not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found