GitMurf / obsidian-drag-and-drop-blocks

Drag and Drop blocks to move, copy and create block references.
80 stars 6 forks source link

Feature request: Include new line when dropping block #11

Open dcoales opened 2 years ago

dcoales commented 2 years ago

Thanks for developing this. I've been switching back and forth between Obsidian and LogSeq simply because LogSeq makes it easier to drag things around. Hopefully this will allow me to stick with Obsidian once and for all.

Could I ask for a minor improvement though ? I often want to use this to easily drag a line from one section to another e.g. a bullet under one heading into the middle of a list under another heading. When I drop however, the dragged line is added to the start of the drop target without a newline so the dragged item and the drop target are now a single line. I would much prefer it to include the newline so that the two remain separate.

Thanks again.

GitMurf commented 2 years ago

I plan to add a setting that allows you to have it always add a line break but for now I already have implemented ability to do this. See the following for modifier keys to hold on drop (after you already started dragging). Does this work for you for now?

812B4914-5940-4A5D-8BE0-488AE59E4626

dcoales commented 2 years ago

It doesn't quite do what I'm looking for. Imagine I have the following four lines

- Line 1
- Line 2
- Line 3
- Line 4

I want to drag line 1 and drop it so that it appears between line 3 and 4 to produce

- Line 2
- Line 3
- Line 1
- Line 4

At the moment if I simply drag and hit Alt when dropping i get

- Line 2
- Line 3

- Line 1- Line 4

If I use shift I get

- Line 2
- Line 3
- Line1-Line 4

Shift doesn't seem to put a new line after the dropped line.

GitMurf commented 2 years ago

Ah yes it is kind of finicky. You need to drag it to the END of line 3 holding Alt on drop so then it adds a line break so then it puts line 1 after line 3 instead of on same line.

For the shift it only works if ALSO doing Alt. So the only options are:

no keys = no extra lines Alt = extra line above Alt + Shift = line above and below Shift by itself = doesn’t do anything

can you try and see if that works? I will be adding some extra options to hopefully make this easier but for now want to see if it will work for you.

dcoales commented 2 years ago

That does indeed work .... and in retrospect is an obvious solution ... I'm embarrassed I didn't think of it :-)

Thanks very much. Great plugin.

On Mon, Sep 13, 2021 at 2:55 PM GitMurf @.***> wrote:

Ah yes it is kind of finicky. You need to drag it to the END of line 3 holding Alt on drop so then it adds a line break so then it puts line 1 after line 3 instead of on same line.

For the shift it only works if ALSO doing Alt. So the only options are:

no keys = no extra lines Alt = extra line above Alt + Shift = line above and below Shift by itself = doesn’t do anything

can you try and see if that works? I will be adding some extra options to hopefully make this easier but for now want to see if it will work for you.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/GitMurf/obsidian-drag-and-drop-blocks/issues/11#issuecomment-918215977, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEV5W5ZLEZIO4PPGQ7EUOQDUBX7EFANCNFSM5D4MNQYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

GitMurf commented 2 years ago

@dcoales a new release tomorrow hopefully should make what you want a whole lot easier :) See this demo! Please let me know your thoughts.

https://user-images.githubusercontent.com/64155612/137465747-a79c2cc3-d3c7-4205-86ef-9c8be0a355dc.mp4

dcoales commented 2 years ago

Looks good. I'll try downloading tomorrow and will have a play.

GitMurf commented 2 years ago

@dcoales some big updates! Also I now use the BRAT plugin to install beta testing versions of my plugin. Can you install the recent update via instructions below and then let me know if this gives you what you want with new line breaks? I now have a drag drop zone horizontal line that pops up where your block will get dragged under.

Here is the link (https://github.com/TfTHacker/obsidian42-brat#adding-a-beta-plugin) to instructions by TfTHacker for how to install the new BETA update of my Drag and Drop Blocks plugin using his BRAT plugin for easy install and updating of plugins before they are approved for the Community repository. For step 2 in the instructions use the following:

GitMurf/obsidian-drag-and-drop-blocks

Let me know if you have any questions or issues. Any and all feedback is appreciated. No real docs or instructions right now but I plan to record a demo video tomorrow hopefully. Right now the basics are on my GitHub repo readme: https://github.com/GitMurf/obsidian-drag-and-drop-blocks#how-to-use

dcoales commented 2 years ago

Wow, that's looking really good. I've only had a quick play but it looks good so far. I was planning to raise an issue about dragging bullets in a list where it always indents after the drop whereas I would like to simply reorder the list keeping things at the same level they were originally at however I see you've already got an issue for that at #24 I'll have a more detailed play in the morning and give any feedback I think might be useful. Thanks very much - this is going to be soooo useful.

dcoales commented 2 years ago

I've found a couple of issues so far and have created items #28 and #29.