Skip to content

Tab is 4 space,charcode is 160,but charcode of space bar is 32 #3273

Closed

Description

@morecup

Question description

tab键会生成4个code为160的空格,但一般来说是code为32的空格
The tab key will generate four spaces with code 160, but generally it is a space with code 32
source code location:

ContentState.prototype.insertTab = function () {
    const tabSize = this.tabSize
    const tabCharacter = String.fromCharCode(160).repeat(tabSize)

  }

我想知道160的作用是什么,这是一个bug吗?
I want to know what the function of 160 is. Is this a bug?

Activity

  1. added a commit that references this issue on May 23, 2022
    0964538
  2. added
    🐛 bug
    🪲 pri/major
    :octocat: code block
    on May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🪲 pri/major:octocat: code block🐛 bug🔭 area/editor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions