Skip to content

Commit

Permalink
fixup! fixup! feat: show full content of .gitconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
akurinnoy committed Dec 6, 2024
1 parent 1305514 commit 5d55a7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
overflow: auto;
width: 100%;
height: 100%;
max-height: 50vh;
}

.basicViewer > div {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import { defaultHighlightStyle, syntaxHighlighting } from '@codemirror/language';
import { EditorState } from '@codemirror/state';
import { EditorView, lineNumbers } from '@codemirror/view';
import { EditorView } from '@codemirror/view';
import React from 'react';

import styles from '@/components/BasicViewer/index.module.css';
Expand Down Expand Up @@ -52,11 +52,7 @@ export class BasicViewer extends React.PureComponent<Props> {
private getEditorState(): EditorState {
return EditorState.create({
doc: this.props.value,
extensions: [
lineNumbers(),
syntaxHighlighting(defaultHighlightStyle),
EditorState.readOnly.of(true),
],
extensions: [syntaxHighlighting(defaultHighlightStyle), EditorState.readOnly.of(true)],
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export class GitConfigViewer extends React.PureComponent<Props> {
*/
private fromGitConfig(gitConfig: api.IGitConfig['gitconfig']): string {
const serializer = new ini.Serializer();
const gitconfigStr = serializer.serialize(gitConfig);
const gitconfigStr = serializer
.serialize(gitConfig)
.replace(/\n/g, '\n ')
.replace(/ {4}\[/g, '[');
return gitconfigStr;
}

Expand Down

0 comments on commit 5d55a7c

Please sign in to comment.