Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
vim-gdb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Moritz Sichert
vim-gdb
Commits
00c10559
Commit
00c10559
authored
6 years ago
by
Moritz Sichert
Browse files
Options
Downloads
Patches
Plain Diff
Only jump to current line if it's not visible
parent
bc0e59f3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugin/vim-gdb.vim
+11
-3
11 additions, 3 deletions
plugin/vim-gdb.vim
with
11 additions
and
3 deletions
plugin/vim-gdb.vim
+
11
−
3
View file @
00c10559
...
...
@@ -14,15 +14,23 @@ function! Tapi_vimgdb_goto(bufnum, arglist)
let
filename
=
a:arglist
[
1
]
let
line
=
a:arglist
[
2
]
let
session
=
s:sessions
[
session_id
]
" Go to source window
and jump to current line
" Go to source window
noautocmd
call
win_gotoid
(
session
[
'source_winid'
])
execute
'edit'
fnameescape
(
filename
)
execute
'normal!'
line
.
'G'
" Open file if needed
if
filename
!=
expand
(
'%:p'
)
execute
'edit'
fnameescape
(
filename
)
endif
" Update highlighted line
if
session
[
'current_line_matchid'
]
!=
-1
call
matchdelete
(
session
[
'current_line_matchid'
])
endif
let
session
[
'current_line_matchid'
]
=
matchaddpos
(
'VimgdbCurrentLine'
,
[
line
])
" Jump to current line if its not visible
let
first_visible
=
line
(
'w0'
)
let
last_visible
=
line
(
'w$'
)
if
last_visible
>
first_visible &&
(
line
<
first_visible
||
line
>
last_visible
)
execute
'keepjumps normal!'
line
.
'G'
endif
" Switch back to debugger window
noautocmd
call
win_gotoid
(
bufwinid
(
a:bufnum
))
endfunction
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment