Loading ...
Sorry, an error occurred while loading the content.

Edit\Settings menu items

Expand Messages
  • Dan Sharp
    Deep down in the TODO list I found an entry about creating menu items for setting common options. I haven t found any further discussion about this on the
    Message 1 of 2 , Apr 2, 2001
    • 0 Attachment
      Deep down in the TODO list I found an entry about creating menu items for
      setting common options. I haven't found any further discussion about this
      on the list since last December when it was brought up, so here is a quick
      implementation of it. I have included options to toggle the settings for:
      number, wrap, hlsearch, expandtab, toolbar, left/right/bottom scrollbars,
      shiftwidth, and textwidth. Are there any other "basic" settings that
      should go in this menu? Also, I am looking for comments on the textwidth
      implementation. Right now it uses Bram's suggestion of calling input() to
      let the user type in a setting. The only possible problem I have with it
      is that the prompt is displayed in the command line. I think someone new
      to Vim and used to GUIs will be looking for a dialog to come up or assume a
      setting occurred. Also, the users focus has to go from the top of the
      window to the bottom, which is a little unnatural. Granted, they won't be
      able to do anything until they answer the prompt, but it seems like it
      might be a bit confusing at first. The alternative I was considering
      providing defaults similar to shiftwidth, or else pop up a dialog with
      confirm() with buttons representing the defaults (though this would require
      a function, I believe). I have attached a diff against vim60z's menu.vim
      for anyone who wants to try it out.

      Dan Sharp
    • Bram Moolenaar
      ... Looks like a good start. I ll include it, we can tune it further. I agree that a GUI dialog to enter some text would be useful. The simplest ... This
      Message 2 of 2 , Apr 3, 2001
      • 0 Attachment
        Dan Sharp wrote:

        > Deep down in the TODO list I found an entry about creating menu items for
        > setting common options. I haven't found any further discussion about this
        > on the list since last December when it was brought up, so here is a quick
        > implementation of it. I have included options to toggle the settings for:
        > number, wrap, hlsearch, expandtab, toolbar, left/right/bottom scrollbars,
        > shiftwidth, and textwidth. Are there any other "basic" settings that
        > should go in this menu? Also, I am looking for comments on the textwidth
        > implementation. Right now it uses Bram's suggestion of calling input() to
        > let the user type in a setting. The only possible problem I have with it
        > is that the prompt is displayed in the command line. I think someone new
        > to Vim and used to GUIs will be looking for a dialog to come up or assume a
        > setting occurred. Also, the users focus has to go from the top of the
        > window to the bottom, which is a little unnatural. Granted, they won't be
        > able to do anything until they answer the prompt, but it seems like it
        > might be a bit confusing at first. The alternative I was considering
        > providing defaults similar to shiftwidth, or else pop up a dialog with
        > confirm() with buttons representing the defaults (though this would require
        > a function, I believe). I have attached a diff against vim60z's menu.vim
        > for anyone who wants to try it out.

        Looks like a good start. I'll include it, we can tune it further.

        I agree that a GUI dialog to enter some text would be useful. The simplest
        would be:

        :let a = inputdialog("what?")

        This will fall back to using the console prompt when the GUI dialog is not
        available.

        This shouldn't be difficult to implement for the various GUIs. Here is a
        template:

        char_u *
        gui_mch_input(prompt)
        char_u *prompt;
        {
        do_a_dialog(prompt);

        return the_result;
        }

        --
        The fastest way to get an engineer to solve a problem is to declare that the
        problem is unsolvable. No engineer can walk away from an unsolvable problem
        until it's solved.
        (Scott Adams - The Dilbert principle)

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
        \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
      Your message has been successfully submitted and would be delivered to recipients shortly.