mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-06 11:35:24 +08:00
space after function keyword in context-hint
This commit is contained in:
parent
b1e5e99bcd
commit
88befeb497
@ -1,5 +1,5 @@
|
||||
// highly adapted for codemiror jshint
|
||||
(function() {
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
function forEach(arr, f) {
|
||||
@ -19,7 +19,7 @@
|
||||
return arr.indexOf(item) != -1;
|
||||
}
|
||||
|
||||
CodeMirror.contextHint = function(editor) {
|
||||
CodeMirror.contextHint = function (editor) {
|
||||
// Find the token at the cursor
|
||||
var cur = editor.getCursor(),
|
||||
token = editor.getTokenAt(cur),
|
||||
@ -46,7 +46,7 @@
|
||||
}
|
||||
|
||||
// find all 'words' of current cell
|
||||
var getAllTokens = function(editor) {
|
||||
var getAllTokens = function (editor) {
|
||||
var found = [];
|
||||
|
||||
// add to found if not already in it
|
||||
@ -85,7 +85,7 @@
|
||||
function getCompletions(token, editor) {
|
||||
var candidates = getAllTokens(editor);
|
||||
// filter all token that have a common start (but nox exactly) the lenght of the current token
|
||||
var lambda = function(x) {
|
||||
var lambda = function (x) {
|
||||
return (x.indexOf(token.string) == 0 && x != token.string)
|
||||
};
|
||||
var filterd = candidates.filter(lambda);
|
||||
|
Loading…
Reference in New Issue
Block a user