mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-10-07 01:18:51 +03:00
feat: add tabSize user setting
This commit is contained in:
parent
02dcc3f1e7
commit
f940d6a1cf
@ -1,9 +1,12 @@
|
||||
<script lang="ts">
|
||||
import { create } from '$lib/components/Differ/CodeHighlighter';
|
||||
import { SETTINGS_CONTEXT, type SettingsStore } from '$lib/settings/userSettings';
|
||||
import { SectionType } from '$lib/utils/fileSections';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { createEventDispatcher, getContext } from 'svelte';
|
||||
import type { Line } from '$lib/utils/fileSections';
|
||||
|
||||
const userSettings = getContext(SETTINGS_CONTEXT) as SettingsStore;
|
||||
|
||||
export let line: Line;
|
||||
export let sectionType: SectionType;
|
||||
export let filePath: string;
|
||||
@ -40,7 +43,12 @@
|
||||
: 'bg-light-50 border-light-300 dark:bg-dark-700 dark:border-dark-400';
|
||||
</script>
|
||||
|
||||
<div class="code-line text-sm" role="group" on:contextmenu|preventDefault>
|
||||
<div
|
||||
class="code-line text-sm"
|
||||
role="group"
|
||||
style="--tab-size: {$userSettings.tabSize}"
|
||||
on:contextmenu|preventDefault
|
||||
>
|
||||
<div class="code-line__numbers-line">
|
||||
<button
|
||||
on:click={() => selectable && dispatch('selected', !selected)}
|
||||
@ -80,6 +88,7 @@
|
||||
font-family: monospace;
|
||||
background-color: var(----clr-theme-container-light);
|
||||
white-space: pre;
|
||||
tab-size: var(--tab-size);
|
||||
}
|
||||
|
||||
.line {
|
||||
|
@ -16,6 +16,7 @@ export interface Settings {
|
||||
defaultTreeHeight: number;
|
||||
zoom: number;
|
||||
scrollbarVisabilityOnHover: boolean;
|
||||
tabSize: number;
|
||||
}
|
||||
|
||||
const defaults: Settings = {
|
||||
@ -29,7 +30,8 @@ const defaults: Settings = {
|
||||
defaultTreeHeight: 100,
|
||||
stashedBranchesHeight: 150,
|
||||
zoom: 1,
|
||||
scrollbarVisabilityOnHover: false
|
||||
scrollbarVisabilityOnHover: false,
|
||||
tabSize: 4
|
||||
};
|
||||
|
||||
export type SettingsStore = Writable<Settings>;
|
||||
|
Loading…
Reference in New Issue
Block a user