debug 1.5.0 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/debug/bp.vim DELETED
@@ -1,68 +0,0 @@
1
- let g:rdb_bps = {}
2
-
3
- function SET_BP()
4
- let signed = sign_getplaced(bufname(), {'lnum': line('.')})
5
- if empty(signed[0]['signs'])
6
- call sign_place(0, '', 'signBP', bufname(), {'lnum': line('.')})
7
- else
8
- "echo signed[0]['signs']
9
- call sign_unplace('', {'buffer': bufname(), 'id': signed[0]['signs'][0]['id']})
10
- endif
11
- endfunction
12
-
13
- function UPDATE_BPS()
14
- let signs = sign_getplaced(bufname())
15
- let key = expand('%:p')
16
-
17
- if empty(signs[0]['signs'])
18
- let removed = remove(g:rdb_bps, key)
19
- else
20
- let g:rdb_bps[key] = signs[0]['signs']
21
- endif
22
- endfunction
23
-
24
- function APPLY_BPS()
25
- let key = expand('%:p')
26
- if has_key(g:rdb_bps, key)
27
- for b in g:rdb_bps[key]
28
- call sign_place(0, '', 'signBP', bufname(), {'lnum': b['lnum']})
29
- endfor
30
- endif
31
- endfunction
32
-
33
- function WRITE_BPS()
34
- call writefile([json_encode(g:rdb_bps)], '.rdb_breakpoints.json')
35
- endfunction
36
-
37
- " load
38
- try
39
- let json = readfile('.rdb_breakpoints.json')
40
- let g:rdb_bps = json_decode(json[0])
41
- " {"/full/path/to/file1": [{"lnum": 10}, ...], ...}
42
- catch /Can't open/
43
- let g:rdb_bps = {}
44
- catch /Invalid arguments for function json_decode/
45
- let g:rdb_bps = {}
46
- endtry
47
-
48
- sign define signBP text=BR
49
-
50
- call APPLY_BPS()
51
-
52
- autocmd BufReadPost * call APPLY_BPS()
53
- autocmd BufUnload * call UPDATE_BPS()
54
- autocmd VimLeave * call WRITE_BPS()
55
-
56
- function! s:ruby_bp_settings() abort
57
- echomsg "Type <Space> to toggle break points and <q> to quit"
58
-
59
- if &readonly
60
- nnoremap <silent> <buffer> <Space> :call SET_BP()<CR>
61
- nnoremap <silent> <buffer> q :<C-u>quit<CR>
62
- endif
63
- endfunction
64
-
65
- " autocmd FileType ruby call s:ruby_bp_settings()
66
- autocmd BufEnter *.rb call s:ruby_bp_settings()
67
-
68
- call s:ruby_bp_settings()