Skip to content

Commit 8c5724d

Browse files
authored
Merge pull request #39 from hymkor/push-tsmoxsyvvqyz
`edit` statement: Quit immediately on `q` without a prompt if there are no changes
2 parents edaa5d8 + d1481af commit 8c5724d

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

release_note_en.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ Release notes (English)
66
Fixed a keybinding conflict that rendered row deletion unavailable. The `d` key has been unassigned from the "Set Null" function to restore the `dd` and `dr` commands, following specification changes in Csvi. Field Null assignment remains available via the `x` key. (#35)
77
- `edit` statement: Prevent creation of empty lines at the end of the editable CSV content. ([csvi#79])
88
- (internal changes) Stop using deprecated fields: `csvi.KeyEventArgs.CursorRow` and `CursorCol` ([csvi#80],#38)
9+
- `edit` statement: Quit immediately on `q` without a prompt if there are no changes.([csvi#81],#39)
910

1011
[csvi#79]: https://github.com/hymkor/csvi/pull/79
1112
[csvi#80]: https://github.com/hymkor/csvi/pull/80
13+
[csvi#81]: https://github.com/hymkor/csvi/pull/81
1214

1315
v0.27.3
1416
-------

release_note_ja.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ Release notes (Japanese)
66
レコードの削除操作(`dd`, `dr`)を再び利用可能にした。以前のバージョンでは、Null設定機能を `d` キーにも割り当てていたため、Csvi側の仕様変更(`D` の廃止)に伴い、行削除が実行できない状態になっていた。今回、`d` へのNull設定機能を解除することでこの競合を解消した。※Null設定機能は、引き続き `x` キーで利用可能。 (#35)
77
- `edit`文: 編集対象の CSV データ末尾に空行が生成されないようにした。([csvi#79])
88
- (内部修正) 廃止予定のフィールド `csvi.KeyEventArgs.CursorRow``CursorCol` 使わないようにした ([csvi#80],#38)
9+
- `edit`文: 変更がない場合は `q` で確認なしに終了するようにした。([csvi#81],#39)
910

1011
[csvi#79]: https://github.com/hymkor/csvi/pull/79
1112
[csvi#80]: https://github.com/hymkor/csvi/pull/80
13+
[csvi#81]: https://github.com/hymkor/csvi/pull/81
1214

1315
v0.27.3
1416
-------

spread/view.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ func (viewer *Viewer) edit(title string, validate func(*csvi.CellValidatedEvent)
7575
}
7676

7777
quit := func(app *csvi.KeyEventArgs) (*csvi.CommandResult, error) {
78+
if !app.IsDirty() {
79+
io.WriteString(app, "\n")
80+
return &csvi.CommandResult{Quit: true}, nil
81+
}
82+
7883
ch, err := app.MessageAndGetKey(`"Y": Save&Exit "N": Discard&Exit <ESC>: Cancel(edit)`)
7984
if err != nil {
8085
return nil, err

0 commit comments

Comments
 (0)