gangstead / atom-incremental-search

Incremental search for the Atom editor
MIT License
16 stars 13 forks source link

Uncaught TypeError: this.editSession.getSelection is not a function #43

Closed photex closed 8 years ago

photex commented 9 years ago

[Enter steps to reproduce below:]

  1. install the package
  2. test search (works)
  3. cancel/close search

Atom Version: 1.0.15 System: Mac OS X 10.10.5 Thrown From: incremental-search package, v5.0.1

Stack Trace

Uncaught TypeError: this.editSession.getSelection is not a function

At /Users/ccollier/.atom/packages/incremental-search/lib/search-model.coffee:226

TypeError: this.editSession.getSelection is not a function
  at SearchModel.module.exports.SearchModel.findMarkerForward (/Users/ccollier/.atom/packages/incremental-search/lib/search-model.coffee:226:77)
  at SearchModel.module.exports.SearchModel.moveToClosestResult (/Users/ccollier/.atom/packages/incremental-search/lib/search-model.coffee:211:52)
  at SearchModel.module.exports.SearchModel.updateMarkers (/Users/ccollier/.atom/packages/incremental-search/lib/search-model.coffee:200:6)
  at /Users/ccollier/.atom/packages/incremental-search/lib/search-model.coffee:84:10
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1271:25

Commands

     -2:21.8.0 core:confirm (atom-text-editor.editor.mini.is-focused)
 23x -2:06.6.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -0:31.3.0 editor:newline (atom-text-editor.editor.is-focused)
     -0:31 core:paste (atom-text-editor.editor.is-focused)
     -0:27.2.0 core:save (atom-text-editor.editor.is-focused)
  3x -0:26.2.0 incremental-search:backward (atom-text-editor.editor.is-focused)
  3x -0:16.4.0 incremental-search:forward (atom-text-editor.editor.mini.is-focused)
     -0:15.4.0 core:move-up (atom-text-editor.editor.mini.is-focused)
     -0:15.1.0 core:move-down (atom-text-editor.editor.mini.is-focused)
     -0:15 core:move-up (atom-text-editor.editor.mini.is-focused)
     -0:14.9.0 core:move-down (atom-text-editor.editor.mini.is-focused)
     -0:14.8.0 core:move-up (atom-text-editor.editor.mini.is-focused)
     -0:14.5.0 core:cancel (atom-text-editor.editor.mini.is-focused)
     -0:04.6.0 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -0:04.6.0 core:cancel (atom-text-editor.editor.is-focused)
     -0:01.7.0 editor:newline (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "openEmptyEditorOnStart": false,
    "projectHome": "/projects",
    "themes": [
      "base-16-ocean-dark-ui-theme",
      "base16-ocean-dark-spacegray"
    ]
  }
}

Installed Packages

# User
advanced-open-file, v0.10.0
atom-yeoman, v0.3.13
atomic-emacs, v0.7.3
autocomplete-glsl, v0.2.3
autocomplete-python, v0.5.3
base-16-ocean-dark-ui-theme, v1.5.1
base16-ocean-dark-spacegray, v0.12.0
build, v0.46.0
build-cargo, v0.2.0
build-gradle, v0.2.0
build-make, v0.2.1
expand-region, v0.2.3
incremental-search, v5.0.1
ionide-fake, v1.0.3
ionide-fsharp, v1.1.1
ionide-fsi, v1.0.4
ionide-installer, v1.2.1
ionide-paket, v2.0.7
ionide-yeoman, v1.0.1
language-cmake, v0.1.4
language-rust, v0.4.5
linter, v1.6.0
racer, v0.17.2

# Dev
No dev packages
tujoworker commented 9 years ago

I have the same issue. Any solution/progress?

atombender commented 9 years ago

Having same issue, but different error. Hitting cmd-I and then esc gives me Uncaught TypeError: this.editSession.getBuffer(...).off is not a function:

TypeError: this.editSession.getBuffer(...).off is not a function
  at SearchModel.module.exports.SearchModel.cleanup (/Users/alex/.atom/packages/incremental-search/lib/search-model.coffee:168:32)
  at SearchModel.module.exports.SearchModel.cancelSearch (/Users/alex/.atom/packages/incremental-search/lib/search-model.coffee:151:6)
  at InputView.module.exports.InputView.cancelSearch (/Users/alex/.atom/packages/incremental-search/lib/input-view.coffee:147:18)
  at space-pen-div.subscriptions.add.atom.commands.add.core:cancel (/Users/alex/.atom/packages/incremental-search/lib/input-view.coffee:37:26)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:245:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:524:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:347:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:184:20)
vtintillier commented 9 years ago

Same as @atombender here on Windows

galori commented 9 years ago

Same issue on a mac. Just installed atom yesterday and this package today. I miss incremental search from Textmate.

/Users/gal/.atom/packages/incremental-search/lib/search-model.coffee:168
Hide Stack Trace
TypeError: this.editSession.getBuffer(...).off is not a function
  at SearchModel.module.exports.SearchModel.cleanup (/Users/gal/.atom/packages/incremental-search/lib/search-model.coffee:168:32)
  at SearchModel.module.exports.SearchModel.cancelSearch (/Users/gal/.atom/packages/incremental-search/lib/search-model.coffee:151:6)
  at InputView.module.exports.InputView.cancelSearch (/Users/gal/.atom/packages/incremental-search/lib/input-view.coffee:147:18)
  at space-pen-div.subscriptions.add.atom.commands.add.core:cancel (/Users/gal/.atom/packages/incremental-search/lib/input-view.coffee:37:26)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:245:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:524:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:347:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:184:20)

After restarting and trying again, I get this:

/Users/gal/.atom/packages/incremental-search/lib/search-model.coffee:226
Hide Stack Trace
TypeError: this.editSession.getSelection is not a function
    at SearchModel.module.exports.SearchModel.findMarkerForward (/Users/gal/.atom/packages/incremental-search/lib/search-model.coffee:226:77)
    at SearchModel.module.exports.SearchModel.moveToClosestResult (/Users/gal/.atom/packages/incremental-search/lib/search-model.coffee:211:52)
    at SearchModel.module.exports.SearchModel.updateMarkers (/Users/gal/.atom/packages/incremental-search/lib/search-model.coffee:200:6)
    at SearchModel.module.exports.SearchModel.update (/Users/gal/.atom/packages/incremental-search/lib/search-model.coffee:273:8)
    at InputView.module.exports.InputView.updateSearchText (/Users/gal/.atom/packages/incremental-search/lib/input-view.coffee:85:18)
    at /Users/gal/.atom/packages/incremental-search/lib/input-view.coffee:30:50
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1273:25

BTW this one seems to work fine:

https://github.com/t9md/atom-isearch

kerrizor commented 8 years ago

Same issue here as well.

gangstead commented 8 years ago

@galori @atombender the getBuffer.off is not a function I think I was able to fix. Please try again with v5.0.3

gangstead commented 8 years ago

I think I fixed it, if it's still happening please reopen the issue.