1/24/2024 0 Comments Wanted textmate sexmateSome features in TextMate 2 have been rethought in terms of multiple carets and new features have been added with multiple carets in mind. That means we got more than we bargained for with our request. If you have read this far and you are like me, you should have one burning question: what made Allan give in? You might like answer: he realized that this feature wasn’t just about the mouse. We asked for the feature and we got it! Is it Really About the Mouse? You are now editing in both locations, so all we have to do is type, EOFError to add it to both lines. Click in either location to move the caret there, then ⌘-click in the second location to add another caret. TextMate 2 makes it trivial to do just that. Here’s where we would like to have our carets (shown with ‸): class IOFilter Assuming our handle_error() method is up to the task, we just need to add the new error in two places. Let’s say we received a bug report and need to add some handling for that error as well. For example, a socket might raise an EOFError when the input is exhausted. There are other errors that can be raised for read operations though. For example, if the object we’re wrapping was opened for writing but not reading, an IOError will be tossed. Rescuing IOError covers some of the things that could go wrong. In Ruby, you might have some code like: class IOFilter It allows you to wrap a file or some other stream and read data from it, but that data is modified on the way in. Pretend we’re building some sort of IO filter.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |