@@ -13,6 +13,7 @@ import * as editorCommon from 'vs/editor/common/editorCommon';
1313import { ICommentsConfiguration } from 'vs/editor/common/modes' ;
1414import { BlockCommentCommand } from './blockCommentCommand' ;
1515import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry' ;
16+ import { CharCode } from 'vs/base/common/charCode' ;
1617
1718export interface IInsertionPoint {
1819 ignore : boolean ;
@@ -114,7 +115,6 @@ export class LineCommentCommand implements editorCommon.ICommand {
114115 lineNumber :number ,
115116 shouldRemoveComments :boolean ,
116117 lineContent : string ,
117- _space = ' ' . charCodeAt ( 0 ) ,
118118 onlyWhitespaceLines = true ;
119119
120120 if ( type === Type . Toggle ) {
@@ -162,7 +162,7 @@ export class LineCommentCommand implements editorCommon.ICommand {
162162
163163 if ( shouldRemoveComments ) {
164164 commentStrEndOffset = lineContentStartOffset + lineData . commentStrLength ;
165- if ( commentStrEndOffset < lineContent . length && lineContent . charCodeAt ( commentStrEndOffset ) === _space ) {
165+ if ( commentStrEndOffset < lineContent . length && lineContent . charCodeAt ( commentStrEndOffset ) === CharCode . Space ) {
166166 lineData . commentStrLength += 1 ;
167167 }
168168 }
@@ -414,8 +414,7 @@ export class LineCommentCommand implements editorCommon.ICommand {
414414 lineContent : string ,
415415 j : number ,
416416 lenJ : number ,
417- currentVisibleColumn : number ,
418- _tab = '\t' . charCodeAt ( 0 ) ;
417+ currentVisibleColumn : number ;
419418
420419 for ( i = 0 , len = lines . length ; i < len ; i ++ ) {
421420 if ( lines [ i ] . ignore ) {
@@ -426,7 +425,7 @@ export class LineCommentCommand implements editorCommon.ICommand {
426425
427426 currentVisibleColumn = 0 ;
428427 for ( j = 0 , lenJ = lines [ i ] . commentStrOffset ; currentVisibleColumn < minVisibleColumn && j < lenJ ; j ++ ) {
429- currentVisibleColumn = LineCommentCommand . nextVisibleColumn ( currentVisibleColumn , tabSize , lineContent . charCodeAt ( j ) === _tab , 1 ) ;
428+ currentVisibleColumn = LineCommentCommand . nextVisibleColumn ( currentVisibleColumn , tabSize , lineContent . charCodeAt ( j ) === CharCode . Tab , 1 ) ;
430429 }
431430
432431 if ( currentVisibleColumn < minVisibleColumn ) {
@@ -445,7 +444,7 @@ export class LineCommentCommand implements editorCommon.ICommand {
445444
446445 currentVisibleColumn = 0 ;
447446 for ( j = 0 , lenJ = lines [ i ] . commentStrOffset ; currentVisibleColumn < minVisibleColumn && j < lenJ ; j ++ ) {
448- currentVisibleColumn = LineCommentCommand . nextVisibleColumn ( currentVisibleColumn , tabSize , lineContent . charCodeAt ( j ) === _tab , 1 ) ;
447+ currentVisibleColumn = LineCommentCommand . nextVisibleColumn ( currentVisibleColumn , tabSize , lineContent . charCodeAt ( j ) === CharCode . Tab , 1 ) ;
449448 }
450449
451450 if ( currentVisibleColumn > minVisibleColumn ) {
0 commit comments