From 204cec983c037fab2d4a12882c796898c6d7c76f Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Mon, 20 Jun 2016 20:17:01 +0900 Subject: Remove g:deoplete#enable_debug variable --- autoload/deoplete/init.vim | 2 -- doc/deoplete.txt | 12 ++++-------- rplugin/python3/deoplete/logger.py | 3 +-- rplugin/python3/deoplete/util.py | 14 +++++--------- 4 files changed, 10 insertions(+), 21 deletions(-) diff --git a/autoload/deoplete/init.vim b/autoload/deoplete/init.vim index f20a0f7..7c89525 100644 --- a/autoload/deoplete/init.vim +++ b/autoload/deoplete/init.vim @@ -104,8 +104,6 @@ function! deoplete#init#_variables() abort "{{{ \ 'g:deoplete#delimiters', ['/', '.', '::', ':', '#']) call deoplete#util#set_default( \ 'g:deoplete#max_list', 100) - call deoplete#util#set_default( - \ 'g:deoplete#enable_debug', 0) call deoplete#util#set_default( \ 'g:deoplete#enable_profile', 0) call deoplete#util#set_default( diff --git a/doc/deoplete.txt b/doc/deoplete.txt index d6d02bf..a78d8b3 100644 --- a/doc/deoplete.txt +++ b/doc/deoplete.txt @@ -134,14 +134,6 @@ g:deoplete#disable_auto_complete b:deoplete_disable_auto_complete Buffer local variable of |g:deoplete#disable_auto_complete|. - *g:deoplete#enable_debug* -g:deoplete#enable_debug - It enables deoplete debug mode. The debug print feature is - enabled. - Note: You must enable - |deoplete-source-attribute-debug_enabled| to debug the - sources. - *g:deoplete#enable_profile* g:deoplete#enable_profile It enables deoplete profile mode. @@ -415,6 +407,10 @@ deoplete#enable_logging({level}, {logfile}) {logfile} is the file where log messages are written. Messages are appended to this file. Each log session will start with "--- Deoplete Log Start ---". + Note: You must enable + |deoplete-source-attribute-debug_enabled| to debug the + sources. + ------------------------------------------------------------------------------ KEY MAPPINGS *deoplete-key-mappings* diff --git a/rplugin/python3/deoplete/logger.py b/rplugin/python3/deoplete/logger.py index 125ecd0..1254a78 100644 --- a/rplugin/python3/deoplete/logger.py +++ b/rplugin/python3/deoplete/logger.py @@ -63,8 +63,7 @@ def setup(vim, level, output_file=None): def logmethod(func): """Decorator for setting up the logger in LoggingMixin subclasses. - This does not guarantee that log messages will be generated. It is - contingent on g:deoplete#enable_debug being set by the user. If + This does not guarantee that log messages will be generated. If `LoggingMixin.debug_enabled` is True, it will be propagated up to the root 'deoplete' logger. """ diff --git a/rplugin/python3/deoplete/util.py b/rplugin/python3/deoplete/util.py index 9f4be0b..5e24659 100644 --- a/rplugin/python3/deoplete/util.py +++ b/rplugin/python3/deoplete/util.py @@ -52,16 +52,12 @@ def globruntime(runtimepath, path): def debug(vim, expr): - if vim.vars['deoplete#enable_debug']: - try: - json_data = json.dumps(str(expr).strip()) - except Exception: - vim.command('echomsg string(\'' + str(expr).strip() + '\')') - else: - vim.command('echomsg string(\'' + escape(json_data) + '\')') - + try: + json_data = json.dumps(str(expr).strip()) + except Exception: + vim.command('echomsg string(\'' + str(expr).strip() + '\')') else: - error(vim, "not in debug mode, but debug called") + vim.command('echomsg string(\'' + escape(json_data) + '\')') def error(vim, msg): -- cgit v1.2.3