Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: the issue with the wrong number was loading from another repository, fmt all, byte -> u8. #250

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion highlight/highlight.v
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn highlight_text(st string, file_path string, commit bool) (string, int, in
mut res := []u8{cap: text.len}
mut lines := 0
mut sloc := 0
mut ss := byte(` `)
mut ss := u8(` `)
lc := lang.line_comments
mut mlc := ''
mut mlc_end := ''
Expand Down
48 changes: 24 additions & 24 deletions highlight/lua.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@ module highlight
fn init_lua() Lang {
return Lang{
name: 'Lua'
lang_extensions: ['lua']
lang_extensions: ['lua']
line_comments: '--'
mline_comments: ['--[[', ']]']
mline_comments: ['--[[', ']]']
string_start: ['"', "'"]
color: '#00007d'
keywords: [
'and',
'break',
'do',
'else',
'elseif',
'end',
'false',
'for',
'function',
'goto',
'if',
'in',
'local',
'nil',
'not',
'or',
'repeat',
'return',
'then',
'true',
'until',
'while',
'and',
'break',
'do',
'else',
'elseif',
'end',
'false',
'for',
'function',
'goto',
'if',
'in',
'local',
'nil',
'not',
'or',
'repeat',
'return',
'then',
'true',
'until',
'while',
]
}
}
6 changes: 6 additions & 0 deletions src/issue_routes.v
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,13 @@ pub fn (mut app App) issue(username string, repo_name string, id string) vweb.Re
return app.not_found()
}

// FIXME: https://github.com/vlang/gitly/issues/249
issue := app.find_issue_by_id(id.int()) or { return app.not_found() }

if issue.repo_id != repo.id {
return app.not_found()
}

issue_author := app.get_user_by_id(issue.author_id) or { return app.not_found() }

mut comments_with_users := []CommentWithUser{}
Expand Down