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

How can I update screen from macro?

Expand Messages
  • Eugene Minkovskii
    Hello vim, I m writing the macros. This whill be do something with text by other language (python for example). Then I want to change something at 1234
    Message 1 of 9 , Nov 3, 2003
    • 0 Attachment
      Hello vim,

      I'm writing the macros. This whill be do something with text by other
      language (python for example). Then I want to change something at 1234
      byte-offset. How can I tell to the vim to show this in the screen? In
      normal mode Crtl+L update the screen, but I need to update the screen
      from command or function, to use it in the macros. I need to create
      confirmation dialog. I see the function input, confirm, etc. But I
      need to show at this moment byte at offset on the screen.

      --
      Сенсорно Ваш, Евгений Миньковский
      Yours Sincerely, Eugene Minkovskii

      <emin@...>
    • Keith Roberts
      ... I think :redraw! Will do what you want. IIUC, it forces an immediate update, whereas :exe normal might not do so immediately.
      Message 2 of 9 , Nov 3, 2003
      • 0 Attachment
        >-----Original Message-----
        >From: Eugene Minkovskii [mailto:emin@...]
        >Sent: Monday, November 03, 2003 5:19 AM
        >To: vim@...
        >Subject: How can I update screen from macro?
        >
        >Hello vim,
        >
        >I'm writing the macros. This whill be do something with text by other
        >language (python for example). Then I want to change something at 1234
        >byte-offset. How can I tell to the vim to show this in the screen? In
        >normal mode Crtl+L update the screen, but I need to update the screen
        >from command or function, to use it in the macros. I need to create
        >confirmation dialog. I see the function input, confirm, etc. But I
        >need to show at this moment byte at offset on the screen.

        I think :redraw! Will do what you want. IIUC, it forces an immediate
        update, whereas :exe "normal \<C-L>" might not do so immediately.
      • Eugene Minkovskii
        Çäðàâñòâóéòå vim, ... KR I think :redraw! Will do what you want. IIUC, it forces an immediate KR update, whereas :exe normal might not
        Message 3 of 9 , Nov 4, 2003
        • 0 Attachment
          Здравствуйте vim,

          Monday, November 3, 2003, 10:10:25 PM, you wrote:

          >>-----Original Message-----
          >>From: Eugene Minkovskii [mailto:emin@...]
          >>Sent: Monday, November 03, 2003 5:19 AM
          >>To: vim@...
          >>Subject: How can I update screen from macro?
          >>
          >>Hello vim,
          >>
          >>I'm writing the macros. This whill be do something with text by other
          >>language (python for example). Then I want to change something at 1234
          >>byte-offset. How can I tell to the vim to show this in the screen? In
          >>normal mode Crtl+L update the screen, but I need to update the screen
          >>from command or function, to use it in the macros. I need to create
          >>confirmation dialog. I see the function input, confirm, etc. But I
          >>need to show at this moment byte at offset on the screen.

          KR> I think :redraw! Will do what you want. IIUC, it forces an immediate
          KR> update, whereas :exe "normal \<C-L>" might not do so immediately.

          No, it is not. :( I'll try this, and this is not work!

          I taste following:
          1) I write some python script, "my_script.py"
          2) In this script I wrote following:
          import vim
          vim.command("go 1")
          vim.command("redraw")
          request = vim.eval("confirm('test','Ok')")
          ## or
          ## request = vim.eval("input('How do you do?')")
          3) Then in vim I'm type:
          :pyf my_script.py

          Result: Vim confirmation already working, but vim does not show first
          byte in the file. It is showing only AFTER my_script.py already
          complit execution. I think it is some bug in the vim. Vim does not
          redraw the screen when execution the python script because he think it
          is one command ":pyf my_script.py"

          --
          Сенсорно Ваш, Евгений Миньковский
          Yours Sincerely, Eugene Minkovskii

          <emin@...>
        • Benji Fisher
          ... [snip] ... I think the problem is not that you are using a mapping or a Python script. I think the problem is that vim is waiting for a response from the
          Message 4 of 9 , Nov 4, 2003
          • 0 Attachment
            On Tue, Nov 04, 2003 at 12:36:18PM +0300, Eugene Minkovskii wrote:
            >
            [snip]
            > I taste following:
            > 1) I write some python script, "my_script.py"
            > 2) In this script I wrote following:
            > import vim
            > vim.command("go 1")
            > vim.command("redraw")
            > request = vim.eval("confirm('test','Ok')")
            > ## or
            > ## request = vim.eval("input('How do you do?')")
            > 3) Then in vim I'm type:
            > :pyf my_script.py
            >
            > Result: Vim confirmation already working, but vim does not show first
            > byte in the file. It is showing only AFTER my_script.py already
            > complit execution. I think it is some bug in the vim. Vim does not
            > redraw the screen when execution the python script because he think it
            > is one command ":pyf my_script.py"

            I think the problem is not that you are using a mapping or a Python
            script. I think the problem is that vim is waiting for a response from
            the confirm() function, and it will not redraw the screen until it gets
            one. I suggest the following:

            import vim
            vim.command("go 1")
            vim.command("set ch+=2")
            request = vim.eval("confirm('test','Ok')")
            vim.command("set ch-=2")

            :help 'ch'

            HTH --Benji Fisher
          • Eugene Minkovskii
            Çäðàâñòâóéòå vim, Tuesday, November 4, 2003, 4:42:42 PM, you wrote: [ .......................... skiped .......................... ] BF I
            Message 5 of 9 , Nov 6, 2003
            • 0 Attachment
              Здравствуйте vim,

              Tuesday, November 4, 2003, 4:42:42 PM, you wrote:

              [ .......................... skiped .......................... ]
              BF> I think the problem is not that you are using a mapping or a Python
              BF> script. I think the problem is that vim is waiting for a response from
              BF> the confirm() function, and it will not redraw the screen until it gets
              BF> one. I suggest the following:

              BF> import vim
              BF> vim.command("go 1")
              BF> vim.command("set ch+=2")
              BF> request = vim.eval("confirm('test','Ok')")
              BF> vim.command("set ch-=2")

              BF> :help 'ch'

              So, this don't work too, I'll try it. :((
              But if :redraw command don't work, how the 'cmdheight' can redraw the
              screen?

              --
              Сенсорно Ваш, Евгений Миньковский
              Yours Sincerely, Eugene Minkovskii

              <emin@...>
            • Klaus Bosau
              ... Have you tried :redraw! as well? Klaus
              Message 6 of 9 , Nov 6, 2003
              • 0 Attachment
                On Thu, 6 Nov 2003, Eugene Minkovskii wrote:

                > [...] But if :redraw command don't work, how the 'cmdheight' can
                > redraw the screen?

                Have you tried ":redraw!" as well?

                Klaus
              • Keith Roberts
                ... IIUC, the idea of increasing cmdheight is to allow you to see the confirm() prompt, which might be hidden? Then, once you confirm, the screen will be
                Message 7 of 9 , Nov 6, 2003
                • 0 Attachment
                  >-----Original Message-----
                  >From: Eugene Minkovskii [mailto:emin@...]
                  >Sent: Thursday, November 06, 2003 3:46 AM
                  >To: vim@...
                  >Cc: Benji Fisher
                  >Subject: Re[2]: How can I update screen from macro?
                  >
                  >Здравствуйте vim,
                  >
                  >Tuesday, November 4, 2003, 4:42:42 PM, you wrote:
                  >
                  >[ .......................... skiped .......................... ]
                  >BF> I think the problem is not that you are using a mapping or a
                  >Python
                  >BF> script. I think the problem is that vim is waiting for a response from
                  >BF> the confirm() function, and it will not redraw the screen until it gets
                  >BF> one. I suggest the following:
                  >
                  >BF> import vim
                  >BF> vim.command("go 1")
                  >BF> vim.command("set ch+=2")
                  >BF> request = vim.eval("confirm('test','Ok')")
                  >BF> vim.command("set ch-=2")
                  >
                  >BF> :help 'ch'
                  >
                  >So, this don't work too, I'll try it. :((
                  >But if :redraw command don't work, how the 'cmdheight' can redraw the
                  >screen?

                  IIUC, the idea of increasing 'cmdheight' is to allow you to see the
                  confirm() prompt, which might be hidden? Then, once you confirm, the screen
                  will be redrawn.
                • Eugene Minkovskii
                  Çäðàâñòâóéòå vim, Thursday, November 6, 2003, 7:10:18 PM, you wrote: ... KB Have you tried :redraw! as well? Of course, Klaus, I ll began with
                  Message 8 of 9 , Nov 6, 2003
                  • 0 Attachment
                    Здравствуйте vim,

                    Thursday, November 6, 2003, 7:10:18 PM, you wrote:

                    KB> On Thu, 6 Nov 2003, Eugene Minkovskii wrote:

                    >> [...] But if :redraw command don't work, how the 'cmdheight' can
                    >> redraw the screen?

                    KB> Have you tried ":redraw!" as well?

                    Of course, Klaus, I'll began with it.

                    KB> Klaus



                    --
                    Сенсорно Ваш, Евгений Миньковский
                    Yours Sincerely, Eugene Minkovskii

                    <emin@...>
                  • Eugene Minkovskii
                    úÄÒÁ×ÓÔ×ÕÊÔÅ Keith, ... KR IIUC, the idea of increasing cmdheight is to allow you to see the KR confirm() prompt, which might be hidden? Then,
                    Message 9 of 9 , Nov 6, 2003
                    • 0 Attachment
                      Здравствуйте Keith,

                      Thursday, November 6, 2003, 8:04:08 PM, you wrote:

                      >>-----Original Message-----
                      >>From: Eugene Minkovskii [mailto:emin@...]
                      >>Sent: Thursday, November 06, 2003 3:46 AM
                      >>To: vim@...
                      >>Cc: Benji Fisher
                      >>Subject: Re[2]: How can I update screen from macro?
                      >>
                      >>Здравствуйте vim,
                      >>
                      >>Tuesday, November 4, 2003, 4:42:42 PM, you wrote:
                      >>
                      >>[ .......................... skiped .......................... ]
                      >>BF> I think the problem is not that you are using a mapping or a
                      >>Python
                      >>BF> script. I think the problem is that vim is waiting for a response from
                      >>BF> the confirm() function, and it will not redraw the screen until it gets
                      >>BF> one. I suggest the following:
                      >>
                      >>BF> import vim
                      >>BF> vim.command("go 1")
                      >>BF> vim.command("set ch+=2")
                      >>BF> request = vim.eval("confirm('test','Ok')")
                      >>BF> vim.command("set ch-=2")
                      >>
                      >>BF> :help 'ch'
                      >>
                      >>So, this don't work too, I'll try it. :((
                      >>But if :redraw command don't work, how the 'cmdheight' can redraw the
                      >>screen?

                      KR> IIUC, the idea of increasing 'cmdheight' is to allow you to see the
                      KR> confirm() prompt, which might be hidden? Then, once you confirm, the screen
                      KR> will be redrawn.

                      I think it's bad idea there are many other, and more directly
                      function, :redraw for example.

                      So I'LL TRY ALL OF THIS.

                      --
                      Сенсорно Ваш, Евгений Миньковский
                      Yours Sincerely, Eugene Minkovskii

                      <emin@...>
                    Your message has been successfully submitted and would be delivered to recipients shortly.