mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-03 07:43:57 +00:00
[cm6] Configure "4 spaces" as the indent unit for all files (#14366)
GitOrigin-RevId: 5aed6bc5abfd194c11830bdedcbba65ef1ed0522
This commit is contained in:
parent
2d15ce8d05
commit
fbb0ab210e
3 changed files with 5 additions and 7 deletions
|
@ -7,7 +7,7 @@ import {
|
|||
highlightActiveLineGutter,
|
||||
} from '@codemirror/view'
|
||||
import { EditorState, Extension } from '@codemirror/state'
|
||||
import { foldGutter, indentOnInput } from '@codemirror/language'
|
||||
import { foldGutter, indentOnInput, indentUnit } from '@codemirror/language'
|
||||
import { history } from '@codemirror/commands'
|
||||
import { language } from './language'
|
||||
import { lineWrappingIndentation } from './line-wrapping-indentation'
|
||||
|
@ -107,6 +107,7 @@ export const createExtensions = (options: Record<string, any>): Extension[] => [
|
|||
// NOTE: `annotations` needs to be before `language`
|
||||
annotations(),
|
||||
language(options.currentDoc, options.metadata, options.settings),
|
||||
indentUnit.of(' '), // 4 spaces
|
||||
theme(options.theme),
|
||||
realtime(options.currentDoc, options.handleError),
|
||||
cursorPosition(options.currentDoc),
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import { LanguageSupport, indentUnit } from '@codemirror/language'
|
||||
import { LanguageSupport } from '@codemirror/language'
|
||||
import { BibTeXLanguage } from './bibtex-language'
|
||||
|
||||
export const bibtex = () => {
|
||||
return new LanguageSupport(BibTeXLanguage, [
|
||||
indentUnit.of(' '), // 4 spaces
|
||||
])
|
||||
return new LanguageSupport(BibTeXLanguage)
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { latexIndentService } from './latex-indent-service'
|
||||
import { shortcuts } from './shortcuts'
|
||||
import { linting } from './linting'
|
||||
import { LanguageSupport, indentUnit } from '@codemirror/language'
|
||||
import { LanguageSupport } from '@codemirror/language'
|
||||
import { CompletionSource } from '@codemirror/autocomplete'
|
||||
import { openAutocomplete } from './open-autocomplete'
|
||||
import { metadata } from './metadata'
|
||||
|
@ -30,7 +30,6 @@ const completionSources: CompletionSource[] = [
|
|||
|
||||
export const latex = () => {
|
||||
return new LanguageSupport(LaTeXLanguage, [
|
||||
indentUnit.of(' '), // 4 spaces
|
||||
shortcuts(),
|
||||
documentOutline.extension,
|
||||
documentCommands.extension,
|
||||
|
|
Loading…
Reference in a new issue