Skip to content

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

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Expand Up @@ -19,6 +19,7 @@
"highlightLine": "Highlight Line",
"highlightGutter": "Highlight Gutter",
"matchBrackets": "Match Brackets",
"showFragments": "Always Show Fragments",
"prettier": {
"label": "Prettier",
"trailingComma": {
Expand Down
3 changes: 2 additions & 1 deletion src/main/store/module/preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export default new Store<PreferencesStore>({
singleQuote: true,
highlightLine: false,
highlightGutter: false,
matchBrackets: false
matchBrackets: false,
showFragments: false
},
screenshot: {
background: false,
Expand Down
6 changes: 6 additions & 0 deletions src/renderer/components/preferences/EditorPreferences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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')"
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/store/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
4 changes: 3 additions & 1 deletion src/renderer/store/snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions src/shared/types/renderer/store/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export interface EditorSettings {
highlightLine: boolean
highlightGutter: boolean
matchBrackets: boolean
showFragments: boolean
}

export interface ScreenshotSettings {
Expand Down