Skip to content

Commit 7a531aa

Browse files
committed
Allow always showing the signs vertical ruler.
1 parent 5ae1df9 commit 7a531aa

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

autoload/pymode.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ fun! pymode#PlaceSigns() "{{{
5555
"
5656
if has('signs')
5757
sign unplace *
58+
59+
if !pymode#Default("g:pymode_lint_signs_always_visible", 0) || g:pymode_lint_signs_always_visible
60+
" Show the sign's ruller if asked for, even it there's no error to show
61+
execute printf('silent! sign place 1 line=1 name=__dummy__ file=%s', expand("%:p"))
62+
endif
63+
5864
for item in filter(getqflist(), 'v:val.bufnr != ""')
5965
execute printf('silent! sign place 1 line=%d name=%s buffer=%d', item.lnum, item.type, item.bufnr)
6066
endfor

plugin/pymode.vim

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ if !pymode#Default("g:pymode_lint", 1) || g:pymode_lint
9999
" OPTION: g:pymode_lint_mccabe_complexity -- int. Maximum allowed complexity
100100
call pymode#Default("g:pymode_lint_mccabe_complexity", 8)
101101

102+
" OPTION: g:pymode_lint_signs_always_visible -- bool. Always show the
103+
" errors ruller, even if there's no errors.
104+
call pymode#Default("g:pymode_lint_signs_always_visible", 0)
105+
102106
" OPTION: g:pymode_lint_signs -- bool. Place error signs
103107
if (!pymode#Default("g:pymode_lint_signs", 1) || g:pymode_lint_signs) && has('signs')
104108

@@ -109,6 +113,12 @@ if !pymode#Default("g:pymode_lint", 1) || g:pymode_lint
109113
sign define E text=EE texthl=Error
110114
sign define I text=II texthl=Info
111115

116+
if !pymode#Default("g:pymode_lint_signs_always_visible", 0) || g:pymode_lint_signs_always_visible
117+
" Show the sign's ruller if asked for, even it there's no error to show
118+
sign define __dummy__
119+
autocmd BufRead,BufNew * execute printf('silent! sign place 1 line=1 name=__dummy__ file=%s', expand("%:p"))
120+
endif
121+
112122
endif
113123

114124
" DESC: Set default pylint configuration
@@ -242,6 +252,9 @@ if !pymode#Default("g:pymode_rope", 1) || g:pymode_rope
242252
fun! RopeOpenExistingProject() "{{{
243253
if isdirectory('./.ropeproject')
244254
call RopeOpenProject()
255+
" Reload current buffer
256+
"silent edit!
257+
" Does not work, looses syntax!!! argg
245258
return ""
246259
endif
247260
endfunction "}}}
@@ -285,7 +298,6 @@ if !pymode#Default("g:pymode_rope", 1) || g:pymode_rope
285298
" Hooks
286299
if !pymode#Default("g:pymode_rope_auto_project_open", 1) || g:pymode_rope_auto_project_open
287300
autocmd VimEnter * call RopeOpenExistingProject()
288-
call windo e
289301
endif
290302

291303
endif

pylibs/ropevim.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,11 @@ def open_project(self, root=None):
429429
progress = self.env.create_progress(txt)
430430
for idx, vimfile in enumerate(sorted(vimfiles)):
431431
progress.name = txt + ' ({0})'.format(os.path.basename(vimfile))
432-
vim.command(':so {0}'.format(vimfile))
432+
vim.command(':silent source {0}'.format(vimfile))
433433
progress.update(idx * 100 / len(vimfiles))
434434
progress.name = txt
435435
progress.done()
436-
436+
echo('Project opened!')
437437

438438
decorators.logger.message = echo
439439
decorators.logger.only_short = True

0 commit comments

Comments
 (0)