adamyg / grief

GRIEF - BRIEF clone

Home Page:http://grief.sourceforge.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gr "" doesn't exit correctly

blakemcbride opened this issue · comments

Greetings,

If I run gr, type some text, and then exist with alt-x, gr asks me if I want to exit without saving the unsaved text. However, if I type gr "" it does not. Why?

empty argument, no effect

Sorry, I do not understand your response. To be a little more clear, there are three steps as follows:

# gr ""
abcde
alt-x

Grief does not ask me if I want to exit without saving the unsaved text. However, if I type gr without the "" it does. Why?

gr "", is equivalent is running gr without arguments.

The outcome shall be dependent on the .grinit environment. If restore is enabled, the previous open file shall be reopened, otherwise the default "newfile" shall be opened/created. Testing the second case and a simple edit, result was:

image

gr is opening newfile, whereas gr "" is \*scratch\*.

Scratch refers to the internal temporary/system-buffer aka clip-board, which wont ever be saved since its a system buffer.

Condition is due to the failure to open any files, with scratch being the only available buffer attachable to the main window.
Issue can be addressed by opening a new file, which shall become the new buffer attached to the active window.

Shall tweak startup to ignore empty parameter(s, an unusual use-case.

Note: gr -m mc is similar to vim;s file picker mode, shall consider option to call inline if only a directory is stated on cmdline

opendir