Skip to content

Commit adfec3f

Browse files
Configurable ligature support
1 parent af6c1a2 commit adfec3f

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed
171 Bytes
Loading

docs/en_US/preferences.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,10 @@ Use the fields on the *Editor* panel to change settings of the query editor.
421421
font should already be installed on your system. If the font is not found,
422422
the editor will fall back to the default font, Source Code Pro.
423423

424+
* When the *Font ligatures?* switch is set to *True*, ligatures will be
425+
enabled in SQL text boxes and editors provided the configured font family
426+
supports them.
427+
424428
* Use the *Font size* field to specify the font size that will be used in text
425429
boxes and editors.
426430

web/pgadmin/static/js/Theme/overrides/codemirror.override.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default function cmOverride(theme) {
1414
height: '100%',
1515
color: editor.fg,
1616
backgroundColor: editor.bg,
17+
letterSpacing: '0px',
1718

1819
'&.cm-focused': {
1920
outline: 'none',

web/pgadmin/static/js/components/ReactCodeMirror/components/Editor.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ export default function Editor({
305305
newConfigExtn.push(EditorView.theme({
306306
'& .cm-scroller .cm-content': {
307307
fontSize: fontSize,
308+
fontVariantLigatures: pref.sql_font_ligatures ? 'normal' : 'none',
308309
fontFamily: `${pref.sql_font_family}, ${theme.typography.fontFamilySourceCode}`,
309310
},
310311
'.cm-gutters': {

web/pgadmin/tools/sqleditor/utils/query_tool_preferences.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,16 @@ def register_query_tool_preferences(self):
390390
)
391391
)
392392

393+
self.sql_font_ligatures = self.preference.register(
394+
'Editor', 'sql_font_ligatures',
395+
gettext("Font ligatures?"), 'boolean',
396+
False, category_label=PREF_LABEL_DISPLAY,
397+
help_str=gettext(
398+
'If set to true, ligatures will be enabled in SQL text boxes '
399+
'and editors provided the configured font family supports them.'
400+
)
401+
)
402+
393403
self.sql_font_family = self.preference.register(
394404
'Editor', 'sql_font_family',
395405
gettext("Font family"), 'text', 'Source Code Pro',

0 commit comments

Comments
 (0)