obsidian-imgur-plugin icon indicating copy to clipboard operation
obsidian-imgur-plugin copied to clipboard

Feature Request: don't insert newline after pasting

Open dlccyes opened this issue 2 years ago • 4 comments

Currently, when you paste an image, it automatically inserts a new line. Can you change it to not doing that (cursor stays in the same line) or maybe make it an option in the plugin settings?

dlccyes avatar Apr 15 '22 08:04 dlccyes

Yes, this is easy. I will make an option in settings to enable this.

Wondering what is your use-case. Usually there is no other content than an image on a line.

gavvvr avatar Apr 15 '22 20:04 gavvvr

Thanks!

So yes, I don't put content after the image in the same line also. My use case is that, I mainly do bullet-style note taking on Obsidian, and when I want to insert an image on the bullet above, it would then create an empty new line, which is undesireable.

example:

I want to insert an image in the blank bullet
image

but it also inserts a new blank line, so I'll have to manually delete the redundant line image

dlccyes avatar Apr 16 '22 06:04 dlccyes

Got it. Thanks for the explanation. What if I make the plugin a little but smarter: Having your use-case in mind, I would not put a new line in case when you paste an image as a bullet item. It still makes sense to create a new line in all the other case by default. What do you think?

gavvvr avatar Apr 17 '22 00:04 gavvvr

For me, no. I would prefer this plugin to do nothing but insert a ![](image link), and I do the rest of the formattings myself.

So obviously your idea will work perfectly for my use case. But what if I want to use ordered list or other formatting styles (that I currently can't think of but doesn't mean they don't exist)?

IMO just add an opt-in option to not insert a new line in settings while still defaulting to the current behavior. But I would be thankful too if you choose to cater to my use case.

dlccyes avatar Apr 17 '22 07:04 dlccyes