MCPcopy Index your code
hub / github.com/bigcode-project/jupytercoder / collectChange

Function collectChange

src/diff.js:1376–1396  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

1374 }
1375
1376 function collectChange(state) {
1377 var ret = [],
1378 operation = state.lines[state.index][0];
1379
1380 while (state.index < state.lines.length) {
1381 var line = state.lines[state.index]; // Group additions that are immediately after subtractions and treat them as one "atomic" modify change.
1382
1383 if (operation === '-' && line[0] === '+') {
1384 operation = '+';
1385 }
1386
1387 if (operation === line[0]) {
1388 ret.push(line);
1389 state.index++;
1390 } else {
1391 break;
1392 }
1393 }
1394
1395 return ret;
1396 }
1397
1398 function collectContext(state, matchChanges) {
1399 var changes = [],

Callers 3

mergeLinesFunction · 0.85
mutualChangeFunction · 0.85
removalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected