mananapr / cfiles

A ncurses file manager written in C with vim like keybindings
MIT License
482 stars 34 forks source link

Enhancement: separate keys to go to next folder and open a file #61

Open desgua opened 3 years ago

desgua commented 3 years ago

I'm sorry I'm not a developer, so I will just describe how I've done that:

      1) Add to config.h:

        // Go Open 
        #define KEY_OPENFILE ';'

      2) Change cf.c:

        -- add (after //Go to child directory around line 2307):

            // Open file 
            case KEY_OPENFILE:
                goOpen();
                break;

        -- add (after function "void goForward() around line 1966):

            /*
                Opens a file 
            */
            void goOpen()
            {
                if(len_preview == -1)
                {
                    // Open file
                    openFile(next_dir);
                    clearFlag = 1;
                }
            }

        -- delete the following lines from goForward function:

            else
            {
                // Open file
                openFile(next_dir);
                clearFlag = 1;
            }