mirror of
https://github.com/Fabio286/antares.git
synced 2025-02-17 12:10:39 +01:00
feat: option to toggle line wrap mode
This commit is contained in:
parent
3b4f1475df
commit
d94b49febf
@ -114,6 +114,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="column col-8 col-sm-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-6 col-sm-12">
|
||||||
|
<label class="form-label">
|
||||||
|
{{ $t('message.wrapLongLines') }}:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 col-sm-12">
|
||||||
|
<label class="form-switch d-inline-block" @click.prevent="toggleLineWrap">
|
||||||
|
<input type="checkbox" :checked="selectedLineWrap">
|
||||||
|
<i class="form-icon" />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -280,6 +295,7 @@ export default {
|
|||||||
selectedSettingTab: 'application/selectedSettingTab',
|
selectedSettingTab: 'application/selectedSettingTab',
|
||||||
selectedLocale: 'settings/getLocale',
|
selectedLocale: 'settings/getLocale',
|
||||||
selectedAutoComplete: 'settings/getAutoComplete',
|
selectedAutoComplete: 'settings/getAutoComplete',
|
||||||
|
selectedLineWrap: 'settings/getLineWrap',
|
||||||
notificationsTimeout: 'settings/getNotificationsTimeout',
|
notificationsTimeout: 'settings/getNotificationsTimeout',
|
||||||
applicationTheme: 'settings/getApplicationTheme',
|
applicationTheme: 'settings/getApplicationTheme',
|
||||||
editorTheme: 'settings/getEditorTheme',
|
editorTheme: 'settings/getEditorTheme',
|
||||||
@ -333,6 +349,7 @@ ORDER BY
|
|||||||
closeModal: 'application/hideSettingModal',
|
closeModal: 'application/hideSettingModal',
|
||||||
changeLocale: 'settings/changeLocale',
|
changeLocale: 'settings/changeLocale',
|
||||||
changeAutoComplete: 'settings/changeAutoComplete',
|
changeAutoComplete: 'settings/changeAutoComplete',
|
||||||
|
changeLineWrap: 'settings/changeLineWrap',
|
||||||
changeEditorTheme: 'settings/changeEditorTheme',
|
changeEditorTheme: 'settings/changeEditorTheme',
|
||||||
updateNotificationsTimeout: 'settings/updateNotificationsTimeout'
|
updateNotificationsTimeout: 'settings/updateNotificationsTimeout'
|
||||||
}),
|
}),
|
||||||
@ -355,6 +372,9 @@ ORDER BY
|
|||||||
},
|
},
|
||||||
toggleAutoComplete () {
|
toggleAutoComplete () {
|
||||||
this.changeAutoComplete(!this.selectedAutoComplete);
|
this.changeAutoComplete(!this.selectedAutoComplete);
|
||||||
|
},
|
||||||
|
toggleLineWrap () {
|
||||||
|
this.changeLineWrap(!this.selectedLineWrap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -35,7 +35,8 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
editorTheme: 'settings/getEditorTheme',
|
editorTheme: 'settings/getEditorTheme',
|
||||||
autoComplete: 'settings/getAutoComplete'
|
autoComplete: 'settings/getAutoComplete',
|
||||||
|
lineWrap: 'settings/getLineWrap'
|
||||||
}),
|
}),
|
||||||
tables () {
|
tables () {
|
||||||
return this.workspace
|
return this.workspace
|
||||||
@ -100,6 +101,13 @@ export default {
|
|||||||
enableLiveAutocompletion: this.autoComplete
|
enableLiveAutocompletion: this.autoComplete
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
lineWrap () {
|
||||||
|
if (this.editor) {
|
||||||
|
this.editor.setOptions({
|
||||||
|
wrap: this.lineWrap
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
@ -114,6 +122,7 @@ export default {
|
|||||||
|
|
||||||
this.editor.setOptions({
|
this.editor.setOptions({
|
||||||
enableBasicAutocompletion: true,
|
enableBasicAutocompletion: true,
|
||||||
|
wrap: this.lineWrap,
|
||||||
enableSnippets: true,
|
enableSnippets: true,
|
||||||
enableLiveAutocompletion: this.autoComplete
|
enableLiveAutocompletion: this.autoComplete
|
||||||
});
|
});
|
||||||
|
@ -67,7 +67,8 @@ module.exports = {
|
|||||||
dark: 'Dark',
|
dark: 'Dark',
|
||||||
autoCompletion: 'Auto Completion',
|
autoCompletion: 'Auto Completion',
|
||||||
application: 'Application',
|
application: 'Application',
|
||||||
editor: 'Editor'
|
editor: 'Editor',
|
||||||
|
view: 'View'
|
||||||
},
|
},
|
||||||
message: {
|
message: {
|
||||||
appWelcome: 'Welcome to Antares SQL Client!',
|
appWelcome: 'Welcome to Antares SQL Client!',
|
||||||
@ -131,7 +132,8 @@ module.exports = {
|
|||||||
invalidDefault: 'Invalid default',
|
invalidDefault: 'Invalid default',
|
||||||
onDelete: 'On delete',
|
onDelete: 'On delete',
|
||||||
applicationTheme: 'Application Theme',
|
applicationTheme: 'Application Theme',
|
||||||
editorTheme: 'Editor Theme'
|
editorTheme: 'Editor Theme',
|
||||||
|
wrapLongLines: 'Wrap long lines'
|
||||||
},
|
},
|
||||||
// Date and Time
|
// Date and Time
|
||||||
short: {
|
short: {
|
||||||
|
@ -11,6 +11,7 @@ export default {
|
|||||||
explorebar_size: persistentStore.get('explorebar_size') || null,
|
explorebar_size: persistentStore.get('explorebar_size') || null,
|
||||||
notifications_timeout: persistentStore.get('notifications_timeout') || 5,
|
notifications_timeout: persistentStore.get('notifications_timeout') || 5,
|
||||||
auto_complete: persistentStore.get('auto_complete') || true,
|
auto_complete: persistentStore.get('auto_complete') || true,
|
||||||
|
line_wrap: persistentStore.get('line_wrap') || true,
|
||||||
application_theme: persistentStore.get('application_theme') || 'dark',
|
application_theme: persistentStore.get('application_theme') || 'dark',
|
||||||
editor_theme: persistentStore.get('editor_theme') || 'twilight'
|
editor_theme: persistentStore.get('editor_theme') || 'twilight'
|
||||||
},
|
},
|
||||||
@ -19,6 +20,7 @@ export default {
|
|||||||
getExplorebarSize: state => state.explorebar_size,
|
getExplorebarSize: state => state.explorebar_size,
|
||||||
getNotificationsTimeout: state => state.notifications_timeout,
|
getNotificationsTimeout: state => state.notifications_timeout,
|
||||||
getAutoComplete: state => state.auto_complete,
|
getAutoComplete: state => state.auto_complete,
|
||||||
|
getLineWrap: state => state.line_wrap,
|
||||||
getApplicationTheme: state => state.application_theme,
|
getApplicationTheme: state => state.application_theme,
|
||||||
getEditorTheme: state => state.editor_theme
|
getEditorTheme: state => state.editor_theme
|
||||||
},
|
},
|
||||||
@ -36,6 +38,10 @@ export default {
|
|||||||
state.auto_complete = val;
|
state.auto_complete = val;
|
||||||
persistentStore.set('auto_complete', state.auto_complete);
|
persistentStore.set('auto_complete', state.auto_complete);
|
||||||
},
|
},
|
||||||
|
SET_LINE_WRAP (state, val) {
|
||||||
|
state.line_wrap = val;
|
||||||
|
persistentStore.set('line_wrap', state.line_wrap);
|
||||||
|
},
|
||||||
SET_EXPLOREBAR_SIZE (state, size) {
|
SET_EXPLOREBAR_SIZE (state, size) {
|
||||||
state.explorebar_size = size;
|
state.explorebar_size = size;
|
||||||
persistentStore.set('explorebar_size', state.explorebar_size);
|
persistentStore.set('explorebar_size', state.explorebar_size);
|
||||||
@ -57,6 +63,9 @@ export default {
|
|||||||
changeAutoComplete ({ commit }, val) {
|
changeAutoComplete ({ commit }, val) {
|
||||||
commit('SET_AUTO_COMPLETE', val);
|
commit('SET_AUTO_COMPLETE', val);
|
||||||
},
|
},
|
||||||
|
changeLineWrap ({ commit }, val) {
|
||||||
|
commit('SET_LINE_WRAP', val);
|
||||||
|
},
|
||||||
changeEditorTheme ({ commit }, theme) {
|
changeEditorTheme ({ commit }, theme) {
|
||||||
commit('SET_EDITOR_THEME', theme);
|
commit('SET_EDITOR_THEME', theme);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user