{"action":"created","comment":{"url":"https://api.github.com/repos/XVimProject/XVim/pulls/comments/22414087","id":22414087,"diff_hunk":"@@ -0,0 +1,95 @@\n+//\n+//  XVimReplaceEvaluator.m\n+//  XVim\n+//\n+//  Created by Martin Conte Mac Donell on 12/14/14.\n+//\n+\n+#import \"XVimReplaceEvaluator.h\"\n+#import \"XVimWindow.h\"\n+\n+@interface XVimInsertEvaluator()\n+\n+@property (nonatomic) NSRange startRange;\n+@property (nonatomic) BOOL movementKeyPressed;\n+\n+- (NSString*)insertedText;\n+- (BOOL)windowShouldReceive:(SEL)keySelector;\n+\n+@end\n+\n+@implementation XVimReplaceEvaluator {\n+    BOOL _oneCharMode;\n+}\n+\n+- (float)insertionPointHeightRatio{\n+    return 0.25;\n+}\n+\n+- (float)insertionPointWidthRatio{\n+    return 1.0;\n+}\n+\n+- (float)insertionPointAlphaRatio{\n+    return 0.5;\n+}\n+\n+- (id)initWithWindow:(XVimWindow*)window oneCharMode:(BOOL)oneCharMode mode:(XVimInsertionPoint)mode{\n+    self = [super initWithWindow:window mode:mode];\n+    if (self) {\n+        _oneCharMode = oneCharMode;\n+    }\n+    return self;\n+}\n+\n+- (NSString*)modeString{\n+\treturn @\"-- REPLACE --\";\n+}\n+","path":"XVim/XVimReplaceEvaluator.m","position":48,"original_position":48,"commit_id":"22a18f2f7f8f18979ba9cd385bf6219d19e5cf95","original_commit_id":"22a18f2f7f8f18979ba9cd385bf6219d19e5cf95","user":{"login":"Keithbsmiley","id":283886,"avatar_url":"https://avatars.githubusercontent.com/u/283886?v=3","gravatar_id":"","url":"https://api.github.com/users/Keithbsmiley","html_url":"https://github.com/Keithbsmiley","followers_url":"https://api.github.com/users/Keithbsmiley/followers","following_url":"https://api.github.com/users/Keithbsmiley/following{/other_user}","gists_url":"https://api.github.com/users/Keithbsmiley/gists{/gist_id}","starred_url":"https://api.github.com/users/Keithbsmiley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Keithbsmiley/subscriptions","organizations_url":"https://api.github.com/users/Keithbsmiley/orgs","repos_url":"https://api.github.com/users/Keithbsmiley/repos","events_url":"https://api.github.com/users/Keithbsmiley/events{/privacy}","received_events_url":"https://api.github.com/users/Keithbsmiley/received_events","type":"User","site_admin":false},"body":"I think you want to implement `-mode` as well. Which probably means adding a value to the `XVIM_MODE` enum.","created_at":"2015-01-02T16:21:44Z","updated_at":"2015-01-02T16:21:44Z","html_url":"https://github.com/XVimProject/XVim/pull/667#discussion_r22414087","pull_request_url":"https://api.github.com/repos/XVimProject/XVim/pulls/667","_links":{"self":{"href":"https://api.github.com/repos/XVimProject/XVim/pulls/comments/22414087"},"html":{"href":"https://github.com/XVimProject/XVim/pull/667#discussion_r22414087"},"pull_request":{"href":"https://api.github.com/repos/XVimProject/XVim/pulls/667"}}},"pull_request":{"url":"https://api.github.com/repos/XVimProject/XVim/pulls/667","id":26037942,"html_url":"https://github.com/XVimProject/XVim/pull/667","diff_url":"https://github.com/XVimProject/XVim/pull/667.diff","patch_url":"https://github.com/XVimProject/XVim/pull/667.patch","issue_url":"https://api.github.com/repos/XVimProject/XVim/issues/667","number":667,"state":"open","locked":false,"title":"Preliminary support for 'R' mode","user":{"login":"Reflejo","id":232113,"avatar_url":"https://avatars.githubusercontent.com/u/232113?v=3","gravatar_id":"","url":"https://api.github.com/users/Reflejo","html_url":"https://github.com/Reflejo","followers_url":"https://api.github.com/users/Reflejo/followers","following_url":"https://api.github.com/users/Reflejo/following{/other_user}","gists_url":"https://api.github.com/users/Reflejo/gists{/gist_id}","starred_url":"https://api.github.com/users/Reflejo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reflejo/subscriptions","organizations_url":"https://api.github.com/users/Reflejo/orgs","repos_url":"https://api.github.com/users/Reflejo/repos","events_url":"https://api.github.com/users/Reflejo/events{/privacy}","received_events_url":"https://api.github.com/users/Reflejo/received_events","type":"User","site_admin":false},"body":"Hey, this is a preliminary support for REPLACE mode. I moved the \"oneChar\" boolean to a new ReplaceEvaluator. It works but there are a couple of things missing:\r\n\r\n * 'u' should undo the entire block not char by char.\r\n * When replacing, we should never replacing the newline (end of line). This is an existing bug on the 'r' mode as well.\r\n * When entering \"backspace\" on R mode, vim shows the previous char instead (again, this also is a problem with the existing 'r' mode)\r\n\r\nOther than, I think it's a good idea to create a new evaluator for the Replace Mode instead of having a bool on insert. What do you guys think?","created_at":"2014-12-14T19:33:38Z","updated_at":"2015-01-02T16:21:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"210a082ed100155a271a7f7729dceed7c58e5387","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/XVimProject/XVim/pulls/667/commits","review_comments_url":"https://api.github.com/repos/XVimProject/XVim/pulls/667/comments","review_comment_url":"https://api.github.com/repos/XVimProject/XVim/pulls/comments/{number}","comments_url":"https://api.github.com/repos/XVimProject/XVim/issues/667/comments","statuses_url":"https://api.github.com/repos/XVimProject/XVim/statuses/22a18f2f7f8f18979ba9cd385bf6219d19e5cf95","head":{"label":"Reflejo:R-and-replace-mode","ref":"R-and-replace-mode","sha":"22a18f2f7f8f18979ba9cd385bf6219d19e5cf95","user":{"login":"Reflejo","id":232113,"avatar_url":"https://avatars.githubusercontent.com/u/232113?v=3","gravatar_id":"","url":"https://api.github.com/users/Reflejo","html_url":"https://github.com/Reflejo","followers_url":"https://api.github.com/users/Reflejo/followers","following_url":"https://api.github.com/users/Reflejo/following{/other_user}","gists_url":"https://api.github.com/users/Reflejo/gists{/gist_id}","starred_url":"https://api.github.com/users/Reflejo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reflejo/subscriptions","organizations_url":"https://api.github.com/users/Reflejo/orgs","repos_url":"https://api.github.com/users/Reflejo/repos","events_url":"https://api.github.com/users/Reflejo/events{/privacy}","received_events_url":"https://api.github.com/users/Reflejo/received_events","type":"User","site_admin":false},"repo":{"id":28005153,"name":"XVim","full_name":"Reflejo/XVim","owner":{"login":"Reflejo","id":232113,"avatar_url":"https://avatars.githubusercontent.com/u/232113?v=3","gravatar_id":"","url":"https://api.github.com/users/Reflejo","html_url":"https://github.com/Reflejo","followers_url":"https://api.github.com/users/Reflejo/followers","following_url":"https://api.github.com/users/Reflejo/following{/other_user}","gists_url":"https://api.github.com/users/Reflejo/gists{/gist_id}","starred_url":"https://api.github.com/users/Reflejo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reflejo/subscriptions","organizations_url":"https://api.github.com/users/Reflejo/orgs","repos_url":"https://api.github.com/users/Reflejo/repos","events_url":"https://api.github.com/users/Reflejo/events{/privacy}","received_events_url":"https://api.github.com/users/Reflejo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Reflejo/XVim","description":"Xcode plugin for Vim keybindings","fork":true,"url":"https://api.github.com/repos/Reflejo/XVim","forks_url":"https://api.github.com/repos/Reflejo/XVim/forks","keys_url":"https://api.github.com/repos/Reflejo/XVim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Reflejo/XVim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Reflejo/XVim/teams","hooks_url":"https://api.github.com/repos/Reflejo/XVim/hooks","issue_events_url":"https://api.github.com/repos/Reflejo/XVim/issues/events{/number}","events_url":"https://api.github.com/repos/Reflejo/XVim/events","assignees_url":"https://api.github.com/repos/Reflejo/XVim/assignees{/user}","branches_url":"https://api.github.com/repos/Reflejo/XVim/branches{/branch}","tags_url":"https://api.github.com/repos/Reflejo/XVim/tags","blobs_url":"https://api.github.com/repos/Reflejo/XVim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Reflejo/XVim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Reflejo/XVim/git/refs{/sha}","trees_url":"https://api.github.com/repos/Reflejo/XVim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Reflejo/XVim/statuses/{sha}","languages_url":"https://api.github.com/repos/Reflejo/XVim/languages","stargazers_url":"https://api.github.com/repos/Reflejo/XVim/stargazers","contributors_url":"https://api.github.com/repos/Reflejo/XVim/contributors","subscribers_url":"https://api.github.com/repos/Reflejo/XVim/subscribers","subscription_url":"https://api.github.com/repos/Reflejo/XVim/subscription","commits_url":"https://api.github.com/repos/Reflejo/XVim/commits{/sha}","git_commits_url":"https://api.github.com/repos/Reflejo/XVim/git/commits{/sha}","comments_url":"https://api.github.com/repos/Reflejo/XVim/comments{/number}","issue_comment_url":"https://api.github.com/repos/Reflejo/XVim/issues/comments/{number}","contents_url":"https://api.github.com/repos/Reflejo/XVim/contents/{+path}","compare_url":"https://api.github.com/repos/Reflejo/XVim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Reflejo/XVim/merges","archive_url":"https://api.github.com/repos/Reflejo/XVim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Reflejo/XVim/downloads","issues_url":"https://api.github.com/repos/Reflejo/XVim/issues{/number}","pulls_url":"https://api.github.com/repos/Reflejo/XVim/pulls{/number}","milestones_url":"https://api.github.com/repos/Reflejo/XVim/milestones{/number}","notifications_url":"https://api.github.com/repos/Reflejo/XVim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Reflejo/XVim/labels{/name}","releases_url":"https://api.github.com/repos/Reflejo/XVim/releases{/id}","created_at":"2014-12-14T19:27:37Z","updated_at":"2014-12-14T19:27:38Z","pushed_at":"2014-12-14T19:28:28Z","git_url":"git://github.com/Reflejo/XVim.git","ssh_url":"git@github.com:Reflejo/XVim.git","clone_url":"https://github.com/Reflejo/XVim.git","svn_url":"https://github.com/Reflejo/XVim","homepage":"","size":14386,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"XVimProject:master","ref":"master","sha":"b0f86de4e4b1173f01a9b61879af32b4714380fe","user":{"login":"XVimProject","id":9205331,"avatar_url":"https://avatars.githubusercontent.com/u/9205331?v=3","gravatar_id":"","url":"https://api.github.com/users/XVimProject","html_url":"https://github.com/XVimProject","followers_url":"https://api.github.com/users/XVimProject/followers","following_url":"https://api.github.com/users/XVimProject/following{/other_user}","gists_url":"https://api.github.com/users/XVimProject/gists{/gist_id}","starred_url":"https://api.github.com/users/XVimProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XVimProject/subscriptions","organizations_url":"https://api.github.com/users/XVimProject/orgs","repos_url":"https://api.github.com/users/XVimProject/repos","events_url":"https://api.github.com/users/XVimProject/events{/privacy}","received_events_url":"https://api.github.com/users/XVimProject/received_events","type":"Organization","site_admin":false},"repo":{"id":3430409,"name":"XVim","full_name":"XVimProject/XVim","owner":{"login":"XVimProject","id":9205331,"avatar_url":"https://avatars.githubusercontent.com/u/9205331?v=3","gravatar_id":"","url":"https://api.github.com/users/XVimProject","html_url":"https://github.com/XVimProject","followers_url":"https://api.github.com/users/XVimProject/followers","following_url":"https://api.github.com/users/XVimProject/following{/other_user}","gists_url":"https://api.github.com/users/XVimProject/gists{/gist_id}","starred_url":"https://api.github.com/users/XVimProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XVimProject/subscriptions","organizations_url":"https://api.github.com/users/XVimProject/orgs","repos_url":"https://api.github.com/users/XVimProject/repos","events_url":"https://api.github.com/users/XVimProject/events{/privacy}","received_events_url":"https://api.github.com/users/XVimProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/XVimProject/XVim","description":"Xcode plugin for Vim keybindings","fork":false,"url":"https://api.github.com/repos/XVimProject/XVim","forks_url":"https://api.github.com/repos/XVimProject/XVim/forks","keys_url":"https://api.github.com/repos/XVimProject/XVim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/XVimProject/XVim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/XVimProject/XVim/teams","hooks_url":"https://api.github.com/repos/XVimProject/XVim/hooks","issue_events_url":"https://api.github.com/repos/XVimProject/XVim/issues/events{/number}","events_url":"https://api.github.com/repos/XVimProject/XVim/events","assignees_url":"https://api.github.com/repos/XVimProject/XVim/assignees{/user}","branches_url":"https://api.github.com/repos/XVimProject/XVim/branches{/branch}","tags_url":"https://api.github.com/repos/XVimProject/XVim/tags","blobs_url":"https://api.github.com/repos/XVimProject/XVim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/XVimProject/XVim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/XVimProject/XVim/git/refs{/sha}","trees_url":"https://api.github.com/repos/XVimProject/XVim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/XVimProject/XVim/statuses/{sha}","languages_url":"https://api.github.com/repos/XVimProject/XVim/languages","stargazers_url":"https://api.github.com/repos/XVimProject/XVim/stargazers","contributors_url":"https://api.github.com/repos/XVimProject/XVim/contributors","subscribers_url":"https://api.github.com/repos/XVimProject/XVim/subscribers","subscription_url":"https://api.github.com/repos/XVimProject/XVim/subscription","commits_url":"https://api.github.com/repos/XVimProject/XVim/commits{/sha}","git_commits_url":"https://api.github.com/repos/XVimProject/XVim/git/commits{/sha}","comments_url":"https://api.github.com/repos/XVimProject/XVim/comments{/number}","issue_comment_url":"https://api.github.com/repos/XVimProject/XVim/issues/comments/{number}","contents_url":"https://api.github.com/repos/XVimProject/XVim/contents/{+path}","compare_url":"https://api.github.com/repos/XVimProject/XVim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/XVimProject/XVim/merges","archive_url":"https://api.github.com/repos/XVimProject/XVim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/XVimProject/XVim/downloads","issues_url":"https://api.github.com/repos/XVimProject/XVim/issues{/number}","pulls_url":"https://api.github.com/repos/XVimProject/XVim/pulls{/number}","milestones_url":"https://api.github.com/repos/XVimProject/XVim/milestones{/number}","notifications_url":"https://api.github.com/repos/XVimProject/XVim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/XVimProject/XVim/labels{/name}","releases_url":"https://api.github.com/repos/XVimProject/XVim/releases{/id}","created_at":"2012-02-13T14:00:07Z","updated_at":"2015-01-02T05:56:57Z","pushed_at":"2014-12-14T13:38:45Z","git_url":"git://github.com/XVimProject/XVim.git","ssh_url":"git@github.com:XVimProject/XVim.git","clone_url":"https://github.com/XVimProject/XVim.git","svn_url":"https://github.com/XVimProject/XVim","homepage":"","size":16552,"stargazers_count":2682,"watchers_count":2682,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":364,"mirror_url":null,"open_issues_count":170,"forks":364,"open_issues":170,"watchers":2682,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/XVimProject/XVim/pulls/667"},"html":{"href":"https://github.com/XVimProject/XVim/pull/667"},"issue":{"href":"https://api.github.com/repos/XVimProject/XVim/issues/667"},"comments":{"href":"https://api.github.com/repos/XVimProject/XVim/issues/667/comments"},"review_comments":{"href":"https://api.github.com/repos/XVimProject/XVim/pulls/667/comments"},"review_comment":{"href":"https://api.github.com/repos/XVimProject/XVim/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/XVimProject/XVim/pulls/667/commits"},"statuses":{"href":"https://api.github.com/repos/XVimProject/XVim/statuses/22a18f2f7f8f18979ba9cd385bf6219d19e5cf95"}}}}