Commit Graph

39 Commits

Author SHA1 Message Date
Peter Slattery d8d99eefdd Removing tracking for generated files 2025-07-07 19:40:08 -07:00
Peter Slattery 73492010b3 render_buffer no longer overwrites the cpp token coloring for keywords 2025-07-07 19:39:30 -07:00
Peter Slattery 3dafcdd950 QOL underline all visible instances of the token the cursor is within 2025-07-07 15:16:07 -07:00
Peter Slattery 50c53649a2 QOL jump stack 2025-07-07 14:47:14 -07:00
Peter Slattery 322f690afc QOL column alignment 2025-07-07 14:31:41 -07:00
Peter Slattery ea389639b3 Search lister jumps 2025-07-07 14:08:40 -07:00
Peter Slattery 01a06a59c7 Cull lister render 2025-07-07 14:07:26 -07:00
Peter Slattery 051b5068e5 Fix redo off by one error 2025-07-07 14:06:38 -07:00
Peter Slattery 1c9fd3e16f goto_next_jump accounts for .cursor_at_end 2025-07-07 14:03:24 -07:00
Simon Anciaux bd7dac90ac Using 4coder string functions in code/4ed_api_parser_main.cpp instead of manually creating the strings.
Added "code/" in the string that point to the generator so it's easier to find the correct files.
Regenerated the 4 affected files (just to update the comment string).
2025-07-07 13:14:30 -07:00
Simon Anciaux 0e2b8d0df8 A user reported on the handmade network discord an issue where when you change the font size (e.g. ctrl + scroll up/down) 4coder was crashing. They were using the D3D11 renderer.
The crash is caused by dereferencing a invalid pointer to a texture. The D3D11 renderer as a arbitrary limit of 32 textures (there is normally no reason to have more than 2 or 3 textures in 4coder) because it needs to keep track of a few pointer in its state, while OpenGL doesn't (it just uses the id returned by `glGenTexture`). The code that recreate the texture atlas when changing the font size, never frees the previous texture, so both DirectX and OpenGL are leaking texture.

So this fix just frees the previous texture after 4coder successfully creates a new one. If for some reason the new texture can't be created, we continue using the last one. This is better than crashing as we can still use 4coder, but since we can't change font size anymore the editor might be stuck with a uncomfortable font size.

Unfortunately 4coder doesn't expose a way to delete texture outside the platform layer, and the font size code is not in the platform layer. So I had to expose a `free texture` function, which lead me to understand how 4coder generates API in the `generated` folder.

I updated the README to keep that information somewhere since it's not clear from the get go. The basic idea is that there are a few files that you can compile as a small standalone program and run to generate the files. For the graphics api, you need to compile `4ed_graphics_api.cpp`.

I took some time to also modify a little the generator so that the generated file contains the name of the file that generated them, and added a bit of indentation to make the file a bit more readable (even if we're not supposed to modify them).
2025-07-07 13:11:48 -07:00
Simon Anciaux c194053b83 4ed_generate_keycodes.cpp adds a comment at the top of the file it generate to specify which file generated it. Added proper indentation in the generated file. Note that this executable needs to be manually ran. The build system doesn't run it.
win32_keycode_init only initialize 30 KeyCode_Ex values (0 to 29) as the code generating the enum only generates that amount (explicitly loops from 0 to < 30).
2025-07-07 13:09:34 -07:00
Peter Slattery 7359649465 Restructure default_render_buffer to only color visible tokens, and only look up tokens that are identifiers 2025-07-07 12:33:29 -07:00
Peter Slattery 2ab0c0a2de Increase Code_Index name_hash size 2025-07-07 12:32:45 -07:00
Peter Slattery 75e72875ff Implement new build system 2025-07-06 12:44:54 -07:00
Peter Slattery 69556235d5 Squashing macro-redefined error in clang 2025-07-06 12:37:41 -07:00
Peter Slattery 0d6a5e4e06 Bindings for replace identifier and replace selection 2025-04-30 12:38:07 -07:00
Peter Slattery b280722b1c set NSApp activateIgnoringOtherApps to YES 2025-04-24 16:18:01 -07:00
PS be632574e6 Added yeet sheet implementation 2024-05-13 19:29:16 -07:00
PS 001cf5fa57 Buffer name resolution simply appends a project relative path for files inside the project and a global path for files outside. 2024-05-13 17:10:09 -07:00
Peter Slattery 2142ef2ce9 Cleaning up line endings on save 2024-04-27 13:43:54 -07:00
PS 120c6ceaad gs_parse_jump_location handles jai paths better 2024-03-27 13:49:52 -07:00
PS 5842d13294 string_find_first_of_set impl 2024-03-27 13:49:29 -07:00
Peter Slattery 3f1c591196 Reverting prior change to map_loose_match 2024-03-26 16:00:50 -07:00
Peter Slattery e33bdffc7d Fixing issue where keyUp events aren't sent for keys that become modified by the command key 2024-03-22 17:55:59 -06:00
Peter Slattery cba2574e8a 4coder_command_map now gets the best match for a given input rather than the first match when Loose Matching 2024-03-22 16:17:44 -06:00
PS 24c8370f75 Indent next line only on hitting enter 2024-02-10 20:12:36 -08:00
PS 18e608a152 Parsing jai style compiler errors 2024-02-10 19:34:25 -08:00
PS 22fa2794e7 Project generation uses treat_as_code extensions to create project include patterns 2024-02-10 18:45:05 -08:00
PS e3ba01570a Backspace in file search deletes whole word 2024-02-10 15:55:05 -08:00
PS 8552305ecc Modal cursor recoloring 2024-02-10 15:43:16 -08:00
PS 7aa033783c Implemented custom modal bindings 2024-02-10 15:38:37 -08:00
PS 0a03ea05f1 Adding dirty file reloading 2024-02-10 14:25:22 -08:00
PS 80b780278a Removed custom/audio 2024-02-10 14:25:13 -08:00
PS 0d840d128e command_metadata.h updated and 4coder project created 2024-02-10 13:02:25 -08:00
Jack Punter 6617beb487 Provide both build and run by default 2024-01-29 19:37:32 +00:00
Jack Punter 51797fd546 Fix v2 project generation 2024-01-29 19:30:09 +00:00
Jack Punter e2b3bd9f3e Correct build for new structure 2022-11-18 16:43:00 +00:00
Jack Punter 0e47ccd2ce Add 'code/' from commit '1459ef7cbce753b056ea148b29c9dc3f8a721261'
git-subtree-dir: code
git-subtree-mainline: cf6a50363e
git-subtree-split: 1459ef7cbc
2022-11-18 13:37:07 +00:00