mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 963937 - Add a pref to disable automatic bracket closing in source editor. r=anton
This commit is contained in:
parent
81c5000320
commit
6826e88d26
@ -1236,9 +1236,11 @@ pref("devtools.hud.loglimit.console", 200);
|
|||||||
// - tabsize: how many spaces to use when a Tab character is displayed.
|
// - tabsize: how many spaces to use when a Tab character is displayed.
|
||||||
// - expandtab: expand Tab characters to spaces.
|
// - expandtab: expand Tab characters to spaces.
|
||||||
// - keymap: which keymap to use (can be 'default', 'emacs' or 'vim')
|
// - keymap: which keymap to use (can be 'default', 'emacs' or 'vim')
|
||||||
|
// - autoclosebrackets: whether to permit automatic bracket/quote closing.
|
||||||
pref("devtools.editor.tabsize", 4);
|
pref("devtools.editor.tabsize", 4);
|
||||||
pref("devtools.editor.expandtab", true);
|
pref("devtools.editor.expandtab", true);
|
||||||
pref("devtools.editor.keymap", "default");
|
pref("devtools.editor.keymap", "default");
|
||||||
|
pref("devtools.editor.autoclosebrackets", true);
|
||||||
|
|
||||||
// Enable the Font Inspector
|
// Enable the Font Inspector
|
||||||
pref("devtools.fontinspector.enabled", true);
|
pref("devtools.fontinspector.enabled", true);
|
||||||
|
@ -10,6 +10,7 @@ const { Cu, Cc, Ci, components } = require("chrome");
|
|||||||
const TAB_SIZE = "devtools.editor.tabsize";
|
const TAB_SIZE = "devtools.editor.tabsize";
|
||||||
const EXPAND_TAB = "devtools.editor.expandtab";
|
const EXPAND_TAB = "devtools.editor.expandtab";
|
||||||
const KEYMAP = "devtools.editor.keymap";
|
const KEYMAP = "devtools.editor.keymap";
|
||||||
|
const AUTO_CLOSE = "devtools.editor.autoclosebrackets";
|
||||||
const L10N_BUNDLE = "chrome://browser/locale/devtools/sourceeditor.properties";
|
const L10N_BUNDLE = "chrome://browser/locale/devtools/sourceeditor.properties";
|
||||||
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||||
|
|
||||||
@ -132,6 +133,7 @@ function Editor(config) {
|
|||||||
const tabSize = Services.prefs.getIntPref(TAB_SIZE);
|
const tabSize = Services.prefs.getIntPref(TAB_SIZE);
|
||||||
const useTabs = !Services.prefs.getBoolPref(EXPAND_TAB);
|
const useTabs = !Services.prefs.getBoolPref(EXPAND_TAB);
|
||||||
const keyMap = Services.prefs.getCharPref(KEYMAP);
|
const keyMap = Services.prefs.getCharPref(KEYMAP);
|
||||||
|
const useAutoClose = Services.prefs.getBoolPref(AUTO_CLOSE);
|
||||||
|
|
||||||
this.version = null;
|
this.version = null;
|
||||||
this.config = {
|
this.config = {
|
||||||
@ -144,7 +146,8 @@ function Editor(config) {
|
|||||||
extraKeys: {},
|
extraKeys: {},
|
||||||
indentWithTabs: useTabs,
|
indentWithTabs: useTabs,
|
||||||
styleActiveLine: true,
|
styleActiveLine: true,
|
||||||
autoCloseBrackets: true,
|
autoCloseBrackets: "()[]{}''\"\"",
|
||||||
|
autoCloseEnabled: useAutoClose,
|
||||||
theme: "mozilla"
|
theme: "mozilla"
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -187,6 +190,10 @@ function Editor(config) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Configure automatic bracket closing.
|
||||||
|
if (!this.config.autoCloseEnabled)
|
||||||
|
this.config.autoCloseBrackets = false;
|
||||||
|
|
||||||
// Overwrite default tab behavior. If something is selected,
|
// Overwrite default tab behavior. If something is selected,
|
||||||
// indent those lines. If nothing is selected and we're
|
// indent those lines. If nothing is selected and we're
|
||||||
// indenting with tabs, insert one tab. Otherwise insert N
|
// indenting with tabs, insert one tab. Otherwise insert N
|
||||||
|
Loading…
Reference in New Issue
Block a user