Zachatoo / obsidian-css-editor

Edit CSS snippets in Obsidian.
MIT License
57 stars 2 forks source link

[Feature request] Open editor in new tab/pane #14

Closed RyotaUshio closed 1 year ago

RyotaUshio commented 1 year ago

Hi, I want to say thank you for making this great plugin. This is exactly what I've been looking for.

It would be great if we could open the CSS editor in a new pane/tab/window when running the command Editor CSS snippet.

One way would be something like: if we open the command pallette, type Editor CSS snippet and Press Cmd + Enter (on Mac), then a new tab opens. But I'm not sure we have this kind of control over commands. (Probably addCommand doesn't accept such key event handling, I guess)

Another option is to make a new settings item "Open editor in". I mean something like this:

new Setting(this.containerEl).addDropdown((cb) => {
    cb.addOptions(...['New tab', 'New window', 'Split right', 'Split down'])
        .onChange( ... )
}):
Zachatoo commented 1 year ago

Good idea! I've added support for opening CSS files in a new tab if you hit the Enter key while holding down the modifier key (ctrl on Windows, cmd everywhere else). Released in 0.4.0.

There aren't any hotkeys that I can see for opening markdown files in a new window or to the left, so I've opted to not add support for that.

Up to you if you want to re-open this issue open for further discussion for supporting other options, it will be very low on my priority list if I ever get to it.

RyotaUshio commented 1 year ago

Hi, thank you so much for making this come true! Now this plugin is even greater.