Skip to content

Commit

Permalink
Fixed bug whereby when copying multiple lines each without a block ID…
Browse files Browse the repository at this point in the history
…, only block links (without the content of the lines) would get copied for the first and last lines.
  • Loading branch information
jglev committed Feb 6, 2022
1 parent b17118d commit a312cbc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
18 changes: 9 additions & 9 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ const copyForwardLines = async (
copiedLine = copiedLine.replace(/^\s*/, "");
}

if (
(lineNumber === minLine || lineNumber === maxLine) &&
!(minLine === maxLine && cursorFrom.ch === cursorTo.ch)
) {
copiedLine = line.slice(
lineNumber === minLine ? cursorFrom.ch : 0,
lineNumber === maxLine ? cursorTo.ch : line.length - 1
);
}
// if (
// (lineNumber === minLine || lineNumber === maxLine) &&
// !(minLine === maxLine && cursorFrom.ch === cursorTo.ch)
// ) {
copiedLine = line.slice(
lineNumber === minLine ? cursorFrom.ch : 0,
lineNumber === maxLine ? cursorTo.ch : line.length - 1
);
// }

if (
editor.getLine(lineNumber).match(/^\s*$/) &&
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-carry-forward",
"name": "Carry-Forward",
"version": "1.4.0",
"version": "1.4.1",
"minAppVersion": "0.13.19",
"description": "An Obsidian Notes plugin for generating and copying block IDs and for copying lines with links to the copied line.",
"author": "Obsidian",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-carry-forward",
"version": "1.4.0",
"version": "1.4.1",
"description": "An Obsidian Notes plugin for generating and copying block IDs, and copying lines with a link to the copied line.",
"main": "main.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"1.1.0": "0.12.12",
"1.2.0": "0.13.14",
"1.3.0": "0.13.19",
"1.4.0": "0.13.19"
"1.4.0": "0.13.19",
"1.4.1": "0.13.19"
}

0 comments on commit a312cbc

Please sign in to comment.