Based on the test results, I may occasionally update the runnable version information on the plugin’s GitHub description.
Background & History of the Plugin:
Sheets Extended (hereinafter “original plugin”)
is a feature-rich plugin that can merge table cells in reading mode and codeblocks, but there are some bugs.
I’m not a programmer. I developed this plugin which is stated as a basic version. It originally was intended as a reference to help the author fix bugs asap.
Due to the delay in waiting for any reply from the author, as my experience grew, I added a new function of merging cells in editing mode to my plugin.
250318 Completely refactored the reading mode and the codeblock section. Reason: Through Chinese Forum t35091#24, it was found that the implementation path of the original plugin needed a fundamental change. In terms of code, this plugin is now completely independent.
Excellent. Exactly what I was looking for.
Just a few bugs and things I would like to improve.
The code on github is javascript (after build?). but do you have the typescript source, or are you editing it in javascript?
@PlayerMiller
My apologies.
I was only looking at the behavior and missed the Deficiencies.
Also, the term ‘bug’ is somewhat inadequate; there are behaviors that we would like to improve.
I can get around this by using the rebuildCurrent you provided, but if I press down on the tab without unbinding the cell join, the join symbol cell is pushed out and created.
I thought it would be more convenient to unjoin cells when a table is selected, even if that is not the case.
I was hoping to improve that minor experience, but it is somewhat difficult for me to edit the JS that is visible after the build, which is how I ended up asking for TS.
As for whether or not it can be submitted to the plugin market, there should be no particular notation restrictions.
There is no need to have a TS, as long as the final deliverables, main.js and manifest.json, are available.
The phenomenon brought up by Tab should be the same as placing the cursor in a signifier cell when rebuildCurrent. It is caused by the receiveCellFocus() function within the tableCell.table object written by Obsidian. Therefore, to solve this problem, we must determine which cell should gain focus when using Tab or something else to move the cursor.
By the way, the method you used in your GIF is a bit complex. You can click in the cell and press F5 for your case.
unjoin cells when a table is selected
When we do a merge, we expect to have a stable bigger cell. This allows for a more pleasing appearance when entering multiple lines of content. Therefore, unmerging upon selecting the cell is not very feasible.
after the build
No. It’s the same on my computer. The built one looks like this:
I guess I was wrong about the “after build” part.
I have rarely touched pure JS recently, so I misunderstood.
If you use 'active-leaf-change' and this.registerDomEvent(document, 'keydown', evt=> {}) , the tableCell has become null when pressing Tab.
I tried my best to fix it in TS using my spare time, but gave up because it was difficult to tie the type information of the part that seems to touch codemirror directly.
Indeed, as far as my problem is concerned, F5 will solve it, so I don’t think I need to worry about it that much.
When we do a merge, we expect to have a stable bigger cell.
I’m used to being in a raw state when I type, since the classic markdown editors (as was the old obsidian editor) are completely separate from editing and viewing.
So I thought it would be easier to edit if it was unmerged when typing.
However, your opinion has made me reconsider.
In any case, I found that overall I was mistaken.
I apologize for the trouble.
Again, I am deeply grateful to you for sharing the plugin that fit my needs perfectly.
// If focus is on a merge cell, move to the merge destination
const old = table.receiveCellFocus;
table.receiveCellFocus = function (row, col, func, flag) {
while (table.rows[row][col].text == Sign.left)
col += col >= table.currentPos.col ? 1 : -1;
while (table.rows[row][col].text == Sign.up)
row += row >= table.currentPos.row ? 1 : -1;
table.currentPos = { row, col };
old.call(this, row, col, func, flag);
I made some modifications to the code reference.
It seems to be able to move up, down, left, and right if it looks like this.
However, I think it will be difficult to deal with future changes in behavior when obsidian is updated with JS…
Especially since I added a selfish property like currentPos this time.
P.S.
Still buggy…
I found that I can’t edit because I can’t cursor over cells such as <.
In any case, I’m happy with the current operation, so you don’t have to worry too much about this problem.