From a293b9e8d35a8435b5c01d8d009b6619c8d5a96a Mon Sep 17 00:00:00 2001 From: Smirnov Oleksandr Date: Wed, 17 Apr 2024 18:32:24 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20LOGGER=E2=84=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/gopher/_utils/init.lua | 4 ++-- lua/gopher/comment.lua | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/gopher/_utils/init.lua b/lua/gopher/_utils/init.lua index d78ea86..a3b567c 100644 --- a/lua/gopher/_utils/init.lua +++ b/lua/gopher/_utils/init.lua @@ -9,7 +9,7 @@ function utils.deferred_notify(msg, lvl) vim.notify(msg, lvl, { title = c.___plugin_name, }) - log.info(msg) + log.debug(msg) end, 0) end @@ -20,7 +20,7 @@ function utils.notify(msg, lvl) vim.notify(msg, lvl, { title = c.___plugin_name, }) - log.info(msg) + log.debug(msg) end -- safe require diff --git a/lua/gopher/comment.lua b/lua/gopher/comment.lua index 002894c..8754405 100644 --- a/lua/gopher/comment.lua +++ b/lua/gopher/comment.lua @@ -3,6 +3,8 @@ ---@usage Execute `:GoCmt` to generate a comment for the current function/method/struct/etc on this line. ---@text This module provides a way to generate comments for Go code. +local log = require "gopher._utils.log" + local function generate(row, col) local ts_utils = require "gopher._utils.ts" local comment, ns = nil, nil @@ -38,6 +40,8 @@ return function() local row, col = unpack(vim.api.nvim_win_get_cursor(0)) local comment, ns = generate(row + 1, col + 1) + log.debug("generated comment: " .. comment) + vim.api.nvim_win_set_cursor(0, { ns.dim.s.r, ns.dim.s.c,