Comments (9)
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.
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.
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.
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.
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.
not sure how many people rely on that api as of now but better safe than sorry, right.
good to know you're not against it 👍
from fmt-micro.
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.
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.
Continued discussion should take place here https://gitlab.com/sum01/fmt-micro/issues/15
from fmt-micro.
Related Issues (18)
- Support for "unsupported" filetypes
- Add more formatters in v2
- Get JobSpawn working HOT 2
- Should probably use OOP
- Consider a "lang-pref" option
- Optional user-defined args
- Use display names
- Get formatter on save/run HOT 1
- add google-java-format HOT 11
- Add php support
- Add C/C++/C#/ObjectiveC/D/Java/Pawn/VALA support HOT 2
- Add python support
- Respect user settings (when possible)
- Consider auto-editing the uncrustify cfg HOT 1
- Change gofmt to goimports HOT 1
- Use Luacheck recommendations
- Allow for duplicate supported file-types
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fmt-micro.