Giter VIP home page Giter VIP logo

Comments (3)

Glavin001 avatar Glavin001 commented on May 22, 2024

+1
image

from atom-beautify.

Glavin001 avatar Glavin001 commented on May 22, 2024

I was going to fix this when I realized that the code is already in place:

var editor = atom.workspace.getActiveEditor();
var isSelection = !!editor.getSelectedText();
var softTabs = editor.softTabs;
var tabLength = editor.getTabLength();
var editorOptions = {
'indent_size': softTabs ? tabLength : 1,
'indent_char': softTabs ? ' ' : '\t',
'indent_with_tabs': !softTabs
};

This will correctly pull the the editorOptions and use them as the base. What I believe is really happening is that they are being overridden, intentionally, by the atom-beautify package settings.
The order can be found here:

// All of the options
// Listed in order from default (base) to the one with the highest priority
// Left = Default, Right = Will override the left.
var allOptions = [
editorOptions, // Atom Editor
configOptions, //
homeOptions, // User's Home path
projectOptions // Project path
];

So in the end, I suppose you can say, this is actually intentional and expected because of the order of precedence with the configuration options. There's nothing I can really do because it is truly working as expected: the more specific and ideally accurate variables set in the atom-beautify package settings will always override the options of the editor and I could simply re-order it such that the editor settings have higher priority however they really do not. I want the atom-beautify package settings to take precedence.

I will look into potentially having the default (unset) values for the atom-beautify package settings to be the equivalent of the editor's settings. That'd be a good solution 👍

from atom-beautify.

Glavin001 avatar Glavin001 commented on May 22, 2024

I can retrieve the value with atom.config.get('editor.tabLength'). However, it is unlikely that I will resolve this as the atom-beautify settings has settings for each supported language and should be used and enforced in these cases. Thanks for bringing this to my attention though. For now, use the package settings.

from atom-beautify.

Related Issues (20)

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.