-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new feature: added new default columns naming method option
- Loading branch information
Samuel Linclau
committed
Oct 21, 2015
1 parent
d75727a
commit 84260ec
Showing
3 changed files
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
|
||
module.exports = | ||
columnName = (index) -> | ||
base = 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z'.split(' ') | ||
if atom.config.get('tablr.defaultColumnNamingMethod') == 'numeric' | ||
(1+index) + '' | ||
else if atom.config.get('tablr.defaultColumnNamingMethod') == 'numericZeroBased' | ||
index + '' | ||
else | ||
base = 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z'.split(' ') | ||
|
||
quotient = Math.floor(index / 26) | ||
quotient = Math.floor(index / 26) | ||
|
||
if quotient > 0 | ||
columnName(quotient - 1) + base[index % 26] | ||
else | ||
base[index % 26] | ||
if quotient > 0 | ||
columnName(quotient - 1) + base[index % 26] | ||
else | ||
base[index % 26] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters