mirror of
https://github.com/desktop/desktop
synced 2024-09-13 05:11:21 +00:00
parent
df3b265232
commit
b36b67d5b9
|
@ -387,3 +387,9 @@ export function getLargestLineNumber(hunks: DiffHunk[]): number {
|
|||
export function getNumberOfDigits(val: number): number {
|
||||
return (Math.log(val) * Math.LOG10E + 1) | 0
|
||||
}
|
||||
|
||||
/**
|
||||
* The longest line for which we'd try to calculate a line diff, this matches
|
||||
* GitHub.com's behavior.
|
||||
**/
|
||||
export const MaxIntraLineDiffStringLength = 1024
|
||||
|
|
|
@ -45,6 +45,7 @@ import {
|
|||
DiffColumn,
|
||||
getLineWidthFromDigitCount,
|
||||
getNumberOfDigits,
|
||||
MaxIntraLineDiffStringLength,
|
||||
} from './diff-helpers'
|
||||
import { showContextualMenu } from '../main-process-proxy'
|
||||
import { getTokens } from './diff-syntax-mode'
|
||||
|
@ -59,7 +60,6 @@ import { IMenuItem } from '../../lib/menu-item'
|
|||
import { HiddenBidiCharsWarning } from './hidden-bidi-chars-warning'
|
||||
|
||||
const DefaultRowHeight = 20
|
||||
const MaxLineLengthToCalculateDiff = 240
|
||||
|
||||
export interface ISelectionPoint {
|
||||
readonly column: DiffColumn
|
||||
|
@ -1164,8 +1164,8 @@ function getModifiedRows(
|
|||
const deletedLine = deletedLines[i]
|
||||
|
||||
if (
|
||||
addedLine.line.content.length < MaxLineLengthToCalculateDiff &&
|
||||
deletedLine.line.content.length < MaxLineLengthToCalculateDiff
|
||||
addedLine.line.content.length < MaxIntraLineDiffStringLength &&
|
||||
deletedLine.line.content.length < MaxIntraLineDiffStringLength
|
||||
) {
|
||||
const { before, after } = getDiffTokens(
|
||||
deletedLine.line.content,
|
||||
|
|
|
@ -46,6 +46,7 @@ import {
|
|||
canSelect,
|
||||
getLineWidthFromDigitCount,
|
||||
getNumberOfDigits,
|
||||
MaxIntraLineDiffStringLength,
|
||||
} from './diff-helpers'
|
||||
import {
|
||||
expandTextDiffHunk,
|
||||
|
@ -58,9 +59,6 @@ import { WhitespaceHintPopover } from './whitespace-hint-popover'
|
|||
import { PopoverCaretPosition } from '../lib/popover'
|
||||
import { HiddenBidiCharsWarning } from './hidden-bidi-chars-warning'
|
||||
|
||||
/** The longest line for which we'd try to calculate a line diff. */
|
||||
const MaxIntraLineDiffStringLength = 4096
|
||||
|
||||
// This is a custom version of the no-newline octicon that's exactly as
|
||||
// tall as it needs to be (8px) which helps with aligning it on the line.
|
||||
export const narrowNoNewlineSymbol = {
|
||||
|
|
Loading…
Reference in a new issue