Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 908868a

Browse files
committed
New Insert Code Hints with Tab Preference
1 parent 0f196f3 commit 908868a

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

src/editor/CodeHintManager.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,13 @@ define(function (require, exports, module) {
236236
"use strict";
237237

238238
// Load dependent modules
239-
var Commands = require("command/Commands"),
240-
CommandManager = require("command/CommandManager"),
241-
EditorManager = require("editor/EditorManager"),
242-
Strings = require("strings"),
243-
KeyEvent = require("utils/KeyEvent"),
244-
CodeHintList = require("editor/CodeHintList").CodeHintList;
239+
var Commands = require("command/Commands"),
240+
CommandManager = require("command/CommandManager"),
241+
EditorManager = require("editor/EditorManager"),
242+
Strings = require("strings"),
243+
KeyEvent = require("utils/KeyEvent"),
244+
CodeHintList = require("editor/CodeHintList").CodeHintList,
245+
PreferencesManager = require("preferences/PreferencesManager");
245246

246247
var hintProviders = { "all" : [] },
247248
lastChar = null,
@@ -250,9 +251,10 @@ define(function (require, exports, module) {
250251
hintList = null,
251252
deferredHints = null,
252253
keyDownEditor = null;
253-
254254

255-
var _insertHintOnTabDefault = false;
255+
256+
PreferencesManager.definePreference("insertHintOnTab", "boolean", false);
257+
256258

257259
/**
258260
* Determines the default behavior of the CodeHintManager on tab key events.
@@ -265,7 +267,7 @@ define(function (require, exports, module) {
265267
* selected hint on tab key events.
266268
*/
267269
function setInsertHintOnTab(insertHintOnTab) {
268-
_insertHintOnTabDefault = insertHintOnTab;
270+
PreferencesManager.set("insertHintOnTab", insertHintOnTab);
269271
}
270272

271273
/**
@@ -474,7 +476,7 @@ define(function (require, exports, module) {
474476
if (sessionProvider.insertHintOnTab !== undefined) {
475477
insertHintOnTab = sessionProvider.insertHintOnTab;
476478
} else {
477-
insertHintOnTab = _insertHintOnTabDefault;
479+
insertHintOnTab = PreferencesManager.get("insertHintOnTab");
478480
}
479481

480482
sessionEditor = editor;

src/language/CodeInspection.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,6 @@ define(function (require, exports, module) {
446446
updateListeners();
447447
if (!doNotSave) {
448448
prefs.set(PREF_ENABLED, _enabled);
449-
prefs.save();
450449
}
451450

452451
// run immediately

0 commit comments

Comments
 (0)