ide-assi 0.430.0 → 0.432.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -235071,11 +235071,8 @@ class IdeDiff extends HTMLElement {
235071
235071
  switch (op) {
235072
235072
  case diffMatchPatchExports.diff_match_patch.DIFF_INSERT:
235073
235073
  console.log(diffMatchPatchExports.diff_match_patch.DIFF_INSERT, text);
235074
- let tobeLines = text.split('\n');
235075
- if (tobeLines[tobeLines.length - 1] === '\n') {
235076
- console.log("111");
235077
- tobeLines.splice(tobeLines.length - 1, 1);
235078
- }
235074
+ const tobeLines = text.split('\n');
235075
+ if (text.endsWith('\n')) ;
235079
235076
 
235080
235077
  console.log(tobeLines);
235081
235078
 
@@ -235088,7 +235085,9 @@ class IdeDiff extends HTMLElement {
235088
235085
  tobeCursor += tobeLines[i].length + (i < tobeLines.length - 1 ? 1 : 0);
235089
235086
  */
235090
235087
  console.log(tobeCursor);
235091
- tobeLineBuilder.add(tobeCursor, tobeCursor, insertedLineDeco);
235088
+ if (!(i === tobeLines.length - 1 && tobeLines[i] === '' && text.endsWith('\n'))) {
235089
+ tobeLineBuilder.add(tobeCursor, tobeCursor, insertedLineDeco);
235090
+ }
235092
235091
  tobeCursor += tobeLines[i].length + (i < tobeLines.length - 1 ? 1 : 0);
235093
235092
  }
235094
235093
  break;
@@ -235067,11 +235067,8 @@ class IdeDiff extends HTMLElement {
235067
235067
  switch (op) {
235068
235068
  case diffMatchPatchExports.diff_match_patch.DIFF_INSERT:
235069
235069
  console.log(diffMatchPatchExports.diff_match_patch.DIFF_INSERT, text);
235070
- let tobeLines = text.split('\n');
235071
- if (tobeLines[tobeLines.length - 1] === '\n') {
235072
- console.log("111");
235073
- tobeLines.splice(tobeLines.length - 1, 1);
235074
- }
235070
+ const tobeLines = text.split('\n');
235071
+ if (text.endsWith('\n')) ;
235075
235072
 
235076
235073
  console.log(tobeLines);
235077
235074
 
@@ -235084,7 +235081,9 @@ class IdeDiff extends HTMLElement {
235084
235081
  tobeCursor += tobeLines[i].length + (i < tobeLines.length - 1 ? 1 : 0);
235085
235082
  */
235086
235083
  console.log(tobeCursor);
235087
- tobeLineBuilder.add(tobeCursor, tobeCursor, insertedLineDeco);
235084
+ if (!(i === tobeLines.length - 1 && tobeLines[i] === '' && text.endsWith('\n'))) {
235085
+ tobeLineBuilder.add(tobeCursor, tobeCursor, insertedLineDeco);
235086
+ }
235088
235087
  tobeCursor += tobeLines[i].length + (i < tobeLines.length - 1 ? 1 : 0);
235089
235088
  }
235090
235089
  break;
@@ -279,10 +279,9 @@ export class IdeDiff extends HTMLElement {
279
279
  switch (op) {
280
280
  case diff_match_patch.DIFF_INSERT:
281
281
  console.log(diff_match_patch.DIFF_INSERT, text);
282
- let tobeLines = text.split('\n');
283
- if (tobeLines[tobeLines.length - 1] === '\n') {
284
- console.log("111")
285
- tobeLines.splice(tobeLines.length - 1, 1);
282
+ const tobeLines = text.split('\n');
283
+ if (text.endsWith('\n')) {
284
+ //tobeLines.splice(tobeLines.length - 1, 1);
286
285
  }
287
286
 
288
287
  console.log(tobeLines);
@@ -296,7 +295,9 @@ export class IdeDiff extends HTMLElement {
296
295
  tobeCursor += tobeLines[i].length + (i < tobeLines.length - 1 ? 1 : 0);
297
296
  */
298
297
  console.log(tobeCursor);
299
- tobeLineBuilder.add(tobeCursor, tobeCursor, insertedLineDeco);
298
+ if (!(i === tobeLines.length - 1 && tobeLines[i] === '' && text.endsWith('\n'))) {
299
+ tobeLineBuilder.add(tobeCursor, tobeCursor, insertedLineDeco);
300
+ }
300
301
  tobeCursor += tobeLines[i].length + (i < tobeLines.length - 1 ? 1 : 0);
301
302
  }
302
303
  break;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.430.0",
4
+ "version": "0.432.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -279,10 +279,9 @@ export class IdeDiff extends HTMLElement {
279
279
  switch (op) {
280
280
  case diff_match_patch.DIFF_INSERT:
281
281
  console.log(diff_match_patch.DIFF_INSERT, text);
282
- let tobeLines = text.split('\n');
283
- if (tobeLines[tobeLines.length - 1] === '\n') {
284
- console.log("111")
285
- tobeLines.splice(tobeLines.length - 1, 1);
282
+ const tobeLines = text.split('\n');
283
+ if (text.endsWith('\n')) {
284
+ //tobeLines.splice(tobeLines.length - 1, 1);
286
285
  }
287
286
 
288
287
  console.log(tobeLines);
@@ -296,7 +295,9 @@ export class IdeDiff extends HTMLElement {
296
295
  tobeCursor += tobeLines[i].length + (i < tobeLines.length - 1 ? 1 : 0);
297
296
  */
298
297
  console.log(tobeCursor);
299
- tobeLineBuilder.add(tobeCursor, tobeCursor, insertedLineDeco);
298
+ if (!(i === tobeLines.length - 1 && tobeLines[i] === '' && text.endsWith('\n'))) {
299
+ tobeLineBuilder.add(tobeCursor, tobeCursor, insertedLineDeco);
300
+ }
300
301
  tobeCursor += tobeLines[i].length + (i < tobeLines.length - 1 ? 1 : 0);
301
302
  }
302
303
  break;