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

treat_as_code not working with .odin files in beta 4.1.6 #256

Open
erpeo93 opened this issue May 23, 2020 · 2 comments
Open

treat_as_code not working with .odin files in beta 4.1.6 #256

erpeo93 opened this issue May 23, 2020 · 2 comments

Comments

@erpeo93
Copy link

erpeo93 commented May 23, 2020

The .odin files aren't interpreted as code even if I added the .odin extension in the config.4coder file:
treat_as_code = ".hp.odin.cpp.c.hpp.h.cc.cs.java.rs.glsl.m.mm";

It was working perfectly with my previous 4coder version: alpha 4.0.29.

@mrmixer
Copy link

mrmixer commented May 24, 2020

If you have access to the customization layer here is a quick fix: in 4coder_default_hooks.cpp in the default_begin_buffer hook, you can change the code to set treat_as_code to true after the first if. I believe the second tests are to avoid running the lexer and other code related functionalities that might break on unsupported languages. This still needs to be addressed though, so don't close the issue.

if (string_match(ext, extensions.strings[i])){
    treat_as_code = true;
    /*
    if (string_match(ext, string_u8_litexpr("cpp")) ||
        string_match(ext, string_u8_litexpr("h")) ||
        string_match(ext, string_u8_litexpr("c")) ||
        string_match(ext, string_u8_litexpr("hpp")) ||
        string_match(ext, string_u8_litexpr("cc"))){
        treat_as_code = true;
    } */
    ...
}

@erpeo93
Copy link
Author

erpeo93 commented May 26, 2020

Thank you, the workaround has done its job perfectly.

Leonardo

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

No branches or pull requests

2 participants