Add support for changing cursor blink rate within the editors. #8712
parent
24b4d35565
commit
9d0ec04667
Binary file not shown.
|
Before Width: | Height: | Size: 242 KiB After Width: | Height: | Size: 215 KiB |
|
|
@ -292,6 +292,9 @@ Use the fields on the *Options* panel to manage editor preferences.
|
|||
* When the *Code folding?* switch is set to *False*, the editor will disable
|
||||
code folding. Disabling will improve editor performance with large files.
|
||||
|
||||
* Use the *Cursor blink rate* field to adjust the speed at which the text cursor
|
||||
blinks within the editors.
|
||||
|
||||
* Use the *Font family* field to be used for all SQL editors. The specified
|
||||
font should already be installed on your system. If the font is not found,
|
||||
the editor will fall back to the default font, Source Code Pro.
|
||||
|
|
|
|||
|
|
@ -150,6 +150,24 @@ def register_editor_preferences(self, migration_gettext=None):
|
|||
)
|
||||
)
|
||||
|
||||
self.editor_preference.register(
|
||||
'options', 'cursor_blink_rate',
|
||||
gettext("Cursor blink rate"), 'options', 'medium',
|
||||
category_label=PREF_LABEL_OPTIONS,
|
||||
options=[{'label': gettext('None'), 'value': 'none'},
|
||||
{'label': gettext('Slow'), 'value': 'slow'},
|
||||
{'label': gettext('Medium'), 'value': 'medium'},
|
||||
{'label': gettext('Fast'), 'value': 'fast'}],
|
||||
control_props={
|
||||
'allowClear': False,
|
||||
'creatable': False,
|
||||
},
|
||||
help_str=gettext(
|
||||
'Adjust the speed at which the text cursor blinks within '
|
||||
'the editors.'
|
||||
)
|
||||
)
|
||||
|
||||
self.editor_preference.register(
|
||||
'options', 'wrap_code',
|
||||
gettext("Line wrapping?"), 'boolean', False,
|
||||
|
|
|
|||
|
|
@ -120,7 +120,6 @@ function insertTabWithUnit({ state, dispatch }) {
|
|||
/* React wrapper for CodeMirror */
|
||||
const defaultExtensions = [
|
||||
highlightSpecialChars(),
|
||||
drawSelection(),
|
||||
rectangularSelection(),
|
||||
dropCursor(),
|
||||
crosshairCursor(),
|
||||
|
|
@ -399,6 +398,16 @@ export default function Editor({
|
|||
}));
|
||||
}
|
||||
|
||||
const CURSOR_BLINK_RATE_MAP = {
|
||||
'none': 0,
|
||||
'slow': 1800,
|
||||
'medium': 1200,
|
||||
'fast': 600,
|
||||
};
|
||||
newConfigExtn.push(drawSelection({
|
||||
cursorBlinkRate: CURSOR_BLINK_RATE_MAP[editorPref.cursor_blink_rate] ?? 1200
|
||||
}));
|
||||
|
||||
// add fold service conditionally
|
||||
if(!editorPref.plain_editor_mode && editorPref.code_folding && language == 'pgsql') {
|
||||
newConfigExtn.push(plpgsqlFoldService);
|
||||
|
|
|
|||
Loading…
Reference in New Issue