Conversation
|
This sounds nice. I'll take a look later. |
|
|
||
| {"exi[t]", event.Quit}, | ||
| {"q[uit]", event.Quit}, | ||
| {"q!", event.ForceQuit}, |
There was a problem hiding this comment.
I think it's better to support q[uit]! but I remember I didn't implement the parser to accept this so I'll fix this after merging.
There was a problem hiding this comment.
Yes, I tried q[uit]! as well, but failed due to the parsing. Do you want me to add a failing test case for q[uit]! ?
There was a problem hiding this comment.
No, thanks. I'll take care of it.
|
Your pull request updates unsavedChanges for only some limited operations. You can find all the changes by searching /b.buffer./, for example, changes sample: @@ -356,11 +356,13 @@ func (w *window) state(width, height int) (*state.WindowState, error) {
func (w *window) insert(offset int64, c byte) {
w.buffer.Insert(offset, c)
w.changedTick++
+ w.modified = true
}
func (w *window) replace(offset int64, c byte) {
w.buffer.Replace(offset, c)
w.changedTick++
+ w.modified = true
}
func (w *window) undoReplace(offset int64) { |
|
Hey @itchyny, Thanks for reviewing my PR! :) I have updated the files as requested, would you mind taking another look? Best regards! |
|
Great, thank you. |
|
Now that I improved the cmdline parser, you can use both |
|
Nice thanks! :) @itchyny |
Hey,
I have added the q! command, which discards all changes and quits the editor.
Furthermore, if someone now tries to quit with the q command while changes have not been saved, it will fail and display an error message.
Since this is my first time contributing to a go open source project, I would appreciate any feedback!
Best regards,
Dario! :)