Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
50d80814
Commit
50d80814
authored
Mar 30, 2021
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix last diff line not allowing suggestions
Fixes a bug where suggestion line would be -1
parent
c788db1e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
app/assets/javascripts/diffs/components/diff_line_note_form.vue
...sets/javascripts/diffs/components/diff_line_note_form.vue
+1
-1
app/assets/javascripts/vue_shared/components/markdown/field.vue
...sets/javascripts/vue_shared/components/markdown/field.vue
+4
-1
spec/frontend/snippets/components/__snapshots__/snippet_description_edit_spec.js.snap
...nents/__snapshots__/snippet_description_edit_spec.js.snap
+1
-1
No files found.
app/assets/javascripts/diffs/components/diff_line_note_form.vue
View file @
50d80814
...
...
@@ -126,7 +126,7 @@ export default {
const
diffLines
=
this
.
diffFile
[
INLINE_DIFF_LINES_KEY
];
let
isAdding
=
false
;
for
(
let
i
=
0
,
diffLinesLength
=
diffLines
.
length
-
1
;
i
<
diffLinesLength
;
i
+=
1
)
{
for
(
let
i
=
0
,
diffLinesLength
=
diffLines
.
length
-
1
;
i
<
=
diffLinesLength
;
i
+=
1
)
{
const
line
=
diffLines
[
i
];
if
(
start
.
line_code
===
line
.
line_code
)
{
...
...
app/assets/javascripts/vue_shared/components/markdown/field.vue
View file @
50d80814
...
...
@@ -168,6 +168,9 @@ export default {
false
,
);
},
suggestionsStartIndex
()
{
return
Math
.
max
(
this
.
lines
.
length
-
1
,
0
);
},
},
watch
:
{
isSubmitting
(
isSubmitting
)
{
...
...
@@ -260,7 +263,7 @@ export default {
:line-content=
"lineContent"
:can-suggest=
"canSuggest"
:show-suggest-popover=
"showSuggestPopover"
:suggestion-start-index=
"
lines.length - 1
"
:suggestion-start-index=
"
suggestionsStartIndex
"
@
preview-markdown=
"showPreviewTab"
@
write-markdown=
"showWriteTab"
@
handleSuggestDismissed=
"() => $emit('handleSuggestDismissed')"
...
...
spec/frontend/snippets/components/__snapshots__/snippet_description_edit_spec.js.snap
View file @
50d80814
...
...
@@ -29,7 +29,7 @@ exports[`Snippet Description Edit component rendering matches the snapshot 1`] =
>
<markdown-header-stub
linecontent=""
suggestionstartindex="
-1
"
suggestionstartindex="
0
"
/>
<div
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment