deathau / cm-typewriter-scroll-obsidian

Typewriter Scroll Obsidian Plugin
169 stars 15 forks source link

RFE: Highlight current line #44

Open gbraad opened 1 year ago

gbraad commented 1 year ago

Instead of darkening the rest of the text, is it possible to use a background color for the line? Perhaps even scale the line a little to increase visibility even more?

gbraad commented 1 year ago

The following works for me

body.plugin-cm-typewriter-scroll-zen .CodeMirror-lines.selecting .CodeMirror-code > .CodeMirror-activeline {
  background-color: #333333;
}

body.plugin-cm-typewriter-scroll-zen .cm-editor.cm-focused .cm-line.cm-active {                                   
  background-color: #333333;
}

Screenshot from 2023-02-19 15-33-18

Besides the color I also played around with padding and scaling which gives some nice results.

  transform: scale(1.05);
  padding-top: 8px;
  padding-bottom: 8px;

Screenshot from 2023-02-19 15-28-57

Options for this would be nice to have. WDYT?

AtlcatlQ commented 1 year ago

Or, you can simply use Minimal Theme and Style Settings.

image

You can edit that and another lot of things directly

gbraad commented 1 year ago

Another set of plugins is not always the solution. Already have 60MB+ of plugins compared to a few kilobytes of actual text files.

Minimal Theme

I am not using the Minimal theme

Style Settings

This might be an option, however I believe these changes go well with the Typewriter plugin as they concern the same. (Style Settings will ONLY allow this when Minimal is also used).

davisriedel commented 1 year ago

I like having the line in which the cursor is positioned highlighted. I also found several snippets using .cm-line.cm-active on the web, but those highlight the whole paragraph and not just the line where the cursor is (and where the scroll is fixed to). Since I thought I could save myself some time by putting the feature in this plugin, I started implementing this on my fork https://github.com/davisriedel/cm-typewriter-scroll-obsidian.

Does that type of line highlight sound interesting to anyone else? Then I could polish the feature a bit more and open a PR.

FelipeRearden commented 1 year ago

@davisriedel

Fantastic idea. I would like to have this feature too !!!!

davisriedel commented 1 year ago

I now have a working example of this in my fork in the highlight-typewriter-line branch. Feel free to check it out!

Since I needed to disable the typewriter line highlight while scrolling I was able to reuse the code to also implement issue #28. You can find this in my fork in the zen branch and in main.

Note that now the text snaps into the typewriter offset when clicking the text again after scrolling. This only makes sense if a fixed typewriter line is displayed. But I could easily implement a toggle to preserve the old behavior unless using the highlighted typewriter line. Do you want me to do so before submitting a PR?

Furthermore, because everything started to increase in complexity I also refactored and restructured the code quite a bit - would that be a problem if I open a PR?

FelipeRearden commented 1 year ago

Furthermore, because everything started to increase in complexity I also refactored and restructured the code quite a bit - would that be a problem if I open a PR?

Let me just share an idea that I had while I was reading your post...

How about creating a new plugin instead of a PR?

This plugin is not updated for almost a year and we dont have a feedback fro the developer on issues in this plugin and in other plugins from this developer for many many years.

→ The same thing occurred with the Maximised Active Panel that was integrated inside the Pane Relief plugin.

My humble opinion is that we have an amazing plugin BUT we need some updates/adjustments/refactor that are vital to the long term. Since you are interested in develop these updates/adjustments/refactor, I think the best way to continue this is in a new plugin :)

davisriedel commented 1 year ago

This is a good idea. Creating a new plugin would give me even more freedom for adjustments. I will start working on it as soon as my time allows :)

FelipeRearden commented 1 year ago

This is a good idea. Creating a new plugin would give me even more freedom for adjustments. I will start working on it as soon as my time allows :)

Thats great news @davisriedel !!!! Let me know when you have a release that can help you with the tests :)

davisriedel commented 1 year ago

@FelipeRearden thanks for offering your help with testing.

I used the last few days to completely rework the plugin in order to make it more extensibale and I introduced several new features. I published a first pre-release beta in my new repo: https://github.com/davisriedel/obsidian-typewriter-mode. Feel free to try out the plugin and open issues if you find any bugs.

I also intend to implement a few other features that were requested here in this repo.

The plugin is not yet submitted to Obsidian. I want to take some time using and testing it myself before I publish it to Obsidian.

FelipeRearden commented 1 year ago

Hello @davisriedel !

Thank yuo very much for this first pre-release ! I saw your message and I am playing for a few hours in a test vault to get some first impressions.

What I have to say from my end is that things are fantastic !

I am in love with underline it is exactly what I need :) 💙

I think this plugin is gonna be a huge success . I think you are gonna receive many FRs because there are many variations of workflows :)

Let me continue to play for a few days and after the merge in my main vault and I get back to you.

Looking at this release and looking for the roadmap, I think you have an amazing plugin that could be a game changer for Obsidian users.

Let keep talking (now in your repo) and thank you very for creating this project !

I wish you a fantastic day ☀️