Navigation Menu

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

Add indented-code-wrapping feature #1989

Merged
merged 34 commits into from May 24, 2019
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
bc7af91
Soft-wrap code blocks
notlmn Apr 22, 2019
2523e31
Allow dynamic tab-size configurations
notlmn Apr 29, 2019
9971d2b
Merge branch `master` into `soft-wrap`
notlmn Apr 29, 2019
6b40320
Separate out CSS into feature file
notlmn Apr 29, 2019
fd0bacb
Drop unrelated changes
notlmn Apr 29, 2019
1674454
Clean out CSS, finalize loading
notlmn Apr 29, 2019
045cd00
Apply suggestions from code review
fregante Apr 29, 2019
198e2a5
Minify code
notlmn Apr 29, 2019
47e51aa
Merge branch 'master' into soft-wrap
notlmn Apr 29, 2019
4aae3c4
Drop unused `if`
notlmn Apr 29, 2019
96e1061
Fix PRFiles support
fregante May 2, 2019
5f83fba
Make feature work on ajaxed content
notlmn May 2, 2019
4755950
Declare myself CODEOWNER
notlmn May 2, 2019
ec16d93
Use `setProperty` on style instead of directly applying the specific …
notlmn May 2, 2019
698ee2b
Apply suggestions, minify code
notlmn May 3, 2019
56e084b
Turn `onPrFileLoad` into a regular callback function
fregante May 3, 2019
20f8e4d
Merge branch 'master' into soft-wrap
fregante May 3, 2019
e67b893
Don't try to wrap short lines
fregante May 3, 2019
7257846
Don't try to wrap short lines /2
fregante May 3, 2019
f85dc16
Merge branch 'master' into soft-wrap
fregante May 6, 2019
7457998
Rename to `indented-code-wrapping`
fregante May 11, 2019
9891a96
Rename to `indented-code-wrapping` /2
fregante May 11, 2019
763922a
Exclude non-code lines in selector + fix length check
fregante May 11, 2019
6a6f974
Merge branch 'master' into soft-wrap
fregante May 11, 2019
a79de46
Target specific blob lines to be block
notlmn May 12, 2019
46f92df
Wrap Git hunk blocks using CSS
notlmn May 12, 2019
997a379
Merge branch 'master' into soft-wrap
notlmn May 13, 2019
32954b8
Add `description` field
notlmn May 13, 2019
412bc76
Avoid layout changes and match with GitHub's height
notlmn May 17, 2019
4260a65
Merge branch 'master' into soft-wrap
notlmn May 17, 2019
a73151a
Merge branch 'master' into soft-wrap
notlmn May 21, 2019
3666b19
Avoid layout change
fregante May 24, 2019
51a5be1
Avoid "Suggested change" indentation change
fregante May 24, 2019
95cb98a
Remove empty lines at the start of CSS
notlmn May 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions source/features/indented-code-wrapping.tsx
Expand Up @@ -34,10 +34,12 @@ function run(): void {
}
}

// Move the whole line where it is supposed to be, then unindent the
// start of the line to compensate for indentation, preserving spaces
// Code suggestions already had some padding
const extraPadding = line.classList.contains('px-2') ? '8px + ' : '';

// Move the whole line where it is supposed to be, then unindent the start of the line to compensate for indentation, preserving spaces
// We might get `--tab-size` from compatible extensions like `github-custom-tab-size`
line.style.setProperty('padding-left', `calc((var(--tab-size, 4) * ${tabCount}ch) + ${spaceCount}ch)`, 'important');
line.style.setProperty('padding-left', `calc(${extraPadding}(var(--tab-size, 4) * ${tabCount}ch) + ${spaceCount}ch)`, 'important');
fregante marked this conversation as resolved.
Show resolved Hide resolved
line.style.setProperty('text-indent', `calc((var(--tab-size, 4) * -${tabCount}ch) - ${spaceCount}ch)`, 'important');
}
}
Expand Down