Closed iouAkira closed 2 years ago
The error is on a line that reads:
this.lines = new Array( this.editor.buffer.lines.length );
What was in your window/selection at the time of invocation? How do I reproduce the error?
Basically it says that the editors buffer doesn't contain any lines.
iam getting the same error after updating atom from 1.18.0 to 1.20.0
in my freshly opened editor window was one file from the last session open. content of this file:
<!DOCTYPE html>
<html>
<head>
<title>19:08</title>
</head>
<body>
XYZ
</body>
</html>
i had all selected.
same error with a newly opened other file (tested with another random html file and an svg file)
Atom: 1.20.0 x64 Electron: 1.6.9 OS: Ubuntu 17.04 Thrown From: copy-with-style package 1.1.0
Uncaught TypeError: Cannot read property 'length' of undefined
At /home/stefan/.atom/packages/copy-with-style/lib/atom_editor.js:21
TypeError: Cannot read property 'length' of undefined
at /packages/copy-with-style/lib/atom_editor.js:21:53)
at HTMLgenerator.generate (/packages/copy-with-style/lib/html_generator.js:58:5)
at Object.copy (/packages/copy-with-style/lib/main.js:58:68)
at HTMLElement.copyWithStylePreset1 (/packages/copy-with-style/lib/main.js:19:45)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:265:35)
at /usr/share/atom/resources/app/src/command-registry.js:3:65
at Object.didConfirmSelection (/usr/share/atom/resources/app/node_modules/command-palette/lib/command-palette-view.js:106:35)
at SelectListView.confirmSelection (/usr/share/atom/resources/app/node_modules/atom-select-list/src/select-list-view.js:313:26)
at HTMLDivElement.core:confirm (/usr/share/atom/resources/app/node_modules/atom-select-list/src/select-list-view.js:81:20)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:265:35)
at /usr/share/atom/resources/app/src/command-registry.js:3:65
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/usr/share/atom/resources/app/src/window-event-handler.js:100:42)
at HTMLDocument.<anonymous> (/usr/share/atom/resources/app/src/window-event-handler.js:3:65)
-2:51.1.0 editor:move-to-first-character-of-line (input.hidden-input)
-2:50.4.0 editor:select-to-end-of-word (input.hidden-input)
-2:49.8.0 core:backspace (input.hidden-input)
-2:12.2.0 intentions:highlight (input.hidden-input)
-2:12.1.0 core:save (input.hidden-input)
-1:40.5.0 copy-with-style:copy (span.syntax--text.syntax--html.syntax--basic)
-1:23.6.0 intentions:highlight (input.hidden-input)
-1:23.5.0 core:select-all (input.hidden-input)
-1:13.6.0 intentions:highlight (input.hidden-input)
-1:13.4.0 core:select-all (input.hidden-input)
-1:07.8.0 intentions:highlight (input.hidden-input)
-1:07.6.0 command-palette:toggle (input.hidden-input)
3x -1:05.6.0 core:move-down (input.hidden-input)
-1:04.8.0 core:move-up (input.hidden-input)
-1:03.9.0 core:confirm (input.hidden-input)
-1:03.9.0 copy-with-style:preset1 (input.hidden-input)
busy-signal 1.4.3
copy-with-style 1.1.0
fold-functions 0.5.0
hey-pane 1.0.0
highlight-selected 0.13.1
intentions 1.1.5
language-arduino 0.4.3
language-latex 1.1.1
language-pcb 1.0.1
language-restructuredtext 1.1.0
language-svg 0.9.2
linter 2.2.0
linter-eslint 8.2.1
linter-gcc 0.7.1
linter-jsonlint 1.3.0
linter-markdown 5.2.0
linter-pylama 0.9.4
linter-shellcheck 1.4.6
linter-spell 0.15.0
linter-spell-html 0.7.0
linter-spell-javascript 0.8.0
linter-spell-project 0.2.0
linter-spell-shellscript 0.2.0
linter-stylelint 4.0.2
linter-tidy 2.3.1
linter-ui-default 1.6.8
linter-xmllint 1.4.3
markdown-pdf 2.1.0
markdown-scroll-sync 2.1.2
markdown-toc 0.4.2
like this?
@akyakya for me its the same behavior as in your 'video'
I get this too on Mac - happens with at least Javascript and Python code. For those who also have this? Is it on every file and type of selection?
Go to the settings of the add-on, and click "View code".
Go to the lib -> atom_editor.js file
Change line 21 to this.lines = new Array( this.editor.buffer.getLines().length );
Save the file
Close all your Atom windows and re-open them.
This will fix the .length() issue but now there is another issue with "onDidUpdateState" being called on null because "component.presenter" on line 58 of the atom_editor.js file is deprecated and so presenter is undefined, thus presenter.onDidUpdateState() will not work.
I have the same problem
[Enter steps to reproduce:]
Atom: 1.19.0 x64 Electron: 1.6.9 OS: Unknown Windows version Thrown From: copy-with-style package 1.1.0
Stack Trace
Uncaught TypeError: Cannot read property 'length' of undefined
Commands
Non-Core Packages