craig-o/atom-jsdoc — pull request #10 by pandaiolo (2014-10-31 16:11:58+00:00)
Title: Fix newline comment continuation behaviour

Here are a few fixes/improvements :

1) I noticed that Atom now seem to add the newline **after** firing the `editor:newline` event. Not sure if its related to my platform (OSX yosemite)

So instead of having this :

// Commenting blablabla then newline
// <-- cursor now here

Here is the current behaviour :

// Commenting blablabla then newline// <-- useless comment added here
<-- cursor now here, uncommented

I fixed this by wrapping the comments characters insertion in a` setTimeout`, and removing the currentRow - 1 because when called, the function is still on the previous row

2) Add a firstBlockComment regexp to deal with first comment line

Without fix :

/**
* <-- missing one leading space

3) Add a `[^\/]` to the blockComent regexps so when pressing enter after an already-closed comment, it does not continue

Without fix :

/**
* Comment
*/ <--- pressing enter here
* <-- comment unexpectedly continued
4) Used `getLine` function to optimize code