Coder Social home page Coder Social logo

atom-paredit's People

Contributors

mme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

atom-paredit's Issues

Changes to TextEditor.onDidChange and TextBuffer.onDidChange coming in Atom 1.23

Hi! Thanks for maintaining the atom-paredit package!

In Atom v1.23, we will some changes that may affect your package.

The methods TextEditor.onDidChange and TextBuffer.onDidChange will now call their callbacks less frequently. Previously, these callbacks would get called once for each individual change to the buffer. So if you had 5 cursors and typed a character, they would get called 5 times. Now, they will only get called once, and the event that is passed to them will contain information about all 5 of the changes that have occurred.

The same properties that have always existed on the TextBuffer.onDidChange events (oldRange, newRange, oldText, and newText) will still be there, and they will now reflect the sum of all changes that have occurred. But now there will be an additional property called changes, which will contain an array of more fine-grained objects describing the individual changes. We encourage you to use this property instead of the old ones.

Effects on this package

It looks like this package calls the changed methods in the following places:

  • TextEditor.onDidChange

We found these calls using a regex search, so this list might be incomplete, and it might contain some false positives.

What to do about the change

It is likely that you do not need to do anything. The old event properties will continue to work.

However, you may be able to handle changes more accurately and efficiently by using the changes field of the events rather than the old properties. The changes field does not exist in Atom 1.22 unless you use the TextBuffer.onDidChangeText method. In Atom 1.23 and above though, .onDidChange and .onDidChangeText will become identical, having both the old properties and the new changes property.

Please let me know if you have any questions. I would be happy to help!

Uncaught TypeError: Cannot read property 'needsSync' of undefined

  1. Use paredit in REPL

Atom Version: 1.10.2
Electron Version: 0.37.8
System: "openSUSE Tumbleweed"
Thrown From: atom-paredit package, v0.2.0

Stack Trace

Uncaught TypeError: Cannot read property 'needsSync' of undefined

At /home/zilti/.atom/packages/atom-paredit/lib/atom-paredit.coffee:77

TypeError: Cannot read property 'needsSync' of undefined
    at Object.module.exports.Paredit.syncAST (/home/zilti/.atom/packages/atom-paredit/lib/atom-paredit.coffee:77:14)
    at Object.module.exports.Paredit.prepareForSourceTransform (/home/zilti/.atom/packages/atom-paredit/lib/atom-paredit.coffee:61:6)
    at Object.module.exports.Paredit.open (/home/zilti/.atom/packages/atom-paredit/lib/atom-paredit.coffee:228:13)
    at Object.module.exports.Paredit.openParens (/home/zilti/.atom/packages/atom-paredit/lib/atom-paredit.coffee:254:6)
    at atom-text-editor.subscriptions.add.atom.commands.add.paredit:openParens (/home/zilti/.atom/packages/atom-paredit/lib/atom-paredit.coffee:38:88)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:260:29)
    at /usr/share/atom/resources/app.asar/src/command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:580:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/usr/share/atom/resources/app.asar/src/window-event-handler.js:98:36)
    at HTMLDocument.<anonymous> (/usr/share/atom/resources/app.asar/src/window-event-handler.js:3:61)

Commands

  6x -0:21.7.0 paredit:openParens (atom-text-editor.editor.is-focused)
 23x -0:15.4.0 paredit:deleteBwd (atom-text-editor.editor.is-focused)
  5x -0:12.9.0 paredit:newLineAndIndent (atom-text-editor.editor.is-focused)
     -0:11.6.0 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -0:11.6.0 core:cancel (atom-text-editor.editor.is-focused)
     -0:11.5.0 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -0:11.5.0 core:cancel (atom-text-editor.editor.is-focused)
     -0:11.3.0 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -0:11.3.0 core:cancel (atom-text-editor.editor.is-focused)
     -0:11 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -0:11 core:cancel (atom-text-editor.editor.is-focused)
     -0:10.5.0 paredit:newLineAndIndent (atom-text-editor.editor.is-focused)
     -0:06.0 autocomplete-plus:cancel (atom-text-editor.editor.is-focused)
     -0:03.8.0 paredit:openParens (atom-text-editor.editor.is-focused)
     -0:02.4.0 autocomplete-plus:cancel (atom-text-editor.editor.is-focused)
  2x -0:00.6.0 paredit:openParens (atom-text-editor.editor.is-focused)

Config

{}

Installed Packages

# User
activate-power-mode, v1.0.2 (active)
atom-paredit, v0.2.0 (active)
atomic-emacs, v0.9.2 (active)
clojure-plus, v0.1.2 (active)
close-tags, v0.6.0 (inactive)
emmet, v2.4.3 (active)
ink, v0.5.3 (active)
linter, v1.11.18 (active)
linter-clojure, v1.1.2 (active)
linter-eastwood, v1.1.0 (active)
lisp-paredit, v0.5.4 (active)
moe-light, v0.2.0 (inactive)
proto-repl, v1.4.7 (active)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.52.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.44.0 (inactive)
base16-tomorrow-dark-theme, v1.1.0 (inactive)
base16-tomorrow-light-theme, v1.1.1 (inactive)
one-dark-ui, v1.5.0 (active)
one-light-ui, v1.5.0 (inactive)
one-dark-syntax, v1.3.0 (active)
one-light-syntax, v1.3.0 (inactive)
solarized-dark-syntax, v1.0.2 (inactive)
solarized-light-syntax, v1.0.2 (inactive)
about, v1.5.3 (active)
archive-view, v0.61.1 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.11.2 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.1 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (active)
background-tips, v0.26.1 (active)
bookmarks, v0.41.0 (active)
bracket-matcher, v0.82.1 (active)
command-palette, v0.38.0 (active)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.39.0 (active)
find-and-replace, v0.201.0 (active)
fuzzy-finder, v1.3.0 (active)
git-diff, v1.1.0 (active)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.1 (active)
image-view, v0.58.2 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.1 (inactive)
markdown-preview, v0.158.0 (active)
metrics, v0.53.1 (active)
notifications, v0.65.0 (active)
open-on-github, v1.2.0 (inactive)
package-generator, v1.0.0 (inactive)
settings-view, v0.242.2 (active)
snippets, v1.0.2 (active)
spell-check, v0.67.1 (active)
status-bar, v1.4.1 (active)
styleguide, v0.47.0 (active)
symbols-view, v0.113.0 (inactive)
tabs, v0.100.2 (active)
timecop, v0.33.2 (active)
tree-view, v0.208.2 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.34.0 (active)
whitespace, v0.33.0 (active)
wrap-guide, v0.38.1 (active)
language-c, v0.52.1 (active)
language-clojure, v0.21.0 (active)
language-coffee-script, v0.47.2 (active)
language-csharp, v0.12.1 (active)
language-css, v0.37.1 (active)
language-gfm, v0.88.0 (active)
language-git, v0.15.0 (active)
language-go, v0.42.1 (active)
language-html, v0.45.1 (active)
language-hyperlink, v0.16.0 (active)
language-java, v0.23.0 (active)
language-javascript, v0.119.0 (active)
language-json, v0.18.2 (active)
language-less, v0.29.5 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.35.0 (active)
language-php, v0.37.2 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.0 (active)
language-ruby, v0.69.0 (active)
language-ruby-on-rails, v0.25.0 (active)
language-sass, v0.56.0 (active)
language-shellscript, v0.22.4 (active)
language-source, v0.9.0 (active)
language-sql, v0.23.0 (active)
language-text, v0.7.1 (active)
language-todo, v0.28.0 (active)
language-toml, v0.18.0 (active)
language-xml, v0.34.9 (active)
language-yaml, v0.26.0 (active)

# Dev
No dev packages

Uncaught TypeError: Cannot read property 'length' of undefined

[Enter steps to reproduce below:]

While editing https://github.com/gmp26/funnelcljs/edit/master/src/funnel/core.cljs using atomic-chrome

  1. Place cursor between two defn calls e.g. line 16
  2. Press Ctrl left-arrow

Atom Version: 1.9.6
System: Mac OS X 10.11.6
Thrown From: atom-paredit package, v0.2.0

Stack Trace

Uncaught TypeError: Cannot read property 'length' of undefined

At /Users/gmp26/.atom/packages/atom-paredit/node_modules/paredit.js/lib/editor.js:279

TypeError: Cannot read property 'length' of undefined
    at Object.exports.editor.barfSexp (/Users/gmp26/.atom/packages/atom-paredit/node_modules/paredit.js/lib/editor.js:279:45)
    at Object.module.exports.Paredit.barfSexp (/Users/gmp26/.atom/packages/atom-paredit/lib/atom-paredit.coffee:408:32)
    at Object.module.exports.Paredit.barfSexpFwd (/Users/gmp26/.atom/packages/atom-paredit/lib/atom-paredit.coffee:416:6)
    at atom-text-editor.subscriptions.add.atom.commands.add.paredit:barfSexpFwd (/Users/gmp26/.atom/packages/atom-paredit/lib/atom-paredit.coffee:51:89)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260: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:580:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:98:36)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

Commands

     -2:21.7.0 paredit:slurpSexpBwd (atom-text-editor.editor.is-focused)
     -2:20.5.0 editor:move-to-beginning-of-word (atom-text-editor.editor.is-focused)
     -2:19 editor:move-to-end-of-word (atom-text-editor.editor.is-focused)
     -2:17.7.0 core:move-left (atom-text-editor.editor.is-focused)
     -2:16.7.0 paredit:barfSexpFwd (atom-text-editor.editor.is-focused)
  2x -2:06.1.0 core:move-right (atom-text-editor.editor.is-focused)
     -2:04.7.0 paredit:barfSexpFwd (atom-text-editor.editor.is-focused)
  9x -1:55.9.0 core:move-right (atom-text-editor.editor.is-focused)
     -1:54.2.0 paredit:slurpSexpFwd (atom-text-editor.editor.is-focused)
     -1:52.4.0 paredit:barfSexpFwd (atom-text-editor.editor.is-focused)
     -1:51.6.0 core:move-right (atom-text-editor.editor.is-focused)
     -1:51.2.0 paredit:slurpSexpFwd (atom-text-editor.editor.is-focused)
     -1:49.9.0 paredit:barfSexpFwd (atom-text-editor.editor.is-focused)
 13x -0:03.8.0 core:move-left (atom-text-editor.editor.is-focused)
     -0:01.4.0 core:move-down (atom-text-editor.editor.is-focused)
     -0:00.0 paredit:barfSexpFwd (atom-text-editor.editor.is-focused)

Config

{}

Installed Packages

# User
atom-paredit, v0.2.0 (active)
atomic-chrome, v0.3.0 (active)
git-time-machine, v1.5.3 (inactive)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.51.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.43.0 (inactive)
base16-tomorrow-dark-theme, v1.1.0 (inactive)
base16-tomorrow-light-theme, v1.1.1 (inactive)
one-dark-ui, v1.3.2 (active)
one-light-ui, v1.3.2 (inactive)
one-dark-syntax, v1.2.0 (active)
one-light-syntax, v1.2.0 (inactive)
solarized-dark-syntax, v1.0.2 (inactive)
solarized-light-syntax, v1.0.2 (inactive)
about, v1.5.2 (active)
archive-view, v0.61.1 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.11.1 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.0 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (active)
background-tips, v0.26.0 (active)
bookmarks, v0.41.0 (active)
bracket-matcher, v0.82.1 (active)
command-palette, v0.38.0 (inactive)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.38.3 (active)
fuzzy-finder, v1.3.0 (active)
git-diff, v1.1.0 (active)
find-and-replace, v0.198.0 (inactive)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.1 (active)
image-view, v0.58.0 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.1 (inactive)
markdown-preview, v0.158.0 (active)
metrics, v0.53.1 (active)
notifications, v0.64.1 (active)
open-on-github, v1.2.0 (inactive)
package-generator, v1.0.0 (inactive)
settings-view, v0.238.0 (active)
snippets, v1.0.2 (active)
spell-check, v0.67.1 (active)
status-bar, v1.4.1 (active)
styleguide, v0.46.0 (active)
symbols-view, v0.113.0 (inactive)
tabs, v0.98.0 (active)
timecop, v0.33.1 (active)
tree-view, v0.208.0 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.34.0 (active)
whitespace, v0.32.2 (active)
wrap-guide, v0.38.1 (active)
language-c, v0.52.1 (active)
language-clojure, v0.21.0 (active)
language-coffee-script, v0.47.0 (active)
language-csharp, v0.12.1 (active)
language-css, v0.36.2 (active)
language-gfm, v0.86.0 (active)
language-git, v0.13.0 (active)
language-go, v0.42.0 (active)
language-html, v0.44.1 (active)
language-hyperlink, v0.16.0 (active)
language-java, v0.22.0 (active)
language-javascript, v0.119.0 (active)
language-json, v0.18.0 (active)
language-less, v0.29.3 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.35.0 (active)
language-php, v0.37.0 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.0 (active)
language-ruby, v0.68.5 (active)
language-ruby-on-rails, v0.25.0 (active)
language-sass, v0.52.0 (active)
language-shellscript, v0.22.3 (active)
language-source, v0.9.0 (active)
language-sql, v0.21.1 (active)
language-text, v0.7.1 (active)
language-todo, v0.28.0 (active)
language-toml, v0.18.0 (active)
language-xml, v0.34.8 (active)
language-yaml, v0.26.0 (active)

# Dev
No dev packages

Uncaught TypeError: Cannot read property 'createCheckpoint' of undefined

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.14.0 ia32
Electron: 1.3.13
OS: Microsoft Windows 10 Home Insider Preview
Thrown From: atom-paredit package 0.2.0

Stack Trace

Uncaught TypeError: Cannot read property 'createCheckpoint' of undefined

At C:\Users\markaddleman\.atom\packages\atom-paredit\lib\atom-paredit.coffee:332

TypeError: Cannot read property 'createCheckpoint' of undefined
    at Object.killSexpBwd (/packages/atom-paredit/lib/atom-paredit.coffee:332:19)
    at /packages/atom-paredit/lib/atom-paredit.coffee:46:89)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:259:29)
    at /app.asar/src/command-registry.js:3:59
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:599:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:390:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/app.asar/src/window-event-handler.js:106:36)
    at /app.asar/src/window-event-handler.js:3:59)

Commands

  3x -1:58.9.0 paredit:closeParens (input.hidden-input)
     -1:56.4.0 core:save (input.hidden-input)
     -1:56 command-palette:toggle (input.hidden-input)
  3x -1:53.7.0 core:move-down (input.hidden-input)
     -1:53 core:confirm (input.hidden-input)
     -1:53 proto-repl:toggle (input.hidden-input)
  2x -1:50.3.0 autocomplete-plus:cancel (atom-text-editor.editor)
     -1:45.8.0 paredit:newLineAndIndent (input.hidden-input)
     -1:45.3.0 paredit:openParens (input.hidden-input)
     -1:43.4.0 editor:delete-to-beginning-of-word (input.hidden-input)
  2x -1:42.5.0 paredit:deleteBwd (input.hidden-input)
     -0:14.8.0 core:save (input.hidden-input)
     -0:12 autocomplete-plus:cancel (atom-text-editor.editor)
     -0:11.2.0 paredit:openParens (input.hidden-input)
     -0:09.3.0 paredit:killSexpBwd (input.hidden-input)
     -0:02.8.0 autocomplete-plus:cancel (atom-text-editor.editor.is-focused)

Non-Core Packages

atom-paredit 0.2.0 
highlight-selected 0.12.0 
ink 0.6.2 
language-lisp 0.2.0 
lisp-paredit 0.5.5 
Parinfer 1.17.0 
proto-repl 1.4.14 
proto-repl-charts 0.4.0 
proto-repl-sayid 0.1.4 
set-syntax 0.3.2 
tool-bar 1.0.1 

paredit:forwardSexp and paredit:backwardSexp skip current symbol boundry.

paredit:forwardSexp and paredit:backwardSexp don't stop at the beginning of the current symbol.

When I see ([] for the cursor}

(hello yo[]u)

and trigger backward sexp, I expect

(hello []you)

but I get

([]hello you)

Similarly with the cursor in the first word and not stopping at the end of the first word.

paredit:deleteFwd skips a character

Hitting the DEL key or pressing C-d does delete the character following the cursor, but then proceeds to skip one character after deleting.

So, for example, if the cursor is | and I start with something like (foo |bar) then hit DEL, I end up with (foo a|r).

I'm not familiar with how paredit works in emacs; is this the expected functionality, or am I correct in thinking this is an issue? I suppose I may also have another package that is colliding with paredit, although the only community packages I have installed are this one, minimap, and minimap-git-diff.

Anyway, I have overridden the DEL key in my keymap with core:delete for now. This means I lose paren balancing on deletion, though. Otherwise this package has been great!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.