Comments (7)
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.
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.
Please provide steps to reproduce. I don't use numbers at all so I'm having hard time grasping the issue.
from traces.vim.
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.
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.
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.
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)
- Preview split HOT 5
- Feature request: support substitution preview for tpope/vim-abolish HOT 10
- Range highlight is off after recent commit HOT 2
- Performance issue: Plugin slows down if there are long lines before the cursor HOT 1
- Conflicts with the improved Ex mode HOT 2
- :,$s/ enters visual mode and selects file till end HOT 3
- feature request: change highlighting color HOT 2
- Substitution preview doesn't show when the substitution string is blank HOT 4
- Doesn't show preview for visual selection HOT 1
- Not able to get it to work using vim-plug. HOT 3
- Display both match and replacement
- Update feature comparison with Neovim
- Support for vim-abolish's substitution HOT 2
- Doesn't work with command line window.
- vim freezes with `:g/^` and `:v/^` HOT 1
- Suggestion: Auto set nohlsearch after done
- E487: Argument must be positive
- When pressing `:` on an empty line with `set debug+=msg`, get error messages
- Setting 'linebreak' messes up highlighting HOT 2
- In visual mode, `:` command input moves the cursor to the end of the selected range HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from traces.vim.