From 01027f71ce872183ef59a70523928c18fcb4d146 Mon Sep 17 00:00:00 2001 From: Wong Jia Hau Date: Thu, 7 Oct 2021 22:06:59 +0800 Subject: [PATCH 1/2] feat(status): add hint --- lua/neogit/status.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/neogit/status.lua b/lua/neogit/status.lua index 852613348..cd395c5e5 100644 --- a/lua/neogit/status.lua +++ b/lua/neogit/status.lua @@ -112,6 +112,8 @@ local function draw_buffer() M.status_buffer:clear_sign_group('fold_markers') local output = LineBuffer.new() + output:append("Hint: [] toggle diff | [s]tage | [u]nstage | [x] discard | [c]ommit | [?] more help") + output:append("") output:append(string.format("Head: %s %s", M.repo.head.branch, M.repo.head.commit_message or '(no commits)')) if M.repo.upstream.branch then output:append(string.format("Push: %s %s", M.repo.upstream.branch, M.repo.upstream.commit_message or '(no commits)')) From ae4d3b8a3768f965d84e9425ba10207b54f3197a Mon Sep 17 00:00:00 2001 From: Wong Jia Hau Date: Fri, 8 Oct 2021 08:31:39 +0800 Subject: [PATCH 2/2] feat(status/hint): add configuration option --- README.md | 4 ++++ lua/neogit/config.lua | 1 + lua/neogit/status.lua | 6 ++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3525f250f..309e46a0c 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,7 @@ local neogit = require("neogit") neogit.setup { disable_signs = false, + disable_hint = false, disable_context_highlighting = false, disable_commit_confirmation = false, auto_refresh = true, @@ -203,6 +204,9 @@ You can override them to fit your colorscheme by creating a `syntax/NeogitStatus Set `disable_context_highlighting = true` in your call to [`setup`](#configuration) to disable context highlighting altogether. +## Disabling Hint +Set `disable_hint = true` in your call to [`setup`](#configuration) to hide hints on top of the panel. + ## Disabling Commit Confirmation Set `disable_commit_confirmation = true` in your call to [`setup`](#configuration) to disable the "Are you sure you want to commit?" prompt after saving the commit message buffer. diff --git a/lua/neogit/config.lua b/lua/neogit/config.lua index 49e71f5f8..977e86978 100644 --- a/lua/neogit/config.lua +++ b/lua/neogit/config.lua @@ -1,6 +1,7 @@ local M = {} M.values = { + disable_hint = false, disable_context_highlighting = false, disable_signs = false, disable_commit_confirmation = false, diff --git a/lua/neogit/status.lua b/lua/neogit/status.lua index cd395c5e5..de3d031a1 100644 --- a/lua/neogit/status.lua +++ b/lua/neogit/status.lua @@ -112,8 +112,10 @@ local function draw_buffer() M.status_buffer:clear_sign_group('fold_markers') local output = LineBuffer.new() - output:append("Hint: [] toggle diff | [s]tage | [u]nstage | [x] discard | [c]ommit | [?] more help") - output:append("") + if not config.values.disable_hint then + output:append("Hint: [] toggle diff | [s]tage | [u]nstage | [x] discard | [c]ommit | [?] more help") + output:append("") + end output:append(string.format("Head: %s %s", M.repo.head.branch, M.repo.head.commit_message or '(no commits)')) if M.repo.upstream.branch then output:append(string.format("Push: %s %s", M.repo.upstream.branch, M.repo.upstream.commit_message or '(no commits)'))