t9md / atom-quick-highlight

Highlight text quickly
https://atom.io/packages/quick-highlight
MIT License
32 stars 7 forks source link

Uncaught TypeError: Cannot read property 'map' of null #7

Closed xbill82 closed 8 years ago

xbill82 commented 8 years ago

Hi guys, I just had this issue right after upgrading the plugin to 0.3.9

Atom Version: 1.3.2 System: Ubuntu 14.04.3 Thrown From: quick-highlight package, v0.3.9

Stack Trace

Uncaught TypeError: Cannot read property 'map' of null

At /home/lmarchesini/.atom/packages/quick-highlight/lib/main.coffee:105

TypeError: Cannot read property 'map' of null
    at getVisibleBufferRange (/home/lmarchesini/.atom/packages/quick-highlight/lib/main.coffee:105:40)
    at Object.module.exports.renderEditor (/home/lmarchesini/.atom/packages/quick-highlight/lib/main.coffee:221:19)
    at Object.module.exports.refreshEditor (/home/lmarchesini/.atom/packages/quick-highlight/lib/main.coffee:212:19)
    at /home/lmarchesini/.atom/packages/quick-highlight/lib/main.coffee:156:26
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:86:11)
    at /usr/share/atom/resources/app.asar/src/text-editor-element.js:113:47
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:86:11)
    at TextEditorPresenter.module.exports.TextEditorPresenter.updateScrollTop (/usr/share/atom/resources/app.asar/src/text-editor-presenter.js:1024:29)
    at TextEditorPresenter.module.exports.TextEditorPresenter.restoreScrollTopIfNeeded (/usr/share/atom/resources/app.asar/src/text-editor-presenter.js:1940:21)
    at TextEditorPresenter.module.exports.TextEditorPresenter.setLineHeight (/usr/share/atom/resources/app.asar/src/text-editor-presenter.js:1411:14)
    at LinesComponent.module.exports.LinesComponent.measureLineHeightAndDefaultCharWidth (/usr/share/atom/resources/app.asar/src/lines-component.js:136:22)
    at TextEditorComponent.module.exports.TextEditorComponent.measureLineHeightAndDefaultCharWidth (/usr/share/atom/resources/app.asar/src/text-editor-component.js:1002:36)
    at TextEditorComponent.module.exports.TextEditorComponent.sampleFontStyling (/usr/share/atom/resources/app.asar/src/text-editor-component.js:983:14)
    at TextEditorComponent.sampleFontStyling (/usr/share/atom/resources/app.asar/src/text-editor-component.js:3:61)
    at TextEditorComponent.module.exports.TextEditorComponent.becameVisible (/usr/share/atom/resources/app.asar/src/text-editor-component.js:267:12)
    at TextEditorComponent.module.exports.TextEditorComponent.checkForVisibilityChange (/usr/share/atom/resources/app.asar/src/text-editor-component.js:933:16)
    at atom-text-editor.TextEditorElement.attachedCallback (/usr/share/atom/resources/app.asar/src/text-editor-element.js:95:22)
    at atom-pane.PaneElement.activeItemChanged (/usr/share/atom/resources/app.asar/src/pane-element.js:138:24)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:86:11)
    at Pane.module.exports.Pane.setActiveItem (/usr/share/atom/resources/app.asar/src/pane.js:248:22)
    at Pane.module.exports.Pane.activateItem (/usr/share/atom/resources/app.asar/src/pane.js:316:21)
    at atom-tabs.TabBarView.onMouseDown (/usr/share/atom/resources/app.asar/node_modules/tabs/lib/tab-bar-view.js:670:19)

Commands

     -0:18.5.0 settings-view:check-for-package-updates (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)

Config

{
  "core": {},
  "quick-highlight": {}
}

Installed Packages

# User
language-gherkin, v1.0.3
quick-highlight, v0.3.9
react, v0.12.10

# Dev
No dev packages
t9md commented 8 years ago

from what version to v0.3.9?

xbill82 commented 8 years ago

0.3.2

Il giorno mar 29 dic 2015 alle 09:48 t9md notifications@github.com ha scritto:

from what version to v0.3.9?

— Reply to this email directly or view it on GitHub https://github.com/t9md/atom-quick-highlight/issues/7#issuecomment-167749167 .

t9md commented 8 years ago

What atom version? Is this issue only happened in upgrade? or you cannot use quick-highlight any more?

xbill82 commented 8 years ago

I previously installed the package on atom 1.0.2 and it simply didn't work. Then I upgraded Atom to 1.3.2, so I also upgraded the package to 0.3.9 and the issue appeared. So, no, I was never able to use the package.

t9md commented 8 years ago

After I investigated, I have an idea, I will release patched version in a minutes, please try and let me know the result.

t9md commented 8 years ago

Released as v0.3.10. Hope this fix your issue.

Please report me the result

xbill82 commented 8 years ago

Hey, great, thanks a lot, it works now! I updated and had to restart the editor but now the highlight is ok. I still don't see the count on the status bar.

t9md commented 8 years ago

How about changing setting of displayCountOnStatusBar, countDisplayPosition, countDisplayPriority, countDisplayStyles(optional) from setting-view?

xbill82 commented 8 years ago

ok, what values shoud I put?

t9md commented 8 years ago

I don't know. Change value and check the result was change. e.g. set countDisplayPosition from defult Left to Right.

xbill82 commented 8 years ago

No, nothing changes. But this should be discussed in another issue, right?

t9md commented 8 years ago

Yes, please.