Add LanguageMode::toggleLineCommentForBufferRow for toggling single rows

This commit is contained in:
Nathan Sobo 2014-01-20 11:14:27 -07:00
parent ed93695d64
commit 3eb7c9d767
2 changed files with 5 additions and 2 deletions

View File

@ -51,8 +51,8 @@ class Editor extends Model
@delegatesMethods 'foldAll', 'unfoldAll', 'foldAllAtIndentLevel', 'foldBufferRow',
'unfoldBufferRow', 'suggestedIndentForBufferRow', 'autoIndentBufferRow', 'autoIndentBufferRows',
'autoDecreaseIndentForBufferRow', 'toggleLineCommentsForBufferRows', 'isFoldableAtBufferRow',
toProperty: 'languageMode'
'autoDecreaseIndentForBufferRow', 'toggleLineCommentForBufferRow', 'toggleLineCommentsForBufferRows',
'isFoldableAtBufferRow', toProperty: 'languageMode'
constructor: ({@softTabs, initialLine, tabLength, softWrap, @displayBuffer, buffer, registerEditor, suppressCursorCreation}) ->
super

View File

@ -28,6 +28,9 @@ class LanguageMode
constructor: (@editor) ->
@buffer = @editor.buffer
toggleLineCommentForBufferRow: (row) ->
@toggleLineCommentsForBufferRows(row, row)
# Wraps the lines between two rows in comments.
#
# If the language doesn't have comment, nothing happens.