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

textobj-lastpat plugin: text object not capturing last character of the match?

Expand Messages
  • zpkarol
    Hi guys, does anyone use textobj-lastpat plugin? http://www.vim.org/scripts/script.php?script_id=2355 I tried it and it seems to have a bug: the text object
    Message 1 of 4 , Dec 28, 2012
    • 0 Attachment
      Hi guys, does anyone use textobj-lastpat plugin?

      http://www.vim.org/scripts/script.php?script_id=2355

      I tried it and it seems to have a bug: the text object omits the last
      character in a match.
      For example, if I start with the following text

      foo bar baz

      Then I do

      /bar<CR>

      The word "bar" is highlighted and the cursor is at first "b" character (as
      expected), but when I try, say

      da/

      I end up with this

      foo r baz

      I would expect the following result:

      foo baz

      Is this behavior correct? And if so, how can I achieve what I want, i.e.
      have a text object that encompasses the whole match?

      Thx for help!
      Karol



      --
      View this message in context: http://vim.1045645.n5.nabble.com/textobj-lastpat-plugin-text-object-not-capturing-last-character-of-the-match-tp5712850.html
      Sent from the Vim - General mailing list archive at Nabble.com.

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Ben Fritz
      ... Is your selection option set to exclusive ? (This is the default if you have behave mswin in your .vimrc). This option causes problems in a *lot* of
      Message 2 of 4 , Dec 28, 2012
      • 0 Attachment
        On Friday, December 28, 2012 2:06:56 PM UTC-6, zpkarol wrote:
        > Hi guys, does anyone use textobj-lastpat plugin?
        >
        >
        >
        > http://www.vim.org/scripts/script.php?script_id=2355
        >
        >
        >
        > I tried it and it seems to have a bug: the text object omits the last
        >
        > character in a match.
        >
        > For example, if I start with the following text
        >
        >
        >
        > foo bar baz
        >
        >
        >
        > Then I do
        >
        >
        >
        > /bar<CR>
        >
        >
        >
        > The word "bar" is highlighted and the cursor is at first "b" character (as
        >
        > expected), but when I try, say
        >
        >
        >
        > da/
        >
        >
        >
        > I end up with this
        >
        >
        >
        > foo r baz
        >
        >
        >
        > I would expect the following result:
        >
        >
        >
        > foo baz
        >
        >
        >
        > Is this behavior correct? And if so, how can I achieve what I want, i.e.
        >
        > have a text object that encompasses the whole match?
        >
        >
        >
        > Thx for help!
        >

        Is your 'selection' option set to 'exclusive'? (This is the default if you have "behave mswin" in your .vimrc). This option causes problems in a *lot* of plugins. Try setting 'selection' to "inclusive". If the problem goes away, alert the plugin maintainer.

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Christian Brabandt
        Hi zpkarol! ... recent Vim version have something like this almost build in. Use dgn to delete the next match. regards, Christian -- Computerviren verbreiten
        Message 3 of 4 , Dec 29, 2012
        • 0 Attachment
          Hi zpkarol!

          On Fr, 28 Dez 2012, zpkarol wrote:

          > Hi guys, does anyone use textobj-lastpat plugin?
          >
          > http://www.vim.org/scripts/script.php?script_id=2355
          >
          > I tried it and it seems to have a bug: the text object omits the last
          > character in a match.
          > For example, if I start with the following text
          >
          > foo bar baz
          >
          > Then I do
          >
          > /bar<CR>
          >
          > The word "bar" is highlighted and the cursor is at first "b" character (as
          > expected), but when I try, say
          >
          > da/
          >
          > I end up with this
          >
          > foo r baz
          >
          > I would expect the following result:
          >
          > foo baz
          >
          > Is this behavior correct? And if so, how can I achieve what I want, i.e.
          > have a text object that encompasses the whole match?

          recent Vim version have something like this almost build in. Use dgn to
          delete the next match.

          regards,
          Christian
          --
          Computerviren verbreiten sich prinzipiell ├╝ber >>garantiert unverseuchte<<
          Disks.

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • zpkarol
          ... have behave mswin in your .vimrc). ... Yep, that was it. Many thanks! I will try to get in touch with the maintainer (Kana Natsuno). -- View this message
          Message 4 of 4 , Dec 29, 2012
          • 0 Attachment
            > Is your 'selection' option set to 'exclusive'? (This is the default if you
            have "behave mswin" in your .vimrc).
            > This option causes problems in a *lot* of plugins. Try setting 'selection'
            > to "inclusive".
            > If the problem goes away, alert the plugin maintainer.

            Yep, that was it. Many thanks! I will try to get in touch with the
            maintainer (Kana Natsuno).




            --
            View this message in context: http://vim.1045645.n5.nabble.com/textobj-lastpat-plugin-text-object-not-capturing-last-character-of-the-match-tp5712850p5712864.html
            Sent from the Vim - General mailing list archive at Nabble.com.

            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          Your message has been successfully submitted and would be delivered to recipients shortly.