From a08c05353a8731ed00f96da8b89e7fc67148ea2b Mon Sep 17 00:00:00 2001 From: Snoweuph Date: Tue, 24 Mar 2026 22:22:25 +0100 Subject: [PATCH] not a commit. you're crazy, this is a poem and art --- .editorconfig | 14 ++++++++++ lua/syntax-gaslighting.lua | 54 +++++++++++++++++++++++++++++++------- 2 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c3de011 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf + +indent_style = space +indent_size = 4 +tab_width = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +indent_size = 2 diff --git a/lua/syntax-gaslighting.lua b/lua/syntax-gaslighting.lua index 4157c77..5405be5 100644 --- a/lua/syntax-gaslighting.lua +++ b/lua/syntax-gaslighting.lua @@ -21,18 +21,46 @@ local default_config = { merge_messages = false, filetypes_to_ignore = { "netrw", "NvimTree", "neo-tree", "Telescope", "qf" }, messages = { + -- Actual Gaslighting + "You're not trusting user input, right?", + "Totally not a memory leak... 🚽", "Are you sure this will pass the code quality checks? 🤔", "Is this line really covered by unit tests? 🧐", "I wouldn't commit that line without double checking... 💭", - "Your tech lead might have questions about this one 🤔", - "That's an... interesting way to solve this 🤯", + "sure you didn't forget to guard this? 👀", "Did you really mean to write it this way? 🤔", - "Maybe add a comment explaining why this isn't as bad as it looks? 📝", + "Why?", + "You forgot a ';'.", + "This won't compile, you know this, right?", + "Why is this approach so convoluted? 🌀", + "You didn't actually mean to do this, right?", + "That seems like the wrong approach. ❌", + + -- Grading "Bold choice! Very... creative 💡", - "Please. Tell me Copilot wrote this one... 🤖", - "Totally not a memory leak... 🚽", + "Stack Overflow would delete this faster than you can blink. ❌", + "This has the flavor profile of debt and regret. 💸", + "That's an... interesting way to solve this 🤯", + "I'm pretty sure this violates the Geneva Convention...", + "A rubber duck would just walk away... 🦆", + "Congratulations 🎉, you've invented a problem to solve your solution.", + "This belongs in a modern art museum 🎨, not production...", + "This is sloppier than GObject", + "This code is a cry 😭 for help wrapped in syntax .", "I'd be embarrassed to push this to git if I were you. 😳", + "The questions future you will have... so many... 🤷", + "This reads as much like good code as 'A Brief History of Time' like a poem.", + "I'll give you 'interesting'.", + "The secure coding training clearly didn't stick.", + "You're really 'built different', huh? Like with an extra chromosome... 🧬", + "When did we forget KISS? 🤷", + + -- Grading as a Question + "Your tech lead might have questions about this one 🤔", "Would God forgive you for this? ✝️", + "Please. Tell me Copilot wrote this one... 🤖", + 'Please tell me this isn\'t the "simple" approach. 😰', + "Maybe add a comment explaining why this isn't as bad as it looks? 📝", }, } @@ -70,7 +98,9 @@ function M.setup(user_config) if config.auto_update then api.nvim_create_autocmd({ "BufEnter", "TextChanged", "TextChangedI" }, { - callback = function() M.schedule_update() end, + callback = function() + M.schedule_update() + end, }) end @@ -163,7 +193,9 @@ end --- Update the gaslighting decorations in the current buffer function M.update_decorations() - if not M.is_enabled or shouldIgnoreFileType() then return end + if not M.is_enabled or shouldIgnoreFileType() then + return + end local bufnr = api.nvim_get_current_buf() api.nvim_buf_clear_namespace(bufnr, ns, 0, -1) -- Clear previous decorations @@ -205,8 +237,12 @@ function M.schedule_update() -- Do NOT move this block below `uv.new_timer()`, or the new timer -- will be stopped and closed immediately after being created. if timer then - if timer.stop then timer:stop() end - if timer.close then timer:close() end + if timer.stop then + timer:stop() + end + if timer.close then + timer:close() + end end timer = uv.new_timer()