|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Text Buffer, Word Characters, Undo, Find, and Macro questionsSeveral months ago I decided that I was going to hold off further
development of ViMate until version two of TextMate came out and a documented plugin API was made available. Since version two is being compared to Duke Nukem Forever I probably shouldn't wait. I apologize if any of these are noob Cocoa questions. I use vi on OS X, I'm either a die-hard or a Cocoa-noob. Probably both. ;-) Word Movement: I believe that I need to get access to the text buffer and some list of word and non-word characters so that I can move by word properly. Right now I am using the moveWordForward, moveWordBackwardAndModifySelection... methods to accomplish this but they are inadequate especially near boundaries such as the end of line or end of file. Moving by word will switch from jumping to the beginning of words to jumping to the end of words and back. It's a crap-shoot and is the cause of most of the bugs in the ViMate plugin. Is there a way for me to get access to a list of known word/non-word characters known by TextMate as well as the text buffer and current position so I can implement my own movement and selection commands? Undo: I reworked the ViMate plugin a while back to perform complex edits in a manner that would look to TextMate like one edit and therefore would undo easily without any hacking on the undo manager. Now I need to hook the 'u' command to the built in Undo functionality. How would I do that? Find: vi has the * command that will search and highlight all occurrences of the current word in a file. This is incredibly useful when tracing through code and checking for typographical errors. How do I hook into the Find functionality programatically? Is there a built in way for me to highlight each occurrence of a word at the same time without bringing up the find dialog? Macros: I would like to hook 'q' up to the built in macro recording. Again, where can I find that? kirt _______________________________________________ textmate-plugins mailing list textmate-plugins@... http://lists.macromates.com/mailman/listinfo/textmate-plugins |
|
|
Re: Text Buffer, Word Characters, Undo, Find, and Macro questionsOn 28 Mar 2008, at 18:55, Kirt Fitzpatrick wrote:
> Several months ago I decided that I was going to hold off further > development of ViMate until version two of TextMate came out and a > documented plugin API was made available. Since version two is > being compared to Duke Nukem Forever I probably shouldn't wait. While I still want to downplay any potential release, I am using TM 2 myself now for most stuff. So chances for a beta before summer are good. When a beta is out, I will gladly work a little closer with you to make a functional ViMate plug-in. And anyone who writes me in N months to ask on status for the above can be certain to be excluded from any potential beta program :p > Word Movement: > [...] There really isn’t much more than the NSTextInput protocol to work with here and the string/selection methods (which return the contents as a string). Personally not overly optimistic about the feasibility of this for 1.x. > Undo: > I reworked the ViMate plugin a while back to perform complex edits > in a manner that would look to TextMate like one edit and therefore > would undo easily without any hacking on the undo manager. Now I > need to hook the 'u' command to the built in Undo functionality. > How would I do that? Not sure what you have done to achieve this. Calling undo: doesn’t work? > Find: > vi has the * command that will search and highlight all occurrences > of the current word in a file. This is incredibly useful when > tracing through code and checking for typographical errors. How do > I hook into the Find functionality programatically? Is there a > built in way for me to highlight each occurrence of a word at the > same time without bringing up the find dialog? You can use findNext: to find next occurrence on the find pasteboard (see NSPPasteboard), but highlighting multiple segments is not possible. > Macros: > I would like to hook 'q' up to the built in macro recording. Again, > where can I find that? There are action methods for toggling macro recording and replaying the scratch macro. Probably the easiest way is to open the MainMenu.nib file and look at what the menus are setup to call (I can’t remember off hand). _______________________________________________ textmate-plugins mailing list textmate-plugins@... http://lists.macromates.com/mailman/listinfo/textmate-plugins |
| Free embeddable forum powered by Nabble | Forum Help |