From f6bf796cdb7b0232ac6c367cf4da75f6a94c1d29 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 18 Apr 2009 09:55:02 +0200 Subject: [PATCH] Allow searching for object names including the module name, like ``sys.argv``. --- .hgignore | 1 + CHANGES | 3 +++ sphinx/themes/basic/static/searchtools.js | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.hgignore b/.hgignore index b3df24f47..f6cca4310 100644 --- a/.hgignore +++ b/.hgignore @@ -8,3 +8,4 @@ sphinx/pycode/Grammar.*pickle Sphinx.egg-info/ doc/_build/ TAGS +.ropeproject/ diff --git a/CHANGES b/CHANGES index a2b2f2a77..18a9600ba 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ Release 0.7 (in development) ============================ +* Allow searching for object names including the module name, like + ``sys.argv``. + * Many improvements and fixes to the ``autosummary`` extension, thanks to Pauli Virtanen. diff --git a/sphinx/themes/basic/static/searchtools.js b/sphinx/themes/basic/static/searchtools.js index a243b1542..e0226258a 100644 --- a/sphinx/themes/basic/static/searchtools.js +++ b/sphinx/themes/basic/static/searchtools.js @@ -341,9 +341,9 @@ var Search = { } for (var prefix in descrefs) { for (var name in descrefs[prefix]) { - if (name.toLowerCase().indexOf(object) > -1) { + var fullname = (prefix ? prefix + '.' : '') + name; + if (fullname.toLowerCase().indexOf(object) > -1) { match = descrefs[prefix][name]; - fullname = (prefix ? prefix + '.' : '') + name; descr = desctypes[match[1]] + _(', in ') + titles[match[0]]; objectResults.push([filenames[match[0]], fullname, '#'+fullname, descr]); }