Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] New Command: Select Markdown Table #8

Closed
FelipeRearden opened this issue Mar 1, 2022 · 17 comments
Closed

[Feature Request] New Command: Select Markdown Table #8

FelipeRearden opened this issue Mar 1, 2022 · 17 comments
Assignees

Comments

@FelipeRearden
Copy link

**Is your feature request related to a problem? Please describe. **
Since the starting point to edit tables is to make a selection of the markdown table in the note, I think would be amazing if we have a new command that selects a table based on the position of the caret cursors.

Describe the solution you'd like
If the caret cursor is placed inside a markdown table, hitting the new command will select the entire table !


Thanks for reading this!

Have a great day!!!!

@ganesshkumar
Copy link
Owner

@FelipeRearden , does this work?

expand to select table

Binding it to the same command. Logic used

if there is a selection
    user selected text is used as input
else
    explore on either side of the cursor for empty line
    all the lines between this will be used as input

@ganesshkumar ganesshkumar mentioned this issue Mar 9, 2022
Merged
@FelipeRearden
Copy link
Author

FelipeRearden commented Mar 9, 2022

@FelipeRearden , does this work?

Binding it to the same command. Logic used

Forgive for my comment @ganesshkumar , let me share why I think we need to select the table as well.

Following your video, after entering in the md table editor window the next steps for the user are:

  • Step 1: Hit copy to markdown button;
  • Step 2: Set the focus to the previous note;
  • Step 3: Paste the new table to overwrite the previous table (update).

This way, if we already have the table selected, I don't need to manually select the table than hit CRTL+V :)

Let me know what you think :)

Have a great day !!!!

@ganesshkumar
Copy link
Owner

Oh, got it. That can be a separate command 👍

@ganesshkumar
Copy link
Owner

ganesshkumar commented Mar 9, 2022

select table

Does this work?

@FelipeRearden
Copy link
Author

Thank you very much @ganesshkumar !!!!!!

Thats exactly what I have in mind !!!!!! 💙 💙 💙

@ganesshkumar
Copy link
Owner

Happy to help :) Thank you for the valuable feature suggestions!

@FelipeRearden
Copy link
Author

Happy to help :) Thank you for the valuable feature suggestions!

Thank you very much @ganesshkumar !!!!!!!!!!!!!!!

@FelipeRearden
Copy link
Author

I already installed version 0.1.1 and I think I found a bug ....

Take a look at the images ... when selecting a table with the new command, the line before the first row is being selected two

  • in my example my table in the middle of the note (not in line 1)
    50

With or without content

51

Fun Fact -> sometimes is working prefect .... :)

52

I was trying to investigate if is something related to the caret cursor position when I am hitting the command ...

But I did not found a pattern to share with you :)

I hope you can reproduce this on your end 🙏

@ganesshkumar
Copy link
Owner

Damn! Some regression happened. I should add some tests before adding more functionality!

@ganesshkumar ganesshkumar reopened this Mar 9, 2022
@ganesshkumar
Copy link
Owner

I checked for the same from my end.

  1. When you put your cursor on the first line of the table (header) and invoke the function, do you see extra selection on top line?
  2. Similarly, when you put your cursor on the last line of the table and invoke the function, do you see extra selection on bottom line?

@ganesshkumar
Copy link
Owner

@FelipeRearden Can you update it once again? 0.1.2 - I have included some fixes for both the issues. Works for my, let's see if it fixes the issues for you as well.

@FelipeRearden
Copy link
Author

FelipeRearden commented Mar 9, 2022

@FelipeRearden Can you update it once again? 0.1.2 - I have included some fixes for both the issues. Works for my, let's see if it fixes the issues for you as well.

Sure !!!! I'm here :)

Just to let you know about version 0.1.2 the manifest.json from this release is version 0.1.1. This way I can't see an update button on Obsidian.

image

Just to check with you if I can change manually the manifest.json from the 0.1.2 release and start my test updating manually ?

@FelipeRearden
Copy link
Author

FelipeRearden commented Mar 9, 2022

  1. When you put your cursor on the first line of the table (header) and invoke the function, do you see extra selection on top line?

Working perfect on version 0.1.2 !!!!! Thank you very much @ganesshkumar for your help !!!!!!

  1. Similarly, when you put your cursor on the last line of the table and invoke the function, do you see extra selection on bottom line?

Working perfect on version 0.1.2 !!!!! Thank you very much @ganesshkumar for your help !!!!!!


Let me just add one little information to see if you want make some changes or not ...

When we have some text in the line AFTER the last line of the table, we have a little issue. Take a look ...

image

If the line is empty 100% clear!

image

I'm pointing this to you because it's very common to use some tag like small after the table to add some explanation about the table like a footnote

For me it's okay on version 0.1.2 but as a tester, I think is my duty to present to you all my findings :)

Thanks for the quick reply :)

@FelipeRearden
Copy link
Author

Hello @ganesshkumar !!!!

Sorry to bother you :)

One more information about selecting a table when you have content in the next line of the table ... #8 (comment)

The amazing plugin Obsidian Charts has a new feature that let´s you create Charts from Tables !!!!!

If you look at he documentation, you will see that it uses a table-id in the next line after the table

This way, would be amazing if we avoid this line when selecting a markdown table 🙏


Thanks for reading this and have a great day!!!!!!!!!

@ganesshkumar ganesshkumar mentioned this issue May 1, 2022
@ganesshkumar
Copy link
Owner

With v0.2.2, this is fixed

@FelipeRearden
Copy link
Author

Hello @ganesshkumar !!!!

Thank you very much for the fix 💙

Working perfect on version 0.2.2 Obsidian 0.14.6 and Obsidian Mobile

One ask :)

When you have some time, would you mind taking a look at these two issue 🙏

Thank you very much and have a great day 🌞

@ganesshkumar
Copy link
Owner

Sure @FelipeRearden, I have triaged the feature requests. Will implement them soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants