Giter VIP home page Giter VIP logo

Comments (6)

timhor avatar timhor commented on June 24, 2024 1

No problem! I'll message you on Discord about it.

from obsidian-editor-shortcuts.

timhor avatar timhor commented on June 24, 2024

Thanks for the detailed explanation 🙂 this issue seems like it could be solved with a slight change to your workflow though?

If I'm understanding correctly, the difference in behaviour is because in the first case, you're using the QuickAdd macro with a cursor selection, whereas in the second case, you're using it after selecting the text yourself via the keyboard.

What if you change the macro to only perform Apply u tag? Then you can have more flexibility with the content you wish to apply it to. Some examples:

  • Select word with Ctrl+D and then run the macro
  • Select line with Ctrl+L and then run the macro
  • Select part of line with Shift + arrow keys and then run the macro

Or if you really want to keep one where it expands to the current word, maybe create another version of the macro to do that.

(I'd also prefer to avoid keeping and maintaining bespoke commands where possible)

from obsidian-editor-shortcuts.

FelipeRearden avatar FelipeRearden commented on June 24, 2024

Thanks for the detailed explanation 🙂

💙 and thanks for using your time to reply and to suggest a different approach :)

If I'm understanding correctly, the difference in behaviour is because in the first case, you're using the QuickAdd macro with a cursor selection, whereas in the second case, you're using it after selecting the text yourself via the keyboard.

100% Correct.

The command Select Word would select a word when the caret cursor is placed between two characters AND keep the selection if something was already selected.

This way I had four situations covered:

  • Nothing Selected with the caret cursor placed between two characters;
  • 1 word select;
  • 2 or more words selected;
  • Nothing Selected with nothing near the caret cursor -> QuickAdd opens a modal for me to type the words and apply the decoration.

This way I could have one hotkey for 4 workflows different workflows.

this issue seems like it could be solved with a slight change to your workflow though?

I really appreciate the suggestion. Some info just to see the problem is a more dangerous than looks :)

I have 8 commands with this behavior. I don't have more hotkeys :(

19943E89-66F4-46C5-8B6A-2E7BC2483A05

What if you change the macro to only perform Apply u tag? Then you can have more flexibility with the content you wish to apply it to. Some examples:

I already have hotkeys that only applies to situations where I need to apply the decoration to the Selected Line.

ℹī¸ As you know I use your other command Select Line to apply the decoration to the line instead to words.

Or if you really want to keep one where it expands to the current word, maybe create another version of the macro to do that.

(I'd also prefer to avoid keeping and maintaining bespoke commands where possible)

Before creating this FR I tried for weeks everything possible to avoid creating this FR (Templater, Shell Commands, changing the Macro) but we don't have another plugin that selects the word, just yours used to be.

That's why I put a lot ❤ī¸ to create an detailed FR that would show to you how this new command is important to workflows that rely on selection as the first step of a command with multiples step.

You were my last chance :)

I created the FR and 🙏 for Obsidian gods for an answer :)

(I'd also prefer to avoid keeping and maintaining bespoke commands where possible)

100% understood 👍

from obsidian-editor-shortcuts.

timhor avatar timhor commented on June 24, 2024

I see, I appreciate the effort you went to in trying to find workarounds! I'll revisit this if there ends up being more demand for it, or at least after I've addressed some of the other pending feature requests first.

For now – the select word command was updated in c88b861. Could you potentially look into changing your copy of the plugin by restoring the deleted lines in main.ts and actions.ts?

from obsidian-editor-shortcuts.

FelipeRearden avatar FelipeRearden commented on June 24, 2024

I see, I appreciate the effort you went to in trying to find workarounds! I'll revisit this if there ends up being more demand for it, or at least after I've addressed some of the other pending feature requests first.

I really appreciate @timhor for some hope in the future. Thanks for caring @timhor ! It means a lot

Could you potentially look into changing your copy of the plugin by restoring the deleted lines in main.ts and actions.ts?

I am not a developer but I am a hard worker. If you give some guidance and help on how to do this I will try my best.

My questions from my first attempt:

1ī¸âƒŖ Restore = addition ?

by restoring the deleted lines in main.ts and actions.ts

Do you mean by this that I have to ADD the red lines without EXCLUDE of the GREEN lines ?

2ī¸âƒŖ How to find main.ts and actions.ts?

On my end (my plugin folder) I only have .js files

Forgive for my lack of knowledge :)

from obsidian-editor-shortcuts.

FelipeRearden avatar FelipeRearden commented on June 24, 2024

No problem! I'll message you on Discord about it.

Thank you very much @timhor !!!

I got your message on discord and I will reply there!

from obsidian-editor-shortcuts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.