ajaxorg / ajaxorg/ace

Uncaught TypeError: Cannot read properties of null (reading 'splice')

未關閉
#5,277 6 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug needs-reproduction-steps no-autoclose p2 response-requested
主要語言
JavaScript
星號
27.1k
分支
5.3k
PR 合併指標
30 天內沒有已合併 PR

描述

### Describe the bug

Using ace-build NPM package - Version 1.16.0

Use case 1 :

```
Uncaught TypeError: Cannot read properties of null (reading 'splice')
at d.updateFoldWidgets (ace.js:1:147561)
at r._signal (ace.js:1:12681)
at d.onChange (ace.js:1:157237)
at r._signal (ace.js:1:12681)
at a.applyDelta (ace.js:1:123862)
at a.insertMergedLines (ace.js:1:122174)
at a.insert (ace.js:1:121014)
at d.insert (ace.js:1:165721)
at S.insert (ace.js:1:232021)
at Object.exec (ace.js:1:205853)
```

and

```
ace.js:1 Uncaught TypeError: Cannot set properties of null (setting '0')
at d.updateFoldWidgets (ace.js:1:147438)
at r._signal (ace.js:1:12681)
at d.onChange (ace.js:1:157237)
at r._signal (ace.js:1:12681)
at a.applyDelta (ace.js:1:123862)
at a.insertMergedLines (ace.js:1:122174)
at a.insert (ace.js:1:121014)
at d.insert (ace.js:1:165721)
at S.insert (ace.js:1:232021)
at Object.exec (ace.js:1:205853)
```

Whenever I try to delete a whole document and enter a new character, it gets printed twice and the above error displayed in console.

Use case 2 :

```
Uncaught TypeError: Cannot read properties of null (reading 'splice')
at e.updateFoldWidgets (ace.js:1:159940)
at r._signal (ace.js:1:12681)
at e.onChange (ace.js:1:169827)
at r._signal (ace.js:1:12681)
at e.applyDelta (ace.js:1:135373)
at e.remove (ace.js:1:133834)
at e.remove (ace.js:1:178455)
at Object.exec (ace.js:1:215613)
at ace.js:1:203425
at r._emit.r._dispatchEvent (ace.js:1:12555)
```

Whenever I try to cut the code, the last two lines of the code gets copied to clipboard whereas other lines were gone and the above error displayed in console.

A help would be seriously appreciable as I struck in this for weeks and couldn't figure out what went wrong here.


### Expected Behavior

Use case 1 :
No double character printing should happen.

Use case 2 :
Cut operation should happen flawlessly.

### Current Behavior

Use case 1 :
Whenever I try to delete a whole document and enter a new character, it gets printed twice and the above error displayed in console.

Use case 2 :
Whenever I try to cut the code, the last two lines of the code gets copied to clipboard whereas other lines were gone and the above error displayed in console.

### Reproduction Steps

Use case 1 :
Whenever I try to delete a whole document and enter a new character, it gets printed twice and the above error displayed in console.

Use case 2 :
Whenever I try to cut the code, the last two lines of the code gets copied to clipboard whereas other lines were gone and the above error displayed in console.

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### Ace Version / Browser / OS / Keyboard layout

ace : 1.16.0, macos 12.6.5, Chrome 115.0.5790.114

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。