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
0036bef4
"lib/modules/manager/nuget/artifacts.spec.ts" did not exist on "79592f848aad291204dc17a17d3b5efa5b0defab"
Commit
0036bef4
authored
9 years ago
by
Jerome Reybert
Browse files
Options
Downloads
Patches
Plain Diff
plugin/magit.vim: print an understandable message for bad stage selections (fix #30)
parent
3c3baa32
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugin/magit.vim
+41
-3
41 additions, 3 deletions
plugin/magit.vim
with
41 additions
and
3 deletions
plugin/magit.vim
+
41
−
3
View file @
0036bef4
...
@@ -736,7 +736,20 @@ function! magit#stage_file()
...
@@ -736,7 +736,20 @@ function! magit#stage_file()
call
<
SID
>
mg_stage_closed_file
(
0
)
call
<
SID
>
mg_stage_closed_file
(
0
)
return
return
catch
'out_of_block'
catch
'out_of_block'
try
let
[
start
,
end
]
=
<
SID
>
mg_select_file_block
()
let
[
start
,
end
]
=
<
SID
>
mg_select_file_block
()
catch
/^out_of_block$/
echohl ErrorMsg
echomsg
"Error while staging."
echohl None
echomsg
"Your cursor must be:"
echomsg
" - on a file header line"
echomsg
" - or on a hunk header line"
echomsg
" - or within a hunk"
echomsg
"If you repect one of previous points, please open a new issue:"
echomsg
"https://github.com/jreybert/vimagit/issues/new"
return
endtry
let
selection
=
getline
(
start
,
end
)
let
selection
=
getline
(
start
,
end
)
endtry
endtry
return
magit#stage_block
(
selection
,
0
)
return
magit#stage_block
(
selection
,
0
)
...
@@ -758,7 +771,20 @@ function! magit#stage_hunk(discard)
...
@@ -758,7 +771,20 @@ function! magit#stage_hunk(discard)
try
try
let
[
start
,
end
]
=
<
SID
>
mg_select_hunk_block
()
let
[
start
,
end
]
=
<
SID
>
mg_select_hunk_block
()
catch
'out_of_block'
catch
'out_of_block'
try
let
[
start
,
end
]
=
<
SID
>
mg_select_file_block
()
let
[
start
,
end
]
=
<
SID
>
mg_select_file_block
()
catch
/^out_of_block$/
echohl ErrorMsg
echomsg
"Error while staging."
echohl None
echomsg
"Your cursor must be:"
echomsg
" - on a file header line"
echomsg
" - or on a hunk header line"
echomsg
" - or within a hunk"
echomsg
"If you repect one of previous points, please open a new issue:"
echomsg
"https://github.com/jreybert/vimagit/issues/new"
return
endtry
endtry
endtry
let
marked_lines
=
magit#
sign
#find_stage_signs
(
start
,
end
)
let
marked_lines
=
magit#
sign
#find_stage_signs
(
start
,
end
)
if
(
empty
(
marked_lines
)
)
if
(
empty
(
marked_lines
)
)
...
@@ -786,7 +812,19 @@ function! magit#stage_vselect() range
...
@@ -786,7 +812,19 @@ function! magit#stage_vselect() range
call
add
(
lines
,
curline
)
call
add
(
lines
,
curline
)
let
curline
+=
1
let
curline
+=
1
endwhile
endwhile
try
let
selection
=
<
SID
>
mg_create_diff_from_select
(
lines
)
let
selection
=
<
SID
>
mg_create_diff_from_select
(
lines
)
catch
/^out_of_block$/
echohl ErrorMsg
echomsg
"Error while staging a visual selection."
echohl None
echomsg
"Visual selection staging has currently some limitations:"
echomsg
" - selection must be limited within a single hunk"
echomsg
" - only work for staging, not for unstaging"
echomsg
"If you repect current limitations, please open a new issue:"
echomsg
"https://github.com/jreybert/vimagit/issues/new"
return
endtry
return
magit#stage_block
(
selection
,
0
)
return
magit#stage_block
(
selection
,
0
)
endfunction
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