From e8f2c098c9b9c097856dc03d177523d9bda19d4e Mon Sep 17 00:00:00 2001 From: roodletoof <68161791+roodletoof@users.noreply.github.com> Date: Thu, 6 Jul 2023 21:29:04 +0200 Subject: [PATCH] improved error messages and added some documentation --- init.lua | 59 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/init.lua b/init.lua index 7ea0a50..81ff367 100644 --- a/init.lua +++ b/init.lua @@ -1,39 +1,36 @@ local TAB_WIDTH = 4 local keymap = { - -- n - search_for_files_in_working_directory = '', - search_for_previously_opened_files = '', - live_grep = 'fg', - search_help_pages = 'fh', - - -- n - rename_symbol = 'rn', - code_action = 'ca', - go_to_definition = 'gd', - go_to_implementation = 'gi', - show_references = 'gr', - hovering_documentation = 'K', - - -- n - toggle_file_explorer ='', - -- n leader_key = ';', - split_line = "s", - -- n - move_to_panel_left = '', - move_to_panel_down = '', - move_to_panel_up = '', - move_to_panel_right = '', + search_for_files_in_working_directory = '', -- + search_for_previously_opened_files = '', -- + live_grep = 'g', -- + search_help_pages = 'h', -- + + rename_symbol = 'rn', -- + code_action = 'ca', -- + go_to_definition = 'gd', -- + go_to_implementation = 'gi', -- + show_references = 'gr', -- + hovering_documentation = 'K', -- + + toggle_file_explorer ='', -- + + move_to_panel_left = '', -- + move_to_panel_down = '', -- + move_to_panel_up = '', -- + move_to_panel_right = '', -- + + split_line = "s", -- Splits the current line with comma separated items in paranthesis into multiple lines. -- i, s - autocomplete_abort = '', - autocomplete_confirm = '', - jump_forward_in_snippet = '', - jump_backward_in_snippet = '', - jump_to_snippet_end = '', + autocomplete_abort = '', -- + autocomplete_confirm = '', -- + jump_forward_in_snippet = '', -- + jump_backward_in_snippet = '', -- + jump_to_snippet_end = '', -- } local theme_with_real_colors = true @@ -293,6 +290,8 @@ end ---Then formats all comma separated items within that bracket scope, and splits the line into multiple. ---The function is aware for strings starting with ' or ", and keeps track of how deeply nested it is ---in the brackets. +---The function will properly indent all the lines, but only uses spaces to do so. +---It is currently tied to this init.lua file by a couple of variables. Might become a separate package at some point. ---@type function local split_line do @@ -384,11 +383,11 @@ do end if not last_bracket_i then - print("The opening bracket was not closed") + print("The first opening bracket found after the cursor was not closed on this line.") return end if #comma_indexes == 0 then - print('No comma separated items in the given parenthesis scope') + print('No comma separated items within brackets that were opened and closed after the cursor.') return end