Skip to content

Leading whitespace is culled in docblocks #20

Closed
Drarok opened this Issue Jan 2, 2012 · 1 comment

3 participants

@Drarok
Drarok commented Jan 2, 2012

Leading whitespace inside a docblock is removed when the first asterisk is entered, so the following would be hard-aligned to the left:

/**
 * Test
 */

(There should be a leading space on lines 2 and 3).

I recorded an example of this problem, showing TM1's behaviour, then TM2's: http://drarok.com/files/TextMate%202%20Leading%20Spaces.mov

@gdsmith
gdsmith commented Jan 6, 2012

I fixed this by changing the "Wrap docblock..." action to the following

col = ENV['TM_COLUMN_NUMBER'].to_i
start_col = ENV['TM_CURRENT_LINE'].index('*')
if col >= 80
  puts
  print ENV['TM_CURRENT_LINE'][0, start_col] + "*" # this is the changed line
end
print " "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.