Allow CONTROL+button click to include code fences
Originally I wanted to simply request the delete button to remove the whole block:
Removing the code can be useful, but IMO I would find it better if I could remove the whole block.
For examples:
- I want to delete just the code: use the select all button + backspace
- I want to "move" the code: use the select all button + control-C + delete button + paste elsewhere
TBH this still feels convoluted... why not then select all button to select all including fences?
So new idea: allow CONTROL/SHIFT click on the buttons to include fences
- You can effectively copy/select/delete just the code or the whole block
- All buttons behave the same!
Regards! and thanks for the awasome plugin!
Well, I have to say, that this is a great idea!
- Normal click -> copy/select/delete WITHOUT fence lines
- click with modifier key -> copy/select/delete WITH fence lines
I'll implement this soon. I am almost done with execute code plugin compatibility. After that I wanted to add a snapshot button to create a snapshot of the code block, and wanted to modify prompts, so pasted text (which includes prompts) is can be parsed and highlighted, and then release. But I will include this as well. This shouldn't be a big deal.
@dimateos I just pushed this. If you want, you can take the main.js and styles.css and test it. You can also test the Copy as image/snapshot button if you want :)
Hey!
Just checked it out. The copy, select and delete works like a charm!
The image snapshot seems to have a few issues depending on the settings (see GIF at the end):
- Incorrect zoom due to monitor / app scaling.
- Button shows on collapsed, but when you hover is unclickable. Should probably be hidden.
- Collapse indicator shows in the rendered image.
At first it could be due to other plugins so tried in the default vault, so:
- Used a default settings preset to disable all title / ribbon stuff, same issue
- ~~If I had to take a guess, this is related to window / monitor scaling~~
- Yep I tried to set my windows monitor scale to 100% instead of 125% and it works properly!
Thanks for testing! At least something works (modifier key) :D
So if I understand correctly:
- snapshot is not correct if your monitor is set to 125% scaling. This is a very good catch, because I didn't even think of this.
- Yep, I probably messed hiding the button rules.
- Yep, collapse indicator should also be hidden.
I will correct these before release. Might I ask you to test it again? I appreciate some feedback! Btw, what do you think about the themes? I saw you are using the new ones(unreleased) already :)
Sure I will test it!
- snapshot is not correct if your monitor is set to 125% scaling. This is a very good catch, because I didn't even think of this.
Yep, that's how I keep my monitor to have the icons a bit bigger.
Btw, what do you think about the themes?
Yeah I saw the tokyo one and was a really good surprise :) But TBH I just clicked on them in order to use a preset with "default" settings to check if the issues were caused by some non-default.
And this makes me think... that I might keep the old theme so I don't have to port all the other non-visual settings I tweaked already. So it might be a bit weird that the plugin ties settings with color syntax, both in a "Theme".
It might not be worth "improving" this tho, as the user can just redo the "Theme"... is not that much. So other features could be prioritized, but you could think about it for example:
- Separate all color related stuff into "Themes" and then general settings that might not even need the ability to store and edit presets.
- I can open a new issue and leave this info there if you prefer
regards
I agree here as well. It wasn't the best choice. Storing settings in Themes is not ideal. The idea here was that you could define different settings for each theme. But since I never got any feedback/issue related to this, I left it as it is now. But I was considering separating them. I am still not sure tho... (It would be an inconvienience/surprise for most of the users)
Yeah I agree it definitely has advantages and changing it now would be an inconvenience for some! I will comment on it in a separate issue.