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

Use new APIs to get Editor config for tabs. #11

Merged
merged 1 commit into from
May 11, 2023

Conversation

crhallberg
Copy link
Contributor

@crhallberg crhallberg commented Jun 12, 2022

The minimal changes here would be to replace

const tabWidth = cm.getOption("tabSize") || 4;
const useTabs = cm.getOption("indentWithTabs") ?? true;

with

const tabWidth = this.app.vault.getConfig("tabSize") ?? 4;
const useTabs = this.app.vault.getConfig("indentWithTabs") ?? true;

I also applied the new editorCallback to get the editor interface more easily.

This solves the problems of PR #10.

Resolves Issue #9.

@dalisoft
Copy link

dalisoft commented Apr 6, 2023

If someone wants try out this patch without waiting.

Steps:

  • Disable plugin and close Obisidian
  • Open terminal (iTerm, Terminal, no matter)
  • Go-to directory (in my case, it's /Users/mac/Library/Mobile Documents/iCloud~md~obsidian/Documents/iObisidan/.obsidian/plugins) by running cd YOUR_PATH
  • Run git clone https://github.com/crhallberg/obsidian-plugin-prettier.git -b fix-get-config
  • Run cd obisidian-plugin-prettier
  • Run yarn
  • Run yarn build
  • Run cd ..
  • Run mv obsidian-plugin-prettier/dist obisidan-prettier
  • Run rm -rf obsidian-plugin-prettier (try with sudo it not works)
  • Open Obisidan
  • Active plugin and voila. It should work.

For me it works, thank you @crhallberg

@hipstersmoothie hipstersmoothie merged commit d86aceb into hipstersmoothie:main May 11, 2023
@github-actions
Copy link

🚀 PR was released in 0.1.1 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label May 11, 2023
@hipstersmoothie
Copy link
Owner

So #10 can be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants