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

ui/colorizer: rebase on maintained fork #203

Merged
merged 1 commit into from
Feb 10, 2024

Conversation

Donnerinoern
Copy link
Contributor

@Donnerinoern Donnerinoern commented Feb 1, 2024

Description

Added a new option for colorizer which, when enabled, will attach colorizer to any buffer with a filetype set in autoAttach.filetypes. I also fixed the indentation on colorizer's DEFAULT_OPTIONS.

Rebased colorizer.nvim on a maintained fork and updated the options accordingly.

Type of change

  • New feature

Checklist

  • My code follows the style and contributing guidelines of this project.
  • I ran Alejandra to format my code (nix fmt).
  • I have performed a self-review of my own code and tested it.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • This change requires a documentation update.
  • I have updated the documentation accordingly.

Screenshots & Logs

image

@NotAShelf
Copy link
Owner

Looks good. Though, I've noticed that nvim-colorizer has been abandoned for a while (4 years at this point) with a maintained fork available with more intuitive configuration options.

Could I ask you to rebase on the maintained fork? It'd save us the trouble of revisiting this plugin later just to change plugins.

@Donnerinoern
Copy link
Contributor Author

Looks good. Though, I've noticed that nvim-colorizer has been abandoned for a while (4 years at this point) with a maintained fork available with more intuitive configuration options.

Could I ask you to rebase on the maintained fork? It'd save us the trouble of revisiting this plugin later just to change plugins.

Nice catch, didn't notice that myself. I was too focused on just adding to what was already there, without making any drastic changes.

I can do a rebase on the fork tomorrow morning.

@FrothyMarrow
Copy link
Contributor

FrothyMarrow commented Feb 2, 2024

@horriblename The maintained fork of the plugin configures the filetypes with a table constructor for lists:

filetypes = {
  'css',
  'javascript',
  html = { mode = 'foreground'; }
}

Regarding this setup, I have noticed that you have an option to collapse a key value pair to just value in toLuaObject by prefixing the key with an @. But I am not sure if that is its intended use case or it should be handled differently.

@horriblename
Copy link
Collaborator

horriblename commented Feb 9, 2024

I actually didn't add that, maybe it was @NotAShelf?

in any case, it might be a bit better to expose a function like this

luaTableWithSequence ["javascript" "java"] {html = {...}}

I'm not sure how to best expose it as an option though

in this particular case, it should be fine just writing everything as

{
  javascript = {} ;
  css = {};
  html = {mode =... ;} ;
} 

edit: ^^ i havent tested this

no matter what we do here it's gonna suck for the user, I recommend just putting the empty tables like above instead of using custom syntax

@Donnerinoern Donnerinoern force-pushed the ui/colorizer branch 2 times, most recently from b2ab317 to 8b520fd Compare February 10, 2024 00:55
@Donnerinoern Donnerinoern reopened this Feb 10, 2024
@Donnerinoern Donnerinoern changed the title colorizer: added autoAttach option ui/colorizer: rebase on maintained fork Feb 10, 2024
@Donnerinoern
Copy link
Contributor Author

This newest solution is comparable to what @horriblename suggested. If there's anything you would like changed, let me know.

horriblename
horriblename previously approved these changes Feb 10, 2024
Copy link
Collaborator

@horriblename horriblename left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@FrothyMarrow
Copy link
Contributor

@NotAShelf Most of the options for the colorizer are wrapped inside the options block. I imagine you named it so because it was passed to the default options during setup. I think naming them defaultOptions or userDefaultOptionswould be more understandable, especially since we now also have filetypes as an option. Additionally, @Donnerinoern, I believe filetypes should be placed outside the options block.

Other than that, it looks good to me. 👍

@NotAShelf
Copy link
Owner

NotAShelf commented Feb 10, 2024

I believe filetypes should be placed outside the options block.

I believe this is a fair point. @Donnerinoern could you move filetypes outside options before I merge this?

@Donnerinoern
Copy link
Contributor Author

I believe this is a fair point. @Donnerinoern could you move filetypes outside options before I merge this?

Done.

@NotAShelf
Copy link
Owner

Will merge once the CI passes.

@NotAShelf NotAShelf merged commit a519c63 into NotAShelf:main Feb 10, 2024
7 checks passed
@NotAShelf
Copy link
Owner

Thanks!

bloxx12 pushed a commit to bloxx12/nvf that referenced this pull request Sep 29, 2024
ui/colorizer: rebase on maintained fork
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

Successfully merging this pull request may close these issues.

4 participants