Wikunia / brackets-FuncDocr

FuncDocr generates JS/PHPDoc annotations for your functions
101 stars 14 forks source link

Greedy backspace behavior #74

Closed petetnt closed 8 years ago

petetnt commented 8 years ago

I really like the extension, but something (that's mostly because of code writing habits) I run often with is the greedy backspace behavior.

Consider something like this:

  1. You have something you want to annotate
somethingYouWantToAnnotate(arg1, arg2)
  1. You go above the thing and create new annotation block (with CTRL+ALT+D or inserting /** and pressing enter. [[Description]] is selected.
/**
 * [[Description]]
 * @param {[[Type]]} arg1 [[Description]]
 * @param {[[Type]]} arg2 [[Description]]
 */
somethingYouWantToAnnotate(arg1, arg2)
  1. I press backspace and end up with this:
/**
 * @param {[[Type]]} arg1 [[Description]]
 * @param {[[Type]]} arg2 [[Description]]
 */
somethingYouWantToAnnotate(arg1, arg2)

I know what that you could just start writing the description and everything would be swell, but something is hardwired to my brain that I always press backspace first.

Similar thing happens when you start the description wrong and backspace back

/**
 * PI Want to des
 * @param {[[Type]]} arg1 [[Description]]
 * @param {[[Type]]} arg2 [[Description]]
 */
somethingYouWantToAnnotate(arg1, arg2)

You notice the before I and backspace back and end up again with this:

/**
 * @param {[[Type]]} arg1 [[Description]]
 * @param {[[Type]]} arg2 [[Description]]
 */
somethingYouWantToAnnotate(arg1, arg2)

What I would like is the current behavior, but one letter later: basically the keystoke that would remove the whitespace between * and whatever is after it.

Wikunia commented 8 years ago

Thanks for the issue. So there are two different issues, right?

  1. The backspace on [[TAGS]]
  2. removing something and the entire line is removed?

Actually the second issue doesn't happen on my machine.

/**
 * AIbcas
 * @author Ole Kröger
 */
$scope.getAllVersion=function(){

}

where I should be the cursor. ;)

backspace ->

/**
 * Ibcas
 * @author Ole Kröger
 */
$scope.getAllVersion=function(){

}
petetnt commented 8 years ago

Sorry I explained that bit badly, I meant backspacing through the whole line, I just meant it as other case where deleting things can accidentally lead to removing the whole line, when you just wanted to start the line from scratch

Wikunia commented 8 years ago

Ah okay thanks! Yeah I have that problem as well, but now I'll fix that! Thanks again and have a nice weekend @petetnt

petetnt commented 8 years ago

Awesome! Thanks Wikunia ja have a nice weekend too! :beers:

Wikunia commented 8 years ago

Maybe you wanna try "Install from Url" before I register the new version ;)

petetnt commented 8 years ago

@Wikunia installed from the repo and the fix is just what I wanted :+1: