Coder Social home page Coder Social logo

Comments (8)

fanchangyong avatar fanchangyong commented on August 18, 2024

I encountered the same problem in my cli version vim,but my MacVim is good.

from ag.vim.

fanchangyong avatar fanchangyong commented on August 18, 2024

@mario-grgic Thank you for your awesome solution, it solved the problem,but ,in my version I have to use the following command:

call feedkeys(":let &hlsearch=1", "n")

added a "" before "CR"

Thank you.

from ag.vim.

Numkil avatar Numkil commented on August 18, 2024

Try this please. Tell me how it performs for both of you.

    if exists('g:ag_highlight')
      let @/ = matchstr(a:args, "\\v(-)\@<!(\<)\@<=\\w+|['\"]\\zs.{-}\\ze['\"]")
      call feedkeys(":let &hlsearch=1 \| echo \<CR>", 'n')
    end

This is how it's done in ack.vim

from ag.vim.

fanchangyong avatar fanchangyong commented on August 18, 2024

@Numkil

Error detected while processing function ag#Ag:
line   66:
E121: Undefined variable: s:args
E116: Invalid arguments for function matchstr(s:args, "\\v(-)\@<!(\<)\@<=\\w+|['\"]\\zs.{-}\\ze['\"]")
E15: Invalid expression: matchstr(s:args, "\\v(-)\@<!(\<)\@<=\\w+|['\"]\\zs.{-}\\ze['\"]")

from ag.vim.

Numkil avatar Numkil commented on August 18, 2024

Sorry that is a copy paste error on my behalf, ofcourse it needs to be a:args in ag.vim

from ag.vim.

fanchangyong avatar fanchangyong commented on August 18, 2024

@Numkil
It works,thank you.

from ag.vim.

Numkil avatar Numkil commented on August 18, 2024

I'll make a small pull request for this, I think it's a good idea to keep as much code in common with ack.vim so we can benefit from their work as well and maybe bugs will be found earlier. 👍

from ag.vim.

hunhejj avatar hunhejj commented on August 18, 2024

I frequently switch back and forth between working_path_mode-s and I would normally do this by typing ":let" and then choosing the most recently used let command. However because of this highlighting trick the first result is always ":let &hlsearch=1 (...)" instead of what I await.
@Numkil any ideas, how to get rid of this behaviour?

from ag.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.