Compare commits
No commits in common. "5868ae2f1321d0aeb5b570577195c3b3bbe3c500" and "491adc52900968a081dc2b08dc0803ca66935cc9" have entirely different histories.
5868ae2f13
...
491adc5290
|
@ -0,0 +1 @@
|
||||||
|
patch type="added" "use 755 for config dir"
|
|
@ -0,0 +1 @@
|
||||||
|
patch type="added" "save position of previous list when going back"
|
|
@ -1,11 +1,5 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [0.1.1] - 2025-01-09
|
|
||||||
|
|
||||||
- use 755 for config dir
|
|
||||||
- save position of previous list when going back
|
|
||||||
- default to nano and warn if no $EDITOR set
|
|
||||||
|
|
||||||
## [0.1.0] - 2025-01-08
|
## [0.1.0] - 2025-01-08
|
||||||
|
|
||||||
initial release: fully supports everything in ttbp, in a backwards-compatible
|
initial release: fully supports everything in ttbp, in a backwards-compatible
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
|
||||||
|
@ -63,17 +61,6 @@ func (graffiti *Graffiti) Event(state *ui.State, event vaxis.Event) (processed b
|
||||||
}
|
}
|
||||||
|
|
||||||
func editGraffiti(state *ui.State) {
|
func editGraffiti(state *ui.State) {
|
||||||
// if $EDITOR isn't set, warn about it, and use nano
|
|
||||||
editor := os.ExpandEnv(os.Getenv("EDITOR"))
|
|
||||||
if editor == "" {
|
|
||||||
editor = "nano"
|
|
||||||
state.Suspend()
|
|
||||||
fmt.Print("$EDITOR not found, using nano. press ↵ to continue")
|
|
||||||
input := bufio.NewScanner(os.Stdin)
|
|
||||||
input.Scan()
|
|
||||||
state.Resume()
|
|
||||||
}
|
|
||||||
|
|
||||||
state.HideCursor()
|
state.HideCursor()
|
||||||
vt := term.New()
|
vt := term.New()
|
||||||
vt.TERM = os.Getenv("TERM")
|
vt.TERM = os.Getenv("TERM")
|
||||||
|
|
17
app/menu.go
17
app/menu.go
|
@ -1,8 +1,6 @@
|
||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
|
@ -25,7 +23,7 @@ const title = ` ___ __
|
||||||
/ _/__ ___ / /__
|
/ _/__ ___ / /__
|
||||||
/ _/ -_) -_) (_-<
|
/ _/ -_) -_) (_-<
|
||||||
/_/ \__/\__/_/___/
|
/_/ \__/\__/_/___/
|
||||||
neofeels 0.1.1`
|
neofeels 0.1.0`
|
||||||
|
|
||||||
func NewMainMenu(index int) *MainMenu {
|
func NewMainMenu(index int) *MainMenu {
|
||||||
return &MainMenu{
|
return &MainMenu{
|
||||||
|
@ -131,24 +129,13 @@ func showManpage(state *ui.State) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func newFeels(state *ui.State) {
|
func newFeels(state *ui.State) {
|
||||||
// if $EDITOR isn't set, warn about it, and use nano
|
|
||||||
editor := os.ExpandEnv(os.Getenv("EDITOR"))
|
|
||||||
if editor == "" {
|
|
||||||
editor = "nano"
|
|
||||||
state.Suspend()
|
|
||||||
fmt.Print("$EDITOR not found, using nano. press ↵ to continue")
|
|
||||||
input := bufio.NewScanner(os.Stdin)
|
|
||||||
input.Scan()
|
|
||||||
state.Resume()
|
|
||||||
}
|
|
||||||
|
|
||||||
state.HideCursor()
|
state.HideCursor()
|
||||||
vt := term.New()
|
vt := term.New()
|
||||||
vt.TERM = os.Getenv("TERM")
|
vt.TERM = os.Getenv("TERM")
|
||||||
vt.Attach(state.PostEvent())
|
vt.Attach(state.PostEvent())
|
||||||
vt.Focus()
|
vt.Focus()
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
err := vt.Start(exec.Command(editor, path.Join(ttbp.PathUserEntries, now.Format("20060102")+".txt")))
|
err := vt.Start(exec.Command(os.ExpandEnv(os.Getenv("EDITOR")), path.Join(ttbp.PathUserEntries, now.Format("20060102")+".txt")))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
8
ui/ui.go
8
ui/ui.go
|
@ -83,11 +83,3 @@ func (state *State) HideCursor() {
|
||||||
func (state *State) Window() vaxis.Window {
|
func (state *State) Window() vaxis.Window {
|
||||||
return state.vx.Window()
|
return state.vx.Window()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (state *State) Suspend() {
|
|
||||||
state.vx.Suspend()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (state *State) Resume() {
|
|
||||||
state.vx.Resume()
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue