gitlab-org--gitlab-foss/app
Douwe Maan 06250eef2e Merge branch 'fix-git-blame-syntax-highlighting' into 'master'
Fix git blame syntax highlighting when different commits break up lines

### What does this MR do?

This MR fixes a bug where syntax highlighting would not work properly in certain lines when doing a `git blame` view of a file. Also, this MR reuses the Rugments lexer and formatter for each `git blame` commit block, which should make things faster and reduce overhead.

### Why was this MR needed?

When doing a `git blame`, GitLab feeds the Rugments lexer/formatter blocks of code based on the latest commit for each line.  However, this can cause lexer to fail because the state is cleared between each block of code, which causes `highlight` to fallback to the plaintext lexer. For example, notice this unhighlighted line in [this file](https://gitlab.common-lisp.net/cmucl/cmucl/blame/master/src/assembly/assemfile.lisp):

![image](https://gitlab.com/gitlab-org/gitlab-ce/uploads/b403fe5c2b883882a9eeea7e0409c583/image.png)

The fixed version looks like this:

![image](https://gitlab.com/stanhu/gitlab-ce/uploads/32c4d7c8ff15a7d59b364dd988f7c657/image.png)

This MR requires a patch to rugments to allow the `continue` option to be passed to the lexer.

* https://github.com/rumpelsepp/rugments/pull/24
* https://github.com/rumpelsepp/rugments/pull/23
* Also submitted to rouge: https://github.com/jneen/rouge/pull/267

### What are the relevant issue numbers?

Closes #1521

See merge request !697
2015-05-28 09:40:00 +00:00
..
assets Persist current merge request tab selection via URL 2015-05-27 22:39:11 -04:00
controllers Set milestone on new issue when creating issue from index with milestone filter active. 2015-05-27 14:22:11 +02:00
finders Set milestone on new issue when creating issue from index with milestone filter active. 2015-05-27 14:22:11 +02:00
helpers Fix git blame syntax highlighting when different commits break up lines 2015-05-27 14:10:58 -07:00
mailers Prefix EmailsOnPush email subject with `[Git]`. 2015-05-25 16:35:37 +02:00
models Fix project snippets button appearing when it is disabled 2015-05-27 05:07:44 -07:00
services Merge branch 'rs-to_reference' into 'master' 2015-05-27 10:03:14 +00:00
uploaders Fix URL to uploaded file. 2015-02-20 16:01:37 +01:00
views Merge branch 'fix-git-blame-syntax-highlighting' into 'master' 2015-05-28 09:40:00 +00:00
workers Added X-GitLab-Event header for web hooks 2015-05-08 16:49:03 +03:00