Git Product home page Git Product logo

Comments (7)

markonm avatar markonm commented on June 27, 2024

Cursor position is always restored after highlighting. See here. Try to comment out that line and let me now if that's the behavior you want.

from traces.vim.

tmilloff avatar tmilloff commented on June 27, 2024

The cursor position is restored after pressing Enter to complete the command, but not immediately after the highlighted range is created. Commenting out that line merely prevents the cursor position from ever being restored.

from traces.vim.

markonm avatar markonm commented on June 27, 2024

Please provide steps to reproduce. I don't use numbers at all so I'm having hard time grasping the issue.

from traces.vim.

markonm avatar markonm commented on June 27, 2024

What delimiter are you using when the issue happens? I you use ; cursor will be moved but if you use , it will not be moved.

Take a look at: h :;

from traces.vim.

tmilloff avatar tmilloff commented on June 27, 2024

Sorry for such a late reply. Here are a couple recordings that show the issue.
This recording shows the behavior without the plugin.
This other recording shows the behavior with the plugin. Note that after entering the range and move command, the relative line numbers change. However, when I hit enter, the command still works the same as it does without the plugin. This means that I need to remember which line to move to before I finish typing the range and command.

from traces.vim.

markonm avatar markonm commented on June 27, 2024

I uderstand now. You can achieve that behavior with the following:

diff --git a/plugin/traces.vim b/plugin/traces.vim
index 77e23b1..1c25aa5 100644
--- a/plugin/traces.vim
+++ b/plugin/traces.vim
@@ -523,6 +523,7 @@ function! s:highlight(pattern_regex, selection_regex, last_specifier_pattern, ab
     silent! call s:set_cursor_position(a:pattern_regex, a:selection_regex, a:abs_range)
   endif
 
+  call cursor(s:cursor_initial_pos)
   redraw
 endfunction

I could add an option, but that approach has a flaw. Patterns and ranges which are not present on starting screen will not be highlighted. Perhaps, it's better to utilize newly introduced autocommands, CmdlineEnter and CmdlineLeave, to turn off relative numbers when inside command-line?

from traces.vim.

tmilloff avatar tmilloff commented on June 27, 2024

Thanks so much for your quick response! I confirm that does indeed fix the problem. Could you add it as an option, turned off by default? I like that behavior despite not highlighting patterns and ranges on the starting screen, and perhaps others will as well.

from traces.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.