-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer refactor #535
base: develop
Are you sure you want to change the base?
Buffer refactor #535
Commits on Nov 18, 2013
-
This object will now be the main entry point to manipulate the content of the textStorage, so that we don't have to extend the NSTextStorage with categories. XVimBuffer is now created each time we learn about a new Document that responds to -textStorage which XCode documents do. XVimBuffer also knows about the undo manager, and is used to be the target of the specific vim action we mean to undo, which means that undoing the cursor positions won't crash anymore (Layout managers and textviews come and go, and it's not correct to make them the target of an undo operation).
Configuration menu - View commit details
-
Copy full SHA for 552460a - Browse repository at this point
Copy the full SHA 552460aView commit details -
Migrate most of XVimTextStoring to XVimBuffer
XVimTextStoring becomes a protocol that you implement when you intend to give better alternatives than the default implementations from XVimBuffer. This commit doesn't alter code, it merely moves some around, and adpt callers.
Configuration menu - View commit details
-
Copy full SHA for 04a77f2 - Browse repository at this point
Copy the full SHA 04a77f2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0211582 - Browse repository at this point
Copy the full SHA 0211582View commit details
Commits on Nov 19, 2013
-
Rework undo to take complete ownership of some operations
This makes editing the text-storage faster than going through the view obviously. Use this as a proof of concept to reimplement the bulk of xvim_shift as -[XVimBuffer shiftLines:column:count:right:block:] The performance that this code reaches now is bluffing compared to the previous one. It's still not nearly as fast as vim, but it's decent. Note that the cursor position handling code is still messy, which makes the number of parameters to that selector properly disgusting, but we're getting there.
Configuration menu - View commit details
-
Copy full SHA for e3bcb62 - Browse repository at this point
Copy the full SHA e3bcb62View commit details -
Configuration menu - View commit details
-
Copy full SHA for 694d02e - Browse repository at this point
Copy the full SHA 694d02eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 01d9100 - Browse repository at this point
Copy the full SHA 01d9100View commit details -
Configuration menu - View commit details
-
Copy full SHA for b9709a6 - Browse repository at this point
Copy the full SHA b9709a6View commit details -
Get rid of the lastVisual* properties on the XVim instance
Move them to a proper ivar of the XVimBuffer instead This is the beginning of moving a lot of stuff there, so that we can capture the buffer state on undo/redo properly.
Configuration menu - View commit details
-
Copy full SHA for 1715526 - Browse repository at this point
Copy the full SHA 1715526View commit details
Commits on Nov 20, 2013
-
Reimplement paragraph moves using XVimBuffer clean methods
As a side effect, this means we now support CRLF properly for this command, which should help for XVimProject#530 Fix a couple of issues in the XVimBuffer methods that this new code spotted.
Configuration menu - View commit details
-
Copy full SHA for 030a795 - Browse repository at this point
Copy the full SHA 030a795View commit details
Commits on Nov 21, 2013
-
Configuration menu - View commit details
-
Copy full SHA for eebc66a - Browse repository at this point
Copy the full SHA eebc66aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 98bb868 - Browse repository at this point
Copy the full SHA 98bb868View commit details -
Configuration menu - View commit details
-
Copy full SHA for a776bfd - Browse repository at this point
Copy the full SHA a776bfdView commit details -
+load really isn't the place to initialize a bundle
http://www.blackdogfoundry.com/blog/creating-an-xcode4-plugin/ says -pluginDidLoad: is.
Configuration menu - View commit details
-
Copy full SHA for 4917b21 - Browse repository at this point
Copy the full SHA 4917b21View commit details -
Add an NSObject(XVimAdditions) category for swizzling
Hooker is really a disgusting hack which uses Hook classes for no good purposes and does no compile time check. Let's use this to modify the behavior of (typically) NSTextView and NSTextStorage if they have xvim_* objects associated with them.
Configuration menu - View commit details
-
Copy full SHA for 51f6b2d - Browse repository at this point
Copy the full SHA 51f6b2dView commit details -
Have an XVimView much like we have an XVimBuffer
+[XVimView initialize] swizzles NSTextView like we used to do on the DVT one. Nothing was really DVT speciic in the DVTSourceTextViewHook in the first place. The swizzling does nothing if there is no XVimView associated with the NSTextView, or if XVim is disabled. All that is non specific to XCode. Rewrite IDEEditorHook as an IDEEditor+XVim category with swizzling. In the -didSetupEditor override, detect when there are DVTSourceTextView's that are the one we know what to do with. Check their document has a file:// URL (so that the script editor in the Xcode rules are ignored). If the textStorage happens to already be created, allocate the XVimBuffer right away. In theory we would have to check when the document for a given TextView changes whether we still support XVim, but XCode actually destroys and recreates the view each time you switch documents, so it doesn't matter.
Configuration menu - View commit details
-
Copy full SHA for 09bc132 - Browse repository at this point
Copy the full SHA 09bc132View commit details -
Configuration menu - View commit details
-
Copy full SHA for f93d3a6 - Browse repository at this point
Copy the full SHA f93d3a6View commit details -
Configuration menu - View commit details
-
Copy full SHA for b7b911c - Browse repository at this point
Copy the full SHA b7b911cView commit details -
Move the IDEWorkspaceWindowHook as a swizzle in XVimHookManager
It's disabled by default because it only make sense for debugging purposes.
Configuration menu - View commit details
-
Copy full SHA for 3afd25b - Browse repository at this point
Copy the full SHA 3afd25bView commit details
Commits on Nov 22, 2013
-
Configuration menu - View commit details
-
Copy full SHA for e73d9d5 - Browse repository at this point
Copy the full SHA e73d9d5View commit details -
Get rid of Hooker, move DVTSourceTextScrollView to a swizzling class too
And fix a silly bug with the swizzling category when the class doesn't override the selector we're swizzling.
Configuration menu - View commit details
-
Copy full SHA for e234ef0 - Browse repository at this point
Copy the full SHA e234ef0View commit details -
Get rid of XVimTextViewProtocol
it's replaced by XVimView/XVimBuffer. It's a nice reference of the things to have though.
Configuration menu - View commit details
-
Copy full SHA for 559770f - Browse repository at this point
Copy the full SHA 559770fView commit details -
Configuration menu - View commit details
-
Copy full SHA for c068d4a - Browse repository at this point
Copy the full SHA c068d4aView commit details -
Make the XCode project happier
Do not hardcode XCode path to /Applications/Xcode 2.app, and find the framework relative the $DEVELOPER_DIR, which will do what's right. Upgrade warnings for XCode 5
Configuration menu - View commit details
-
Copy full SHA for c55fcb6 - Browse repository at this point
Copy the full SHA c55fcb6View commit details -
To help debugging: log exceptions to the console right away
It's been a huge help for development for me.
Configuration menu - View commit details
-
Copy full SHA for ea25af4 - Browse repository at this point
Copy the full SHA ea25af4View commit details -
Refactor character swaps operators into XVimBuffer
Fold the Tilde/Lower/Upper (and Rot13) into a single SwapChar evaluator. Fix various repeat issues with those. Use it in the normal, visual, GAction and GVisual evaluators as required. This obviously uses the new undo architecture, hence should be faster
Configuration menu - View commit details
-
Copy full SHA for 7533e08 - Browse repository at this point
Copy the full SHA 7533e08View commit details -
Do not call xvim_replaceCharacters with a non printable one
fixes 3r<Right>
Configuration menu - View commit details
-
Copy full SHA for 598f882 - Browse repository at this point
Copy the full SHA 598f882View commit details
Commits on Nov 24, 2013
-
Refactor NSTextView(VimOperation) into the XVimView
This is a huge refactor that makes the code more independant, more efficient, and acting on XVimView's and XVimBuffer's as much as possible. In particular, this commit tries not to use any NSTextView methods to modify the content, which has several important side effects: - it's more efficient, since we don't go through all the XCode logic to handle edits (it's really a waste when we're doing block operationst typically), performance for several operations is visibly faster than it used to be; - it's better for the user as this goes below XCode AutoCompletion code, and doesn't pop up spurious dialogs when you're in command mode anymore; - this goes through our Undo logic which allows exact coalescing and cursor placement, instead of relying on the Appkit doing the right thing before. (and it doesn't for insertion, but we'll get to that at some point). This commit also does tons of cleanups with the selection and movement, notably fixing behavior when MOTION_END_OF_LINE ($) is used, as this should be preserved, and wasn't Note that for now XVimView is still XCode dependant, because I didn't write a category to swizzle XCode classes, and didn't write a protocol for the TextView yet. Such a protocol will include anything that is rendering related, like placeholder handling. Indenting should go to the NSTextStorage instead, as it's strictly content related. I wouldn't be surprised there are a couple of regression, crashers, but the test-suite passes, and I'm living on that patch now.
Configuration menu - View commit details
-
Copy full SHA for 50b42ef - Browse repository at this point
Copy the full SHA 50b42efView commit details -
I had a bug because it's not on by default in XVim and a property was automatically synthesized because I didn't implement the selector and had no warning.
Configuration menu - View commit details
-
Copy full SHA for 55acaf3 - Browse repository at this point
Copy the full SHA 55acaf3View commit details
Commits on Nov 25, 2013
-
Hunt of DVTKIT: Move -_indentCharacterRange into XVimTextStoring
And implement all the forwarders all the way down.
Configuration menu - View commit details
-
Copy full SHA for f49d75d - Browse repository at this point
Copy the full SHA f49d75dView commit details -
Begin to remove some things from the NSTextStorage category.
Hide some -is* from the NSTextStorage category, move isLastLine as isIndexOnLastLine on XVimBuffer.
Configuration menu - View commit details
-
Copy full SHA for 45b5e26 - Browse repository at this point
Copy the full SHA 45b5e26View commit details -
btw it's not 100% correct because gv doesn't quite do the right thing yet.
Configuration menu - View commit details
-
Copy full SHA for 0f824b8 - Browse repository at this point
Copy the full SHA 0f824b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 890f5ad - Browse repository at this point
Copy the full SHA 890f5adView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7e2d1c8 - Browse repository at this point
Copy the full SHA 7e2d1c8View commit details -
Move some more functions from the NSTextStorage category to XVimBuffer
Those functions are related to position of the index within the line.
Configuration menu - View commit details
-
Copy full SHA for 0c2519e - Browse repository at this point
Copy the full SHA 0c2519eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4fa859c - Browse repository at this point
Copy the full SHA 4fa859cView commit details
Commits on Nov 26, 2013
-
Refactor -{prev,next}{,Line}:... in XVimBuffer
This is now: -indexOfCharMotion:index:options: -indexOfLineMotion:index:column: Implement _/+/-/$/CR/C_m/... using this. Also rename and properly namespace MOTION_OPTION as XVimMotionOptions and the MOPT_ prefix.
Configuration menu - View commit details
-
Copy full SHA for a659427 - Browse repository at this point
Copy the full SHA a659427View commit details -
Fix a few mistakes, and support movement |
When normal-mode replace failed, it used to fail to quit insert mode, which broke several motions. Make -escapeFromInsert take a boolean to know whether in addition to quitting INSERT mode, we should also go backwards. Replace also had an off-by-one that prevented to replace the Last char of the line (a >= comparison really should be >). Add a BAR selector to the XVimMotionEvaluator, and a new MOTION_COLUMN_OF_LINE enum value.
Configuration menu - View commit details
-
Copy full SHA for 4d73d39 - Browse repository at this point
Copy the full SHA 4d73d39View commit details -
Configuration menu - View commit details
-
Copy full SHA for 794f94d - Browse repository at this point
Copy the full SHA 794f94dView commit details -
The reason for that is that when undo is generated by XCode it can leave us in really awkward places. Example, go to the end of a line, type: C<ESC> i.<ESC> u <-- at this point, your cursor is on the end-of-line where it shouldn't be since we're in normal mode. When the undo are generated by us, this of course never happens (or would be a bug).
Configuration menu - View commit details
-
Copy full SHA for ec162f0 - Browse repository at this point
Copy the full SHA ec162f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 832005e - Browse repository at this point
Copy the full SHA 832005eView commit details
Commits on Nov 27, 2013
-
Do not use straight @"\n" in the code
Use the line endings we guess from the first line of the file. This, really fixes dd for me on CRLF files now. It also means we support Classic Mac line endings too (CR-ended lines) Also compute the end-of-line to eat when deleting/yanking at the end properly. This should make things better for XVimProject#530
Configuration menu - View commit details
-
Copy full SHA for 6528a7c - Browse repository at this point
Copy the full SHA 6528a7cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 934c8a2 - Browse repository at this point
Copy the full SHA 934c8a2View commit details
Commits on Dec 1, 2013
-
Improve performance and correctness of the event handling code
Reduce the number of calls on each keystroke by avoiding the -selectorForInstance + instanceResponds + ... calls Avoid using NSStrings to compute the selector, it does malloc()s, a simple buffer + sel_getUid() is faster Use the NS*FunctionKey values from Foundation instead of hardcoded values. And now my XVim stops assert()ing when I use F13 by mistake. Avoid using self.{modifier,character} but access the ivars directly, it's faster. Use iswprint() instead of isPrintable, it's supposed to do what's right...
Configuration menu - View commit details
-
Copy full SHA for 38e71db - Browse repository at this point
Copy the full SHA 38e71dbView commit details -
Do not swizzle KV Observing and -dealloc on NSTextView
both sound like a very bad idea, move that stuff to the XVimView where it belongs. The less we swizzle, the better we are.
Configuration menu - View commit details
-
Copy full SHA for e11416a - Browse repository at this point
Copy the full SHA e11416aView commit details