Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Added "Always Show Fragments" name in the preferences of your Editor #424

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/services/i18n/locales/en/preferences.json
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
"highlightLine": "Highlight Line",
"highlightGutter": "Highlight Gutter",
"matchBrackets": "Match Brackets",
"showFragments": "Always Show Fragments",
"prettier": {
"label": "Prettier",
"trailingComma": {
3 changes: 2 additions & 1 deletion src/main/store/module/preferences.ts
Original file line number Diff line number Diff line change
@@ -25,7 +25,8 @@ export default new Store<PreferencesStore>({
singleQuote: true,
highlightLine: false,
highlightGutter: false,
matchBrackets: false
matchBrackets: false,
showFragments: false
},
screenshot: {
background: false,
6 changes: 6 additions & 0 deletions src/renderer/components/preferences/EditorPreferences.vue
Original file line number Diff line number Diff line change
@@ -37,6 +37,12 @@
name="matchBrackets"
/>
</AppFormItem>
<AppFormItem :label="i18n.t('preferences:editor.showFragments')">
<AppCheckbox
v-model="appStore.editor.showFragments"
name="showFragments"
/>
</AppFormItem>
<h4>{{ i18n.t('preferences:editor.prettier.label') }}</h4>
<AppFormItem
:label="i18n.t('preferences:editor.prettier.trailingComma.label')"
3 changes: 2 additions & 1 deletion src/renderer/store/app.ts
Original file line number Diff line number Diff line change
@@ -21,7 +21,8 @@ export const EDITOR_DEFAULTS: EditorSettings = {
singleQuote: true,
highlightLine: false,
highlightGutter: false,
matchBrackets: false
matchBrackets: false,
showFragments: false
}

const SCREENSHOT_DEFAULTS: ScreenshotSettings = {
4 changes: 3 additions & 1 deletion src/renderer/store/snippets.ts
Original file line number Diff line number Diff line change
@@ -81,7 +81,9 @@ export const useSnippetStore = defineStore('snippets', {
fragmentCount: state => state.selected?.content?.length,
tagsCount: state => state.selected?.tagsIds?.length,
isFragmentsShow (): boolean {
return this.fragmentCount ? this.fragmentCount > 1 : false
const appStore = useAppStore()
if (appStore.editor.showFragments === true) return true
else return this.fragmentCount ? this.fragmentCount > 1 : false
},
isTagsShow (): boolean {
const appStore = useAppStore()
1 change: 1 addition & 0 deletions src/shared/types/renderer/store/app.d.ts
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@ export interface EditorSettings {
highlightLine: boolean
highlightGutter: boolean
matchBrackets: boolean
showFragments: boolean
}

export interface ScreenshotSettings {