Skip to content

Commit 850abfb

Browse files
andreaslynvim-scripts
authored andcommitted
Version 0.11
* Resolved problem with moving cursor to wrong window when break points were hit. (This could happen when a taglist window was open while debugging).
1 parent affde65 commit 850abfb

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

autoload/conque_gdb.vim

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function! s:escape_to_py_file(fname)
8282
return l:fname
8383
endfunction
8484

85-
" Heuristic attempt to escape file names before opening them for edit/view
85+
" Attempt to escape file names before opening them for edit/view
8686
function! s:escape_to_shell_file(fname)
8787
if s:platform != 'win'
8888
let l:fname = substitute(a:fname, '\\', '\\\\', 'g')
@@ -283,6 +283,8 @@ function! conque_gdb#breakpoint(fname, lineno)
283283
let l:fname = s:escape_to_shell_file(l:fname_py)
284284

285285
if l:perm != ''
286+
let l:last_win = winnr()
287+
let l:last_buf = bufnr("%")
286288
call s:open_file(l:fname, l:lineno, l:perm)
287289

288290
sil exe 'noautocmd ' . s:src_bufwin . 'wincmd w'
@@ -293,6 +295,15 @@ function! conque_gdb#breakpoint(fname, lineno)
293295
call s:buf_update()
294296

295297
sil exe 'noautocmd wincmd p'
298+
if bufnr("%") != l:last_buf
299+
if l:last_buf != winbufnr(l:last_win)
300+
let l:last = bufwinnr(l:last_buf)
301+
if l:last != -1
302+
let l:last_win = l:last
303+
endif
304+
endif
305+
sil exe 'noautocmd ' . l:last_win . ' wincmd w'
306+
endif
296307
else
297308
" Gdb should detect that the file can't be opened. This should not happen.
298309
echohl WarningMsg | echomsg 'ConqueGdb: Unable to open file ' . a:fname | echohl None

autoload/conque_gdb/conque_gdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class ConqueGdb(Conque):
103103
registered_breakpoints = RegisteredBpDict()
104104

105105
# Mapping from linenumber + filename to a tuple containing the id of the sign
106-
# placed there and whether the breakpoint is enebled ('y') or disabled ('n')
106+
# placed there and whether the breakpoint is enabled ('y') or disabled ('n')
107107
lookup_sign_ids = dict()
108108

109109
# Id number of the next sign to place. Start from 15607 FTW!

doc/conque_gdb.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This help file explains the Conque GDB Vim plugin.
77
Introduction
88

99
The Conque GDB plugin extends the Conque (Conque Term) plugin. Like Conque
10-
Term Conque GDB is a terminal emulator. The |ConqueGdb|, |ConqueGdbSplit|,
10+
Term, Conque GDB is a terminal emulator. The |ConqueGdb|, |ConqueGdbSplit|,
1111
|ConqueGdbVsplit| and |ConqueGdbTab| commands will turn a Vim buffer into a
1212
GDB command line interface (CLI).
1313

@@ -211,13 +211,13 @@ keyboard mappings to work properly. See the help file |conque_term.txt|.
211211
*g:ConqueGdb_Leader*
212212

213213
This option specifies which keyboard key is used as prefix for the Conque GDB
214-
keyboard mappings described below. You can specify this to anything you want,
215-
however you can freely modify any of the keyboard mapping regardless of the
216-
value of |g:ConqueGdb_Leader|. By default it is:
214+
keyboard mappings described below. By default it is:
217215
>
218216
let g:ConqueGdb_Leader = '<Leader>'
219217
>
220-
Note that |<Leader>| is usually defined as \ (backslash).
218+
Note that |<Leader>| is usually defined as \ (backslash). You don't have to
219+
use the |g:ConqueGdb_Leader| when defining new keyboard mappings as described
220+
below.
221221

222222
3.4.2 Run program mapping *conque-gdb-run-mapping*
223223
*g:ConqueGdb_Run*

0 commit comments

Comments
 (0)