Skip to content

Commit

Permalink
atom-parinfer's initial Paren Mode check of the file unearthed this b…
Browse files Browse the repository at this point in the history
…ug that I probably would have never found. Parinfer is amazing :)
  • Loading branch information
oakmac committed Nov 13, 2015
1 parent 55ecfdc commit d4b49ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/atom-parinfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22495,7 +22495,7 @@ atom_parinfer.core.hello_editor = function(a) {
cljs.core.swap_BANG_.call(null, atom_parinfer.core.editor_states, cljs.core.assoc, b, new cljs.core.Keyword(null, "disabled", "disabled", -1529784218));
a.onDidChangeSelectionRange(atom_parinfer.core.debounced_apply_parinfer);
a.onDidDestroy(atom_parinfer.core.goodbye_editor);
return cljs.core.truth_(c) ? (c = a.getText(), c = parinfer.paren_mode.format_text.call(null, c), cljs.core.truth_((new cljs.core.Keyword(null, "valid?", "valid?", -212412379)).cljs$core$IFn$_invoke$arity$1(c)) && a.setText((new cljs.core.Keyword(null, "text", "text", -1790561697)).cljs$core$IFn$_invoke$arity$1(c)), cljs.core.swap_BANG_.call(null, atom_parinfer.core.editor_states, cljs.core.assoc, b, new cljs.core.Keyword(null, "indent-mode", "indent-mode", 1737814542))) : null;
return cljs.core.truth_(c) && (c = a.getText(), c = parinfer.paren_mode.format_text.call(null, c), cljs.core.truth_((new cljs.core.Keyword(null, "valid?", "valid?", -212412379)).cljs$core$IFn$_invoke$arity$1(c))) ? (a.setText((new cljs.core.Keyword(null, "text", "text", -1790561697)).cljs$core$IFn$_invoke$arity$1(c)), cljs.core.swap_BANG_.call(null, atom_parinfer.core.editor_states, cljs.core.assoc, b, new cljs.core.Keyword(null, "indent-mode", "indent-mode", 1737814542))) : null;
};
atom_parinfer.core.pane_changed = function(a) {
return cljs.core.swap_BANG_.call(null, atom_parinfer.core.editor_states, cljs.core.identity);
Expand Down
4 changes: 2 additions & 2 deletions src-cljs/atom_parinfer/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@
(let [current-text (.getText editor)
result (paren-mode/format-text current-text)]
(when (:valid? result)
(.setText editor (:text result)))
(swap! editor-states assoc editor-id :indent-mode)))))
(.setText editor (:text result))
(swap! editor-states assoc editor-id :indent-mode))))))

(defn- pane-changed
"Runs when the user changes their pane focus.
Expand Down

4 comments on commit d4b49ec

@shaunlebron
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow, that's scary!

@oakmac
Copy link
Owner Author

@oakmac oakmac commented on d4b49ec Nov 13, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still amazed at the fact that Parinfer caught it. I was testing applying Paren Mode when you first load a file. When I realized what had happened I was so floored.

@shaunlebron
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting. indent mode fixed the paren, but if you applied paren mode, it would've dedented that last line.

@oakmac
Copy link
Owner Author

@oakmac oakmac commented on d4b49ec Nov 13, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote that line in SublimeText not using Parinfer.

Please sign in to comment.