Bugs

Here are some of the bugs/omissions that were found so far. This is for the 4.1.0 release.

Themes
  1. Themes are missing the colors for line numbers.
  2. If you select a theme which is improperly formatted (an old theme for example), it changes all colors to purple, making the whole window purple. Would be better if the text is set to a different color so that you don't need to restart the app to restore to the default theme.


Commands
  1. exit_4coder When asking whether to save files before closing, selecting Y doesn't close the app. You need to call the command again to close. bug report
  2. execute_any_cli Calling multiple times and entering different output buffer names messes up the name of the resulting buffer. Seems like it doesn't clear the previous buffer name. bug report


Other
  1. After placing a one line if statement without braces, the next line of code is not indented. bug report
  2. Moving mouse quickly above a buffer drastically increases CPU usage. Edit: You can rebuild the custom library and set it to release. I guess the dll that comes with the app by default is not built with optimizations.


Custom Layer
  1. A command binding may fail to register if the bindings are not in a specific order. From what I tried, a binding will fail to register if you register a key with more modifiers before a key with less modifiers (ctrl+shift+a before ctrl+a). bug report
    1
    2
    Bind(write_hack,         KeyCode_Y, KeyCode_Alt, KeyCode_Control); // was not registered
    Bind(write_note,         KeyCode_Y, KeyCode_Alt); // this one was
    



Fixed bugs
  • Setting the default theme in the config file doesn't seem to work. bug report
  • list_all_functions_*_lister - Displays the non-lister version instead. bug report

Edited by EverCursed on
I have found some other bugs that might be worth adding to the list:

Key Bindings
If you have two bindings to the same key, one with an additional modifier, if the first bound has the additional modifier, the binding will be lost.

Example
Bind(redo, KeyCode_U, KeyCode_Alt, KeyCode_Shift);
Bind(undo, KeyCode_U, KeyCode_Alt);

both Alt-U and Alt-Shift-U will undo. If specified in the opposite order, both work fine.

Commands
If you use the command list_all_functions_current_buffer_lister no lister will be opened, instead you get the same jumptable as the command list_all_functions_current_buffer.

Edited by Thebigfox on
I've fixed the default theme loading issue in my codebase. Here's what I've come up with: https://github.com/4coder-editor/4coder/issues/101
Much appreciated bug reports!

I'm currently working on a patch build, I'll try to remember these, but it will make it easier on me if you post each bug to https://github.com/4coder-editor/4coder/issues

Yes, I noticed that you could report bugs on the github page so I wasn't sure whether I should just delete this. I'll keep it here for now. I also updated the post and included the bug report links if they exist.

I'll submit the bug reports for those I didn't find after Christmas. Merry holidays to everyone here!

Edited by EverCursed on
This might be a potential bug. Anyone else have any issues with the command 'list_all_locations_of_type_definition_of_identifier'? The intended behavior of this command is to look up the type name currently found under the cursor and find the pattern match for the definition of the type and list it where the definition was found. However, I'm getting 'no matches' messages when running this command in some scenarios. For example, this command works properly on my laptop computer but not my desktop computer, running the same code on both. More specifically, the breakdown seems to occur with within the buffer_find_all_matches() internal function. This function is returning a match on my laptop but not my desktop. The code I'm currently testing this with is as follows:

main.cpp
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <windows.h>
#include <stdio.h>
#include "my_class.h"

int main()
{
    printf("hello\n");
    
    bool running{true};
    while(running)
    {
        for(int i{}; i < 10000; ++i)
        {
            printf("Looping! %d\n", i);
        };

        running = false;
    };
    
    MyClass thing{};

    return 0;
}


my_class.h
1
2
3
4
struct MyClass
{
    int x{32};
}



So the definition of 'MyClass' is being discovered on my laptop but not my desktop (running windows 10 on both). I will investigate further and post back, but just seeing if anyone else was having issues with this command.

Edited by Jason on
Okay, so after some testing I think that maybe the reason my struct definitions weren't being found by 4coder was because, on windows, you need the "\r\n" characters to signify a return (in some situations?). So in this 4coder function:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
internal String_Const_u8_Array
user_list_definition_array(Application_Links *app, Arena *arena, String_Const_u8 base_needle){
    String_Const_u8_Array result = {};
    if (base_needle.size > 0){
        result.count = 9;
        result.vals = push_array(arena, String_Const_u8, result.count);
        i32 i = 0;
        result.vals[i++] = (push_u8_stringf(arena, "struct %.*s{"  , string_expand(base_needle)));
        result.vals[i++] = (push_u8_stringf(arena, "struct %.*s\n{", string_expand(base_needle)));
        result.vals[i++] = (push_u8_stringf(arena, "struct %.*s {" , string_expand(base_needle)));
        result.vals[i++] = (push_u8_stringf(arena, "union %.*s{"   , string_expand(base_needle)));
        result.vals[i++] = (push_u8_stringf(arena, "union %.*s\n{" , string_expand(base_needle)));
        result.vals[i++] = (push_u8_stringf(arena, "union %.*s {"  , string_expand(base_needle)));
        result.vals[i++] = (push_u8_stringf(arena, "enum %.*s{"    , string_expand(base_needle)));
        result.vals[i++] = (push_u8_stringf(arena, "enum %.*s\n{"  , string_expand(base_needle)));
        result.vals[i++] = (push_u8_stringf(arena, "enum %.*s {"   , string_expand(base_needle)));
        Assert(i == result.count);
    }
    return(result);
}


when I replace all the "struct %. *s\n" with "struct %. *s\r\n", things seem to work properly.
I have noticed a bug that makes some file extensions not being treated as code. For example, .java and .cs.
Even though this is specified in the config.4coder file:
1
2
// Code Wrapping
treat_as_code = ".java.cpp.c.hpp.h.cc.cs.rs.glsl.m";


Looked into the 4coder source and stumbled upon default_begin_buffer function:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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;
                }
                
#if 0                
                treat_as_code = true;
                
                if (string_match(ext, string_u8_litexpr("cs"))){
                    if (parse_context_language_cs == 0){
                        init_language_cs(app);
                    }
                    parse_context_id = parse_context_language_cs;
                }
                
                if (string_match(ext, string_u8_litexpr("java"))){
                    if (parse_context_language_java == 0){
                        init_language_java(app);
                    }
                    parse_context_id = parse_context_language_java;
                }
                
                if (string_match(ext, string_u8_litexpr("rs"))){
                    if (parse_context_language_rust == 0){
                        init_language_rust(app);
                    }
                    parse_context_id = parse_context_language_rust;
                }
                
                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"))){
                    if (parse_context_language_cpp == 0){
                        init_language_cpp(app);
                    }
                    parse_context_id = parse_context_language_cpp;
                }
                
                // TODO(NAME): Real GLSL highlighting
                if (string_match(ext, string_u8_litexpr("glsl"))){
                    if (parse_context_language_cpp == 0){
                        init_language_cpp(app);
                    }
                    parse_context_id = parse_context_language_cpp;
                }
                
                // TODO(NAME): Real Objective-C highlighting
                if (string_match(ext, string_u8_litexpr("m"))){
                    if (parse_context_language_cpp == 0){
                        init_language_cpp(app);
                    }
                    parse_context_id = parse_context_language_cpp;
                }
#endif


Sure enough, putting string_match(ext, string_u8_litexpr("java")) in the beginning of the code fixed the problem. However, I'm not sure if this is the right way to fix this.