1. 03 8月, 2021 2 次提交
  2. 28 7月, 2021 1 次提交
  3. 27 7月, 2021 3 次提交
  4. 26 7月, 2021 3 次提交
  5. 23 7月, 2021 1 次提交
  6. 20 7月, 2021 1 次提交
  7. 14 7月, 2021 5 次提交
  8. 13 7月, 2021 6 次提交
    • D
      36feb268
    • R
      vi: allow delimiter in ':s' to be escaped · 27592014
      Ron Yorston 提交于
      When regular expressions are allowed in search commands it becomes
      possible to escape the delimiter in search/replace commands.  For
      example, this command will replace '/abc' with '/abc/':
      
         :s/\/abc/\/abc\//g
      
      The code to split the command into 'find' and 'replace' strings
      should allow for this possibility.
      
      VI_REGEX_SEARCH isn't enabled by default.  When it is:
      
      function                                             old     new   delta
      strchr_backslash                                       -      38     +38
      colon                                               4378    4373      -5
      ------------------------------------------------------------------------------
      (add/remove: 1/0 grow/shrink: 0/1 up/down: 38/-5)              Total: 33 bytes
      Signed-off-by: NRon Yorston <rmy@pobox.com>
      Signed-off-by: NDenys Vlasenko <vda.linux@googlemail.com>
      27592014
    • D
      vi: allow regular expressions in ':s' commands · 95ac4a48
      Denys Vlasenko 提交于
      BusyBox vi has never supported the use of regular expressions in
      search/replace (':s') commands.  Implement this using GNU regex
      when VI_REGEX_SEARCH is enabled.
      
      The implementation:
      
      - uses basic regular expressions, to match those used in the search
        command;
      
      - only supports substitution of back references ('\0' - '\9') in the
        replacement string.  Any other character following a backslash is
        treated as that literal character.
      
      VI_REGEX_SEARCH isn't enabled in the default build.  In that case:
      
      function                                             old     new   delta
      colon                                               4036    4033      -3
      ------------------------------------------------------------------------------
      (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-3)               Total: -3 bytes
      
      When VI_REGEX_SEARCH is enabled:
      
      function                                             old     new   delta
      colon                                               4036    4378    +342
      .rodata                                           108207  108229     +22
      ------------------------------------------------------------------------------
      (add/remove: 0/0 grow/shrink: 2/0 up/down: 364/0)             Total: 364 bytes
      
      v2: Rebase.  Code shrink.  Ensure empty replacement string is null terminated.
      Signed-off-by: NAndrey Dobrovolsky <andrey.dobrovolsky.odessa@gmail.com>
      Signed-off-by: NRon Yorston <rmy@pobox.com>
      Signed-off-by: NDenys Vlasenko <vda.linux@googlemail.com>
      95ac4a48
    • R
      vi: improve handling of anchored searches · c76c7874
      Ron Yorston 提交于
      Suppose we search for a git conflict marker '<<<<<<< HEAD' using
      the command '/^<<<'.  Using 'n' to go to the next match finds
      '<<<' on the current line, apparently ignoring the '^' anchor.
      
      Set a flag in the compiled regular expression to indicate that the
      start of the string should not be considered a beginning-of-line
      anchor.  An exception has to be made when the search starts from
      the beginning of the file.  Make a similar change for end-of-line
      anchors.
      
      This doesn't affect a default build with VI_REGEX_SEARCH disabled.
      When it's enabled:
      
      function                                             old     new   delta
      char_search                                          247     285     +38
      Signed-off-by: NRon Yorston <rmy@pobox.com>
      Signed-off-by: NDenys Vlasenko <vda.linux@googlemail.com>
      c76c7874
    • R
      vi: use basic regular expressions for search · 2916443a
      Ron Yorston 提交于
      Both traditional vi and vim use basic regular expressions for
      search.  Also, they don't allow matches to extend across line
      endings.  Thus with the file:
      
         123
         234
      
      the search '/2.*4$' should find the second '2', not the first.
      
      Make BusyBox vi do the same.
      
      Whether or not VI_REGEX_SEARCH is enabled:
      
      function                                             old     new   delta
      ------------------------------------------------------------------------------
      (add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0)                 Total: 0 bytes
      Signed-off-by: NAndrey Dobrovolsky <andrey.dobrovolsky.odessa@gmail.com>
      Signed-off-by: NRon Yorston <rmy@pobox.com>
      Signed-off-by: NDenys Vlasenko <vda.linux@googlemail.com>
      2916443a
    • R
      vi: allow 'gg' to specify a range · b50ac07c
      Ron Yorston 提交于
      Commit 7b93e317 (vi: enable 'dG' command. Closes 11801) allowed
      'G' to be used as a range specifier for change/yank/delete
      operations.
      
      Add similar support for 'gg'.  This requires setting the 'cmd_error'
      flag if 'g' is followed by any character other than another 'g'.
      
      function                                             old     new   delta
      do_cmd                                              4852    4860      +8
      .rodata                                           108179  108180      +1
      ------------------------------------------------------------------------------
      (add/remove: 0/0 grow/shrink: 2/0 up/down: 9/0)                 Total: 9 bytes
      Signed-off-by: NRon Yorston <rmy@pobox.com>
      Signed-off-by: NDenys Vlasenko <vda.linux@googlemail.com>
      b50ac07c
  9. 12 7月, 2021 3 次提交
  10. 11 7月, 2021 5 次提交
  11. 04 7月, 2021 1 次提交
  12. 03 7月, 2021 9 次提交