Permalink
Browse files

Merge pull request #63 from ecoffey/statusline

Add ruby_debugger#statusline
  • Loading branch information...
2 parents 22522c5 + fe76f80 commit 1df86267406288a99cebffae127958880aa19c23 Anton Astashov committed Oct 2, 2011
Showing with 33 additions and 0 deletions.
  1. +13 −0 autoload/ruby_debugger.vim
  2. +7 −0 doc/ruby_debugger.txt
  3. +7 −0 src/ruby_debugger/before.vim
  4. +6 −0 src/ruby_debugger/public.vim
View
@@ -36,6 +36,13 @@ fun! ruby_debugger#load_debugger()
endif
endf
+fun! ruby_debugger#statusline()
+ let is_running = g:RubyDebugger.is_running()
+ if is_running == 0
+ return ''
+ endif
+ return '[ruby debugger running]'
+endfunction
" Check all requirements for the current plugin
fun! s:check_prerequisites()
@@ -455,6 +462,12 @@ function! RubyDebugger.stop() dict
endif
endfunction
+function! RubyDebugger.is_running()
+ if has_key(g:RubyDebugger, 'server')
+ return g:RubyDebugger.server.is_running()
+ endif
+ return 0
+endfunction
" This function receives commands from the debugger. When ruby_debugger.rb
" gets output from rdebug-ide, it writes it to the special file and 'kick'
View
@@ -101,6 +101,13 @@ It will kill any listeners of ports 39767 and 39768 and run rdebug-ide and
* <Leader>c - continue
* <Leader>d - remove all breakpoints
+6. To see when the ruby debugger is running, you can add the following function call
+to your status line:
+
+ set statusline=%{ruby_debugger#statusline()}
+
+ When the debugger is running you'll see '[ruby debugger running]'
+
==============================================================================
DETAILS *ruby-debugger-details*
@@ -36,6 +36,13 @@ fun! ruby_debugger#load_debugger()
endif
endf
+fun! ruby_debugger#statusline()
+ let is_running = g:RubyDebugger.is_running()
+ if is_running == 0
+ return ''
+ endif
+ return '[ruby debugger running]'
+endfunction
" Check all requirements for the current plugin
fun! s:check_prerequisites()
@@ -30,6 +30,12 @@ function! RubyDebugger.stop() dict
endif
endfunction
+function! RubyDebugger.is_running()
+ if has_key(g:RubyDebugger, 'server')
+ return g:RubyDebugger.server.is_running()
+ endif
+ return 0
+endfunction
" This function receives commands from the debugger. When ruby_debugger.rb
" gets output from rdebug-ide, it writes it to the special file and 'kick'

0 comments on commit 1df8626

Please sign in to comment.