Open thypon opened 7 years ago
This happens constantly to me while typing, pausing, and typing again.
Edit2: I edited activate-power-mode/lib/candas-renderer.coffee around line 96, adding the not and null checks below, and the problem persists but seemingly less often. That could totally be the placebo effect, but I'll keep it here in case it helps someone else
calculatePositions: (screenPosition) ->
if not @screenPosition
return
if @screenPosition == null
return
{left, top} = @editorElement.pixelPositionForScreenPosition screenPosition
Does anyone have an idea of what's causing these random null screenPositions?
@lexcast you should check this.
Is there a way to reproduce this? I'm using git plus to trying to reproduce with not luck.
[Enter steps to reproduce:]
Atom: 1.19.0 x64 Electron: 1.6.9 OS: Mac OS X 10.11.6 Thrown From: activate-power-mode package 2.0.0
Uncaught TypeError: Cannot read property 'pixelPositionForScreenPosition' of null
At /Users/pratap/.atom/packages/activate-power-mode/lib/canvas-renderer.coffee:96
TypeError: Cannot read property 'pixelPositionForScreenPosition' of null
at Object.calculatePositions (/packages/activate-power-mode/lib/canvas-renderer.coffee:96:33)
at Object.spawn (/packages/activate-power-mode/lib/canvas-renderer.coffee:77:17)
at invokeFunc (/packages/activate-power-mode/node_modules/lodash.throttle/index.js:160:19)
at leadingEdge (/packages/activate-power-mode/node_modules/lodash.throttle/index.js:170:22)
at /packages/activate-power-mode/node_modules/lodash.throttle/index.js:235:16)
at Object.onInput (/packages/activate-power-mode/lib/plugin/power-canvas.coffee:21:12)
at /packages/activate-power-mode/lib/plugin-manager.coffee:103:16
at Object.onEnabled (/packages/activate-power-mode/lib/plugin-registry.coffee:64:19)
at Object.runOnInput (/packages/activate-power-mode/lib/plugin-manager.coffee:100:21)
at /packages/activate-power-mode/lib/power-editor.coffee:54:22
-5:21.2.0 editor:consolidate-selections (input.hidden-input)
-5:21.2.0 core:cancel (input.hidden-input)
3x -5:20.6.0 core:save (input.hidden-input)
3x -4:03.2.0 core:backspace (input.hidden-input)
4x -4:01.7.0 core:save (input.hidden-input)
-3:53 grammar-selector:show (atom-text-editor.editor.is-focused)
2x -3:50.6.0 core:save (input.hidden-input)
-3:49.5.0 editor:newline (input.hidden-input)
-3:48.6.0 core:undo (input.hidden-input)
5x -3:48.3.0 core:save (input.hidden-input)
3x -2:21.5.0 core:backspace (input.hidden-input)
3x -2:20.4.0 core:save (input.hidden-input)
3x -0:44.7.0 core:backspace (input.hidden-input)
-0:43.1.0 core:save (input.hidden-input)
3x -0:37.1.0 core:backspace (input.hidden-input)
2x -0:36 core:save (input.hidden-input)
activate-power-mode 2.0.0
atom-beautify 0.30.4
atom-material-syntax 1.0.2
atom-material-ui 1.3.9
auto-indent 0.5.0
autocomplete-python 1.9.1
gtk-dark-theme 0.1.4
seti-ui 1.4.0
Sids-Syntax-Theme 1.0.0
@PratapDafedar Try to update to the latest release which is activate-power-mode: 2.2.0.
Also read these comment for more info.
I put in some tracing logging calls and I get this error when input tries to .spawn
because of input, but the canvas has already been destroyed.
canvas-render destroy called
at Object.destroy (activate-power-mode/lib/canvas-renderer.coffee:44:36)
at Object.disable (activate-power-mode/lib/plugin/power-canvas.coffee:15:13)
at activate-power-mode/lib/plugin-manager.coffee:82:32
at Object.onEnabled (activate-power-mode/lib/plugin-registry.coffee:92:19)
at Object.disable (activate-power-mode/lib/plugin-manager.coffee:81:21)
at Object.disable (activate-power-mode/lib/power-editor.coffee:17:20)
at automate-power-mode/lib/automate-power-mode.js:46:28
canvas-renderer spawn called when editor is null
at Object.spawn (activate-power-mode/lib/canvas-renderer.coffee:93:39)
at invokeFunc (C:\Users\Luke\.atom\packages\activate-power-mode\node_modules\lodash.throttle\index.js:160:19)
at leadingEdge (C:\Users\Luke\.atom\packages\activate-power-mode\node_modules\lodash.throttle\index.js:170:22)
at Cursor.debounced [as spawn] (C:\Users\Luke\.atom\packages\activate-power-mode\node_modules\lodash.throttle\index.js:235:16)
at Object.onInput (activate-power-mode/lib/plugin/power-canvas.coffee:27:12)
at activate-power-mode/lib/plugin-manager.coffee:107:16
at Object.onEnabled (activate-power-mode/lib/plugin-registry.coffee:92:19)
at Object.runOnInput (activate-power-mode/lib/plugin-manager.coffee:104:21)
at activate-power-mode/lib/power-editor.coffee:55:24
canvas-renderer.coffee:113 Uncaught TypeError: Cannot read property 'pixelPositionForScreenPosition' of null
I'm not certain why it would get disabled -- I suspect autocomplete, ide-typescript, or the linter package could trigger a disable. Or it could just be a race condition between the interval for disabling because the change threshold isn't exceeded, but input handler is still in place. Regardless, I created a pull which will just silently avoid triggering the error: https://github.com/JoelBesada/activate-power-mode/pull/327
If you use automate-power-mode, which turns powermode on and off on the fly... this problem still occurs reliably... as it gets disabled and enabled often
Whenever I hit Commit or Push with Git Plus plugin the following exception is raised.
Atom: 1.17.2 x64 Electron: 1.3.15 OS: "Void Linux" Thrown From: activate-power-mode package 2.0.0
Stack Trace
Uncaught TypeError: Cannot read property 'pixelPositionForScreenPosition' of null
Commands
Non-Core Packages