Giter VIP home page Giter VIP logo

Comments (9)

sum01 avatar sum01 commented on June 26, 2024

A setting for each language was on purpose.

You're saying you only want your enabled formatters to show up in the settings, and nothing else? If so, that might be doable, but I don't really see a problem with the current approach.

from fmt-micro.

 avatar commented on June 26, 2024

You're saying you only want your enabled formatters to show up in the settings, and nothing else? If so, that might be doable

yes that would be great

but I don't really see a problem with the current approach.

I probably will never program in nearly all of those languages 😄 but I will probably come back to some other settings of micro or other plugins one day or another. Now the fmt plugin bloats it in a way that makes it harder for me to parse for the other useful options.

Apart from that, I installed uncrustify and love it! It just works! I wanted to do something similar in sublime but it seemed a bit more involved so I am happy to see how easy it is in micro!

from fmt-micro.

sum01 avatar sum01 commented on June 26, 2024

So I could remove the create_options() function, which creates empty options, but that doesn't solve this entirely. If someone uses fmt unsetall formattername then it leaves behind empty languages like you don't want.

As far as I'm aware, there isn't a DeleteOption to go with AddOption, so I'd have to edit the settings.json directly, which I'd rather not have to do, as that brings in problems of checking that the file even exists, parsing the json to not mess up other settings, and whatnot.

from fmt-micro.

 avatar commented on June 26, 2024

maybe just go for changing the create_options() and have it improve the current way for the 90% use case and let the deletion be an obligation of the user for the time being?
That would be a very good compromise for me at least.

from fmt-micro.

sum01 avatar sum01 commented on June 26, 2024

That would technically be an "API" change, since it changes the users interaction (even if only when manipulating settings.json directly), which means I'd push to v4 when fixing this.

I'm not against making the move to v4 over something like this, but if I was going to do that then I'd want to address the issue with fmt unsetsall leaving empty options as well, instead of having to move to v5 when that is eventually fixed.

@zyedidia Is there any way of deleting an option previously created with AddOption, instead of just setting to false (or an empty string)? Something like DeleteOption?

from fmt-micro.

 avatar commented on June 26, 2024

not sure how many people rely on that api as of now but better safe than sorry, right.

xkcd
xkcd

good to know you're not against it 👍

from fmt-micro.

sum01 avatar sum01 commented on June 26, 2024

So I'm working on this at the moment, since I have no idea if/when a DeleteOption will be added. Mostly works, but something is mangling the end of the file after trying to write the changed settings.json. Unsure if it's because Micro itself is reading the file while running, or what...

from fmt-micro.

sum01 avatar sum01 commented on June 26, 2024

Hmm.. If I made all of the plugin's settings into its own (Lua) file, then I could read/write/edit at-will without it getting messed up by Micro. Then that file could be included with require() and the path from configDir

That would also allow for any over-rides to dynamically call/get the editor's current settings (tab width, tabs/spaces, etc).

edit: Or maybe just parse the custom commands for some sort of identifier to insert tabwidth & whatnot.

from fmt-micro.

sum01 avatar sum01 commented on June 26, 2024

Continued discussion should take place here https://gitlab.com/sum01/fmt-micro/issues/15

from fmt-micro.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.