Read/Edit DBs with key/value pairs in root

Not sure how 'good' this is, but apparently some people do it, so
we may as well support it.
This commit is contained in:
2021-05-31 09:29:09 -05:00
parent 14bd1cdd41
commit bbe5e92c9c
2 changed files with 50 additions and 6 deletions
+3 -3
View File
@@ -242,7 +242,7 @@ func (screen *BrowserScreen) handleInputKeyEvent(event termbox.Event) int {
} else if p != nil {
if screen.mode == modeChangeKey {
newKey := screen.inputModal.GetValue()
if updatePairKey(screen.currentPath, newKey) != nil {
if err := updatePairKey(screen.currentPath, newKey); err != nil {
screen.setMessage("Error occurred updating Pair.")
} else {
p.key = newKey
@@ -252,7 +252,7 @@ func (screen *BrowserScreen) handleInputKeyEvent(event termbox.Event) int {
}
} else if screen.mode == modeChangeVal {
newVal := screen.inputModal.GetValue()
if updatePairValue(screen.currentPath, newVal) != nil {
if err := updatePairValue(screen.currentPath, newVal); err != nil {
screen.setMessage("Error occurred updating Pair.")
} else {
p.val = newVal
@@ -543,7 +543,7 @@ func (screen *BrowserScreen) drawHeader(style Style) {
headerFileName = filepath.Base(headerFileName)
}
headerString := ProgramName + ": " + headerFileName
count := ((width-len(headerString))/2)+1
count := ((width - len(headerString)) / 2) + 1
if count < 0 {
count = 0
}