From 0dfaf20fec5256c055c5a6b4341380d7321211af Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Thu, 8 Jan 2026 23:07:13 -0500 Subject: [PATCH] Adjust input spacing in many areas for a more consistent look --- docs/release-notes-archive/2026.md | 2 +- go.mod | 4 ++-- go.sum | 8 ++++---- src/cli/add.go | 1 - src/cli/copyMenu.go | 21 ++++++++++++--------- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/docs/release-notes-archive/2026.md b/docs/release-notes-archive/2026.md index 630ae50..841add2 100644 --- a/docs/release-notes-archive/2026.md +++ b/docs/release-notes-archive/2026.md @@ -22,7 +22,7 @@ This release adds password age-tracking support, a new interactive copy menu, an - gopkg.in/ini.v1 - Bumped - Go: v1.25.4 => 1.25.5 - - github.com/rwinkhart/go-boilerplate: v0.1.0 => v0.1.1 + - github.com/rwinkhart/go-boilerplate: v0.1.0 => v0.2.2 - github.com/rwinkhart/libmutton: v0.4.4 => v0.5.0 - golang.org/x/term: v0.37.0 => v0.38.0 - golang.org/x/sys: v0.38.0 => v0.40.0 diff --git a/go.mod b/go.mod index 2680109..572e913 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,8 @@ go 1.25.5 require ( github.com/charmbracelet/glamour v0.7.0 - github.com/rwinkhart/go-boilerplate v0.1.1 - github.com/rwinkhart/libmutton v0.4.3-0.20260109022300-a54d15e33111 + github.com/rwinkhart/go-boilerplate v0.2.2 + github.com/rwinkhart/libmutton v0.4.3-0.20260109040506-4467a8c7421b golang.org/x/term v0.38.0 ) diff --git a/go.sum b/go.sum index a02322c..18ad274 100644 --- a/go.sum +++ b/go.sum @@ -42,14 +42,14 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rwinkhart/glamour-temp-MUTN v0.7.2 h1:/CBexwkGdL8HuZjO7M0zzjGHaHCr9/r4XTOtUJa+pPE= github.com/rwinkhart/glamour-temp-MUTN v0.7.2/go.mod h1:DN/eJaNQ5h7dgxzfmWFo7By+b82CKEUdNaY6z4R4v3c= -github.com/rwinkhart/go-boilerplate v0.1.1 h1:C+yyscGWeqvNpR91iw0i91zqX0LcxnCr1VOyT7iM4JY= -github.com/rwinkhart/go-boilerplate v0.1.1/go.mod h1:/NVRKGslU20E5xU5YOgXzWxA6aa94BMtv5MtHRTb5Ek= +github.com/rwinkhart/go-boilerplate v0.2.2 h1:SVHTAQU+HWFivtUnDBcfrgClJV5ZmHyFS7/uERh7NKU= +github.com/rwinkhart/go-boilerplate v0.2.2/go.mod h1:/NVRKGslU20E5xU5YOgXzWxA6aa94BMtv5MtHRTb5Ek= github.com/rwinkhart/go-highlite v0.1.1 h1:9TxbRhYVfD/3YaEgNk1BtEiZ0t8/5mxDUZqNMXHodT0= github.com/rwinkhart/go-highlite v0.1.1/go.mod h1:mWLMtCWcyV0BG4NeyPyAUGMjPvI0ds6vXmUq89QwBFA= github.com/rwinkhart/go-winio v0.1.0 h1:b72agLW+dETGmhR3VbcbwnStfgKfc5AfgJOXBJDkaHg= github.com/rwinkhart/go-winio v0.1.0/go.mod h1:ZWa7ssZJT30CCDGJ7fk/2SBTq9BIQrrVjrcss0UW2s0= -github.com/rwinkhart/libmutton v0.4.3-0.20260109022300-a54d15e33111 h1:nxQHhtdRVIUhRAc/5oYTli30tive65c8N7u75dENVWE= -github.com/rwinkhart/libmutton v0.4.3-0.20260109022300-a54d15e33111/go.mod h1:qInUv19lzX1adFNI6Ih/IEVy+pktSTh/yA7cRTdVPH8= +github.com/rwinkhart/libmutton v0.4.3-0.20260109040506-4467a8c7421b h1:ZHOGUddwoUEGC+7eUl+GvOde3S8UjQqddKv2TERTk1k= +github.com/rwinkhart/libmutton v0.4.3-0.20260109040506-4467a8c7421b/go.mod h1:qInUv19lzX1adFNI6Ih/IEVy+pktSTh/yA7cRTdVPH8= github.com/rwinkhart/peercred-mini v0.1.2 h1:4cGWDbv0whvLeVvbUdx84V/9p+2fS+DEXgrA1KxlRFo= github.com/rwinkhart/peercred-mini v0.1.2/go.mod h1:LLHG7YshHEpbpJJP+Il9nx2dnGj5O3VGE32rWmflj0c= github.com/rwinkhart/rcw v0.2.4 h1:FrRSsl+ui1WLmDwqjLSROtFPKqSeGLEfF2SPENt4qP0= diff --git a/src/cli/add.go b/src/cli/add.go index 5eb39b9..6f96dd8 100644 --- a/src/cli/add.go +++ b/src/cli/add.go @@ -48,5 +48,4 @@ func AddEntry(realPath string, entryType uint8) { } else { writeEntryCLI(realPath, decSlice, false, "") } - } diff --git a/src/cli/copyMenu.go b/src/cli/copyMenu.go index 0f3d35a..81f0063 100644 --- a/src/cli/copyMenu.go +++ b/src/cli/copyMenu.go @@ -17,9 +17,10 @@ import ( "github.com/rwinkhart/libmutton/syncclient" ) -// CopyMenu decrypts an entry and allows the user to -// interactively copy fields without having to re-decrypt each time. -// decSlice can be left nil to decrypt the entry specified by vanityPath. +// CopyMenu decrypts an entry and allows the user to interactively copy +// fields without having to re-decrypt each time. decSlice can be left nil +// to decrypt the entry specified by vanityPath. If the entry was provided +// decrypted, CopyMenu assumes it was edited and triggers a sync. func CopyMenu(vanityPath string, decSlice []string, oldPassword string) { realPath := global.GetRealPath(vanityPath) var err error @@ -30,7 +31,7 @@ func CopyMenu(vanityPath string, decSlice []string, oldPassword string) { other.PrintError("Failed to decrypt entry: "+err.Error(), global.ErrorDecryption) } } else { - fmt.Print("\n\n") + fmt.Print("\n") _, err := syncclient.RunJob() if err != nil { other.PrintError("Failed to sync on copy menu entry: "+err.Error(), global.ErrorSyncProcess) @@ -50,11 +51,13 @@ func CopyMenu(vanityPath string, decSlice []string, oldPassword string) { } } - // if no copyable lines are populated, render notes and exit - if len(fieldOptions) < 1 { - EntryReader(vanityPath, decSlice, true) - fmt.Printf("\r%sNo copyable fields present, exiting copy menu...%s\n", back.AnsiWarning, back.AnsiReset) - os.Exit(0) + // if notes are included, preview them + if len(decSlice) > 4 { + EntryReader(vanityPath, append([]string{"", "", "", ""}, decSlice[4:]...), true) + if len(fieldOptions) < 1 { // if notes are the only thing included, exit + fmt.Printf("\r%sNo copyable fields present, exiting copy menu...%s\n", back.AnsiWarning, back.AnsiReset) + os.Exit(0) + } } // set up signal handling for ctrl+c to clear clipboard