fixing spaces vs. tabs issue

This commit is contained in:
Nate Stemen 2017-08-14 18:02:51 +01:00
parent 688f1e9e75
commit 6e9b1c602b
2 changed files with 74 additions and 70 deletions

View file

@ -112,10 +112,12 @@ define [
else else
callback null, result callback null, result
@editor.completers = [@suggestionManager, @editor.completers = [
SnippetCompleter, @suggestionManager,
ReferencesCompleter, SnippetCompleter,
LabelsCompleter] ReferencesCompleter,
LabelsCompleter
]
disable: () -> disable: () ->
@editor.setOptions({ @editor.setOptions({

View file

@ -1,72 +1,74 @@
define () -> define () ->
noArgumentCommands = [ noArgumentCommands = [
'item', 'hline', 'lipsum', 'centering', 'noindent', 'textwidth', 'draw', 'item', 'hline', 'lipsum', 'centering', 'noindent', 'textwidth', 'draw',
'maketitle', 'newpage', 'verb', 'bibliography', 'fi', 'hfill', 'par', 'maketitle', 'newpage', 'verb', 'bibliography', 'fi', 'hfill', 'par',
'in', 'sum', 'cdot', 'alpha', 'ldots', 'else', 'linewidth', 'left', 'in', 'sum', 'cdot', 'alpha', 'ldots', 'else', 'linewidth', 'left',
'right', 'today', 'clearpage', 'newline', 'endinput', 'mu', 'right', 'today', 'clearpage', 'newline', 'endinput', 'mu',
'tableofcontents', 'vfill', 'bigskip', 'fill', 'cleardoublepage', 'tableofcontents', 'vfill', 'bigskip', 'fill', 'cleardoublepage'
] ]
singleArgumentCommands = [ singleArgumentCommands = [
'chapter', 'usepackage', 'section', 'label', 'textbf', 'subsection', 'chapter', 'usepackage', 'section', 'label', 'textbf', 'subsection',
'vspace', 'cite', 'textit', 'documentclass', 'includegraphics', 'input', 'vspace', 'cite', 'textit', 'documentclass', 'includegraphics', 'input',
'emph','caption', 'ref', 'title', 'author', 'texttt', 'include', 'emph','caption', 'ref', 'title', 'author', 'texttt', 'include',
'hspace', 'bibitem', 'url', 'large', 'subsubsection', 'textsc', 'date', 'hspace', 'bibitem', 'url', 'large', 'subsubsection', 'textsc', 'date',
'footnote', 'small', 'thanks', 'underline', 'graphicspath', 'pageref', 'footnote', 'small', 'thanks', 'underline', 'graphicspath', 'pageref',
'section*', 'subsection*', 'subsubsection*', 'sqrt', 'text', 'section*', 'subsection*', 'subsubsection*', 'sqrt', 'text',
'normalsize', 'Large', 'paragraph', 'pagestyle', 'thispagestyle', 'normalsize', 'Large', 'paragraph', 'pagestyle', 'thispagestyle',
'bibliographystyle', 'bibliographystyle'
] ]
doubleArgumentCommands = [ doubleArgumentCommands = [
'newcommand', 'frac', 'renewcommand', 'setlength', 'href', 'newtheorem', 'newcommand', 'frac', 'renewcommand', 'setlength', 'href', 'newtheorem'
] ]
tripleArgumentCommands = [ tripleArgumentCommands = [
'addcontentsline', 'newacronym', 'multicolumn' 'addcontentsline', 'newacronym', 'multicolumn'
] ]
special = ['LaTeX', 'TeX'] special = ['LaTeX', 'TeX']
noArgumentCommands = for com in noArgumentCommands noArgumentCommands = for com in noArgumentCommands
{ {
caption: "\\#{com}" caption: "\\#{com}"
snippet: "\\#{com}" snippet: "\\#{com}"
meta: "cmd" meta: "cmd"
} }
singleArgumentCommands = for com in singleArgumentCommands singleArgumentCommands = for com in singleArgumentCommands
{ {
caption: "\\#{com}{}" caption: "\\#{com}{}"
snippet: "\\#{com}{$1}" snippet: "\\#{com}{$1}"
meta: "cmd" meta: "cmd"
} }
doubleArgumentCommands = for com in doubleArgumentCommands doubleArgumentCommands = for com in doubleArgumentCommands
{ {
caption: "\\#{com}{}{}" caption: "\\#{com}{}{}"
snippet: "\\#{com}{$1}{$2}" snippet: "\\#{com}{$1}{$2}"
meta: "cmd" meta: "cmd"
} }
tripleArgumentCommands = for com in tripleArgumentCommands tripleArgumentCommands = for com in tripleArgumentCommands
{ {
caption: "\\#{com}{}{}{}" caption: "\\#{com}{}{}{}"
snippet: "\\#{com}{$1}{$2}{$3}" snippet: "\\#{com}{$1}{$2}{$3}"
meta: "cmd" meta: "cmd"
} }
special = for cmd in special special = for cmd in special
if cmd == 'TeX' if cmd == 'TeX'
{ {
caption: "\\TeX{}" caption: "\\TeX{}"
snippet: "\\TeX{}" snippet: "\\TeX{}"
meta: "cmd" meta: "cmd"
} }
else if com == 'LaTeX' else if com == 'LaTeX'
{ {
caption: "\\LaTeX{}" caption: "\\LaTeX{}"
snippet: "\\LaTeX{}" snippet: "\\LaTeX{}"
meta: "cmd" meta: "cmd"
} }
staticCommands = [].concat(noArgumentCommands, staticCommands = [].concat(
singleArgumentCommands, noArgumentCommands,
doubleArgumentCommands, singleArgumentCommands,
tripleArgumentCommands, doubleArgumentCommands,
special) tripleArgumentCommands,
special
)
environments = [ environments = [
"abstract", "abstract",
@ -174,7 +176,7 @@ define () ->
$3 $3
\\end{thebibliography} \\end{thebibliography}
""" """
}] }]
staticSnippets = staticSnippets.concat staticCommands staticSnippets = staticSnippets.concat staticCommands