Skip to content

Commit fe9c270

Browse files
committed
improved debugging function with history output
1 parent 6d497a4 commit fe9c270

File tree

4 files changed

+34
-11
lines changed

4 files changed

+34
-11
lines changed

debugvimrc.vim

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
"
77
" Only python-mode will be loaded.
88

9+
" Disable all persistence between sessions.
10+
let skip_defaults_vim=1
11+
" TODO XXX: this nevertheless keeps viminfo enabled. As a workaround the flag
12+
" '-i NONE' should be added to vim's loading.
13+
set viminfo=
14+
set nobackup
15+
set noswapfile
16+
917
" Modify vimrc configuration.
1018
execute('set rtp+='. expand('<sfile>:p:h'))
1119
set rtp -=$HOME/.vim
@@ -19,3 +27,6 @@ let g:pymode_debug = 1
1927
if ! (has('win16') || has('win32') || has('win64'))
2028
set shell=/bin/bash
2129
endif
30+
31+
" IMPORTANT: Do note that the history of this session is saved on the log file.
32+
" See the augroup in ./ftplugin/python/pymode.vim file.

doc/pymode.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,13 +693,16 @@ Python-mode doesn't work
693693
------------------------
694694

695695
Start python mode with:
696-
`vim -u <path_to_pymode>/debugvimrc.vim`
697-
Reproduce the error and submit your python mode debug file. You check its
696+
`vim -i NONE -u <path_to_pymode>/debugvimrc.vim`
697+
Reproduce the error and submit your python mode debug file. You can check its
698698
location with `:messages` for something like:
699699
`pymode debug msg 1: Starting debug on: 2017-11-18 16:44:13 with file /tmp/pymode_debug_file.txt`
700700
Please submit the entire content of the file along with a reasoning of why the
701701
plugin seems broken.
702702

703+
*Underlined do check for sensitive information in the file before
704+
*Underlined submitting!
705+
703706

704707
Rope completion is very slow *pymode-rope-slow*
705708
----------------------------

ftplugin/python/pymode.vim

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,17 @@ if g:pymode_debug
241241
\ . strftime("\%Y-\%m-\%d \%H:\%M:\%S")
242242
\ . ' with file ' . &verbosefile)
243243
" }}}
244+
" Redefine folding expression. {{{
244245
if g:pymode_folding
245246
setlocal foldexpr=pymode#debug#foldingexpr(v:lnum)
246247
endif
247248
call pymode#debug#sysinfo()
249+
" }}}
250+
" Define auto commands for vim. {{{
251+
augroup augroup_save_issue_commands
252+
autocmd!
253+
autocmd VimLeave *.py | call pymode#debug('Session history:') | silent! history
254+
augroup END
255+
" }}}
248256

249-
endif
257+
endif

readme.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,18 @@ Then rebuild **helptags** in vim:
103103
**filetype-plugin** (`:help filetype-plugin-on`) and **filetype-indent**
104104
(`:help filetype-indent-on`) must be enabled to use python-mode.
105105

106-
# Troubleshooting
106+
# Troubleshooting/Debugging
107107

108108
If your python-mode doesn't work:
109109

110-
1. **(From the FAQ)** Start python mode with:
111-
`vim -u <path_to_pymode>/debugvimrc.vim`
112-
Reproduce the error and submit your python mode debug file. You check its
113-
location with `:messages` for something like:
114-
`pymode debug msg 1: Starting debug on: 2017-11-18 16:44:13 with file /tmp/pymode_debug_file.txt`.
115-
Please submit the entire content of the file along with a reasoning of why
116-
the plugin seems broken.
110+
**(From the FAQ)** Start python mode with:
111+
`vim -i NONE -u <path_to_pymode>/debugvimrc.vim`
112+
Reproduce the error and submit your python mode debug file. You can check its
113+
location with `:messages` for something like:
114+
`pymode debug msg 1: Starting debug on: 2017-11-18 16:44:13 with file /tmp/pymode_debug_file.txt`.
115+
Please submit the entire content of the file along with a reasoning of why the
116+
plugin seems broken.
117+
***Do check for sensitive information in the file before submitting.***
117118

118119
# Frequent problems
119120

0 commit comments

Comments
 (0)