Skip to content

Commit

Permalink
added enhancement for issue #12
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbtn committed Oct 14, 2012
1 parent d3d01a6 commit 99ef173
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
31 changes: 27 additions & 4 deletions .gitignore
@@ -1,5 +1,28 @@
<<<<<<< HEAD
node_modules
=======
.c9revisions
>>>>>>> rangeHandler

*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath
14 changes: 10 additions & 4 deletions src/ExcelFormulaUtilities.js
Expand Up @@ -827,7 +827,7 @@
var formatFormula = excelFormulaUtilities.formatFormula = function (formula, options) {
var isFirstToken = true,
defaultOptions = {
tmplFunctionStart: '{{autoindent}}{{token}}\n{{autoindent}}(\n',
tmplFunctionStart: '{{autoindent}}{{token}}(\n',
tmplFunctionStop: '\n{{autoindent}}{{token}})',
tmplOperandError: '{{token}}',
tmplOperandRange: '{{autoindent}}{{token}}',
Expand All @@ -846,7 +846,9 @@
autoLineBreak: 'TOK_TYPE_FUNCTION | TOK_TYPE_ARGUMENT | TOK_SUBTYPE_LOGICAL | TOK_TYPE_OP_IN ',
newLine: '\n',
trim: true,
customTokenRender: null
customTokenRender: null,
prefix: "=",
postfix: ""
};

if (options) {
Expand Down Expand Up @@ -912,8 +914,12 @@
isNewLine = autoBreak || matchEndNewLine.test(outputFormula);
isFirstToken = false;
}

return options.trim ? trim(outputFormula) : outputFormula;

outputFormula = options.prefix + outputFormula + options.postfix;

return options.trim ?
trim(outputFormula) :
outputFormula;
};
/**
* This function calls {@link excelFormulaUtilities.parser.formatFormula}
Expand Down

0 comments on commit 99ef173

Please sign in to comment.