Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vimagit
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
jreybert
vimagit
Commits
aed80560
Commit
aed80560
authored
8 years ago
by
Jerome Reybert
Browse files
Options
Downloads
Patches
Plain Diff
plugin/magit.vim: jump through closed file too
ref #99
parent
88ae24df
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugin/magit.vim
+10
-1
10 additions, 1 deletion
plugin/magit.vim
with
10 additions
and
1 deletion
plugin/magit.vim
+
10
−
1
View file @
aed80560
...
@@ -1087,7 +1087,7 @@ endfunction
...
@@ -1087,7 +1087,7 @@ endfunction
" param[in] dir: can be 'N' (for next) or 'P' (for previous)
" param[in] dir: can be 'N' (for next) or 'P' (for previous)
function
!
magit#jump_hunk
(
dir
)
function
!
magit#jump_hunk
(
dir
)
let
back
=
(
a:dir
==
'P'
)
?
'b'
:
''
let
back
=
(
a:dir
==
'P'
)
?
'b'
:
''
let
line
=
search
(
"^@@ "
,
back
.
'wn'
)
let
line
=
search
(
'\%(^@@ \|'
.
g:magit_file_re
.
'\)'
,
back
.
'wn'
)
if
(
line
!=
0
)
if
(
line
!=
0
)
if
(
foldlevel
(
line
(
'.'
))
==
2
)
if
(
foldlevel
(
line
(
'.'
))
==
2
)
try
try
...
@@ -1096,6 +1096,15 @@ function! magit#jump_hunk(dir)
...
@@ -1096,6 +1096,15 @@ function! magit#jump_hunk(dir)
endtry
endtry
endif
endif
call
cursor
(
line
,
0
)
call
cursor
(
line
,
0
)
if
(
foldlevel
(
line
(
'.'
))
==
0
)
return
endif
" if current line if an header file of an open file, go next
if
(
foldlevel
(
line
(
'.'
))
==
1
)
let
line
=
search
(
'\%(^@@ \|'
.
g:magit_file_re
.
'\)'
,
back
.
'wn'
)
call
cursor
(
line
,
0
)
endif
while
(
foldclosed
(
line
)
!=
-1
)
while
(
foldclosed
(
line
)
!=
-1
)
try
try
foldopen
foldopen
...
...
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