Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Changelog (English)
- Upgrade Microsoft SQL Server driver to v1.10.0
- Upgrade PostgreSQL driver to v1.12.3
- Oracle and SQLite datetime values displayed by select and edit no longer include redundant timezone suffixes. Datetime comparisons are now handled using timezone-independent string conversion. (#55, #57, #58)
- Fix: confirmation to apply changes to the DB was skipped when only NULL values were modified (#59)

v0.27.6
-------
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Changelog (Japanese)
- Upgrade Microsoft SQL Server driver to v1.10.0
- Upgrade PostgreSQL driver to v1.12.3
- SELECT や EDIT で表示される Oracle と SQLite の日時から冗長なタイムゾーンを除いた。日時の照合もタイムゾーンに依存しないよう変換した文字列で行うようにした (#55, #57, #58)
- edit 文で NULL の設定のみを変更した場合、変更反映の確認が行われない不具合を修正 (#59)

v0.27.6
-------
Expand Down
4 changes: 3 additions & 1 deletion spread/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func (viewer *Viewer) View(ctx context.Context, title string, rows rowstocsv.Sou
func (viewer *Viewer) edit(title string, validate func(*csvi.CellValidatedEvent) (string, error), csvWriteTo func(pOut io.Writer) error, termOut io.Writer) (*csvi.Result, error) {

applyChange := false
myDirty := false
setNull := func(e *csvi.KeyEventArgs) (*csvi.CommandResult, error) {
if e.CurrentRow().Index() < viewer.HeaderLines {
return &csvi.CommandResult{}, nil
Expand All @@ -80,11 +81,12 @@ func (viewer *Viewer) edit(title string, validate func(*csvi.CellValidatedEvent)
return &csvi.CommandResult{Message: err.Error()}, nil
}
e.CurrentRow().Replace(e.CurrentCol(), viewer.Null, &uncsv.Mode{Comma: viewer.Comma})
myDirty = true
return &csvi.CommandResult{}, nil
}

quit := func(app *csvi.KeyEventArgs) (*csvi.CommandResult, error) {
if !app.IsDirty() {
if !app.IsDirty() && !myDirty {
io.WriteString(app, "\n")
return &csvi.CommandResult{Quit: true}, nil
}
Expand Down
Loading