Comments (5)
That's actually been a long-standing defect and it used to be worse:
http://sourceforge.net/apps/trac/vrapper/ticket/71
Just be thankful it only moves the cursor to the top of the file now rather than leaving Vrapper in a bad state like it used to.
I understand this defect is extremely annoying. Unfortunately, as the earlier defect states, it's an issue within the bowels of Eclipse. We ask Eclipse where the cursor should go and it responds with '-1'. There probably is a way to fix this, but I haven't stumbled upon it yet. Eclipse doesn't do a very good job of telling us where a fold is. I'll try spending some more time with this defect to see if I have any epiphanies, but I'm not too optimistic.
from vrapper.
It may be naive can you not ask eclipse at all? If the cursor is on line 40 and you say 'O' then you can insert a \n at the beginning of 40, and the cursor can remain on line 40. I chased it down into InsertLineCommand.PRE_CURSOR and I guess it's the p.getLineInformation stuff. Instead of -1 and getEndOffset(), can you do -0 and getStartOffset()?
from vrapper.
The only thing that's naive is my own understanding of the code. I'm not the original author, just the current maintainer. Your idea seems valid and it almost works. The only issue I see so far is the interaction with the SmartIndent feature. When you hit 'enter' in Eclipse, it will auto-indent if you're within an indented block. It will also add a *
at the beginning of the line if you're within a multi-line /** **/
comment. When I change Vrapper to insert a newline at the beginning of the current line it indents the line below the new line that is created. This means it modifies the line you used to be on. If I can figure out how to perform the auto-indent and then the newline rather than the newline and then the auto-indent, this fix looks like it should work. Again, it's all due to my own ignorance; this solution may end up working.
I guess I should also note that if you disable SmartIndent (:set nosmartindent) then the feature works fine. Of course, when you do that you don't get to utilize Eclipse's nifty features so it all depends on how much this defect bothers you.
from vrapper.
I might as well continue jotting down my notes. I have a little better understanding of how the feature works now. When performing a POST_CURSOR insert, it inserts a newline, then an indent, then moves the cursor to the end of that new line. When performing a PRE_CURSOR insert, it basically moves to the previous line and then performs a POST_CURSOR insert as normal. So it always inserts the newline first and then performs the indent.
I'm no closer to finding a solution though. I tried creating a newline at the beginning of the current line, then performing the old PRE_CURSOR operation (which moves up to the new line I just created) but no luck. I tried inserting a newline myself then performing the smart indent with an empty string but no luck. Everything I try either results in no indenting, jumps me to the top of the file, or indents the line I was previously on.
from vrapper.
For anyone following this old issue, I provided a fix which will be included in the next release.
Turns out inserting on a folded line is impossible, but we can open the fold.
from vrapper.
Related Issues (20)
- _vrapperrc HOT 5
- Cannot get rename to work HOT 1
- Replacing something with forward slashes HOT 8
- :reg command doesn't work when used alone HOT 8
- Vrapper not running on Eclipse 4.21.0 HOT 10
- Insert macro with { don't work HOT 2
- Replace regex within visual-box \%V is not working HOT 2
- Can't bind "option+[KEY]" using MacOS. HOT 3
- content assist like navigation in quick assist and hyperlink menus
- Can't change to a different tab that is far away with <C-w><number>gt HOT 2
- Add ":wrap" command line command bind to Eclipse's action "Toggle Word Wrap" HOT 1
- Sub-Word plugin unexpected behaviors
- Adding DVT (a SystemVerilog plugin) action to vrapper keymaps HOT 2
- Vim doesn't work on windows of Table views HOT 2
- Cannot find active input interceptor for error editor HOT 1
- ctrl+v -> i -> w leaves visual block mode
- Typing after double quote locks up Eclipse
- Stay in visual mode while jumping through editor commands
- How to assign the leader key to the spacebar? HOT 3
- Need to integrate vim and emacs plugin HOT 1
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 vrapper.