{"action":"created","comment":{"url":"https://api.github.com/repos/amiga-mui/texteditor/pulls/comments/85282681","pull_request_review_id":6003977,"id":85282681,"diff_hunk":"@@ -93,25 +133,104 @@ ULONG TextFitNew(struct RastPort *rp, const char *string, ULONG strLen, struct T\n     {\n       // we parsed the string until the end\n       // add the number of fitting remaining characters\n-      result += TextFit(rp, tptr0, strLen0, textExtent, constrainingExtent, strDirection, constrainingBitWidth, constrainingBitHeight);\n+\n+      if (constrainingBitWidth <= SHRT_MAX)\n+      {\n+        if (strLen0 != 0)\n+        {\n+          ULONG l_chars;\n+\n+          l_chars   = TextFit(rp, tptr0, strLen0, &textExtent, constrainingExtent, strDirection, constrainingBitWidth, constrainingBitHeight);\n+          te_width += textExtent.te_Width;\n+          result   += l_chars;\n+        }\n+      }\n+      else\n+      {\n+        ULONG l_constBit = constrainingBitWidth;\n+        ULONG l_chars;\n+\n+        while(l_constBit > SHRT_MAX && strLen0 > 0)\n+        {\n+          LONG l_length;\n+\n+          l_chars  = TextFit(rp, tptr0, strLen0, &textExtent, constrainingExtent, strDirection, SHRT_MAX, constrainingBitHeight);\n+          l_length = textExtent.te_Width;\n+\n+          l_constBit -= l_length;\n+          te_width   += l_length;\n+          strLen0 -= l_chars;\n+          tptr0   += l_chars;\n+          result  += l_chars;\n+        }\n+        if (strLen0 > 0)\n+        {\n+          l_chars = TextFit(rp, tptr0, strLen0, &textExtent, constrainingExtent, strDirection, l_constBit, constrainingBitHeight);\n+          te_width += TextLengthNew(rp, tptr0, l_chars, tabSizePixels);\n+          result += l_chars;\n+        }\n+      }\n       break;\n     }\n \n-    // check the next character\n+    // check the character (and move forward)\n     c = *tptr++;\n     if(c == '\\t')\n     {\n+      ULONG t_length = 0;\n+      ULONG c_length = 0;\n+\n       // we found a TAB, calculate the number of fitting characters so far\n-      if(strLen0 != 0)\n-        result += TextFit(rp, tptr0, strLen0, textExtent, constrainingExtent, strDirection, constrainingBitWidth, constrainingBitHeight);\n+      if (constrainingBitWidth <= SHRT_MAX)","path":"mcc/NewGfx.c","position":136,"original_position":136,"commit_id":"62e38fb4f2d6cfcc005b12d3a7696abaf58b2d13","original_commit_id":"0f43af8ca23d0268deed0adcb8ef55686716ec61","user":{"login":"jens-maus","id":5887769,"avatar_url":"https://avatars.githubusercontent.com/u/5887769?v=3","gravatar_id":"","url":"https://api.github.com/users/jens-maus","html_url":"https://github.com/jens-maus","followers_url":"https://api.github.com/users/jens-maus/followers","following_url":"https://api.github.com/users/jens-maus/following{/other_user}","gists_url":"https://api.github.com/users/jens-maus/gists{/gist_id}","starred_url":"https://api.github.com/users/jens-maus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jens-maus/subscriptions","organizations_url":"https://api.github.com/users/jens-maus/orgs","repos_url":"https://api.github.com/users/jens-maus/repos","events_url":"https://api.github.com/users/jens-maus/events{/privacy}","received_events_url":"https://api.github.com/users/jens-maus/received_events","type":"User","site_admin":false},"body":"remove space between `if` and `(`","created_at":"2016-10-27T07:46:55Z","updated_at":"2016-10-27T08:00:28Z","html_url":"https://github.com/amiga-mui/texteditor/pull/7#discussion_r85282681","pull_request_url":"https://api.github.com/repos/amiga-mui/texteditor/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/amiga-mui/texteditor/pulls/comments/85282681"},"html":{"href":"https://github.com/amiga-mui/texteditor/pull/7#discussion_r85282681"},"pull_request":{"href":"https://api.github.com/repos/amiga-mui/texteditor/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/amiga-mui/texteditor/pulls/7","id":90888105,"html_url":"https://github.com/amiga-mui/texteditor/pull/7","diff_url":"https://github.com/amiga-mui/texteditor/pull/7.diff","patch_url":"https://github.com/amiga-mui/texteditor/pull/7.patch","issue_url":"https://api.github.com/repos/amiga-mui/texteditor/issues/7","number":7,"state":"open","locked":false,"title":"Lots of (re-)implementations to support a horizontal scroller.","user":{"login":"alpyre","id":19547271,"avatar_url":"https://avatars.githubusercontent.com/u/19547271?v=3","gravatar_id":"","url":"https://api.github.com/users/alpyre","html_url":"https://github.com/alpyre","followers_url":"https://api.github.com/users/alpyre/followers","following_url":"https://api.github.com/users/alpyre/following{/other_user}","gists_url":"https://api.github.com/users/alpyre/gists{/gist_id}","starred_url":"https://api.github.com/users/alpyre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alpyre/subscriptions","organizations_url":"https://api.github.com/users/alpyre/orgs","repos_url":"https://api.github.com/users/alpyre/repos","events_url":"https://api.github.com/users/alpyre/events{/privacy}","received_events_url":"https://api.github.com/users/alpyre/received_events","type":"User","site_admin":false},"body":"- Lots of (re-)implementations to support a horizontal scroller in NoWrapMode.\r\n- TextFitNew() and TextLengthNew() are re-implemented to support very large \r\ninput/return values and instead of taking a dummy TextExtent, TextFitNew() now\r\ntakes a TextExtentNew structure which uses LONG type members and fills it properly.\r\nSo that its te.Width member can be used instead of calling another TextLengthNew().\r\nThis provides very good optimization.\r\n- Cursor being drawn out of gadget boundaries issue when in NoWrapMode resolved.\r\n- Issue of highlighted text changing color when edited resolved.\r\n- Experimental MUIA_TextEditor_HorizontalScroll now acts as a switch for turning off\r\n   horizontal scrolling even in NoWrapMode.\r\n- Behaviour of FLG_HScroll re-implemented (now keeps the state of \r\n   MUIA_TextEditor_HorizontalScroll attribute).\r\n- New public attribute MUIA_TextEditor_HorizontalScroller.","created_at":"2016-10-25T20:45:31Z","updated_at":"2016-10-27T08:00:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c0a28e2bdd5c8acb81bf19828e6e6801f493972","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/amiga-mui/texteditor/milestones/1","html_url":"https://github.com/amiga-mui/texteditor/milestones/15.48","labels_url":"https://api.github.com/repos/amiga-mui/texteditor/milestones/1/labels","id":1936944,"number":1,"title":"15.48","description":"","creator":{"login":"tboeckel","id":13648670,"avatar_url":"https://avatars.githubusercontent.com/u/13648670?v=3","gravatar_id":"","url":"https://api.github.com/users/tboeckel","html_url":"https://github.com/tboeckel","followers_url":"https://api.github.com/users/tboeckel/followers","following_url":"https://api.github.com/users/tboeckel/following{/other_user}","gists_url":"https://api.github.com/users/tboeckel/gists{/gist_id}","starred_url":"https://api.github.com/users/tboeckel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tboeckel/subscriptions","organizations_url":"https://api.github.com/users/tboeckel/orgs","repos_url":"https://api.github.com/users/tboeckel/repos","events_url":"https://api.github.com/users/tboeckel/events{/privacy}","received_events_url":"https://api.github.com/users/tboeckel/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":1,"state":"open","created_at":"2016-08-11T14:00:11Z","updated_at":"2016-10-26T11:34:11Z","due_on":"2016-11-01T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/amiga-mui/texteditor/pulls/7/commits","review_comments_url":"https://api.github.com/repos/amiga-mui/texteditor/pulls/7/comments","review_comment_url":"https://api.github.com/repos/amiga-mui/texteditor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amiga-mui/texteditor/issues/7/comments","statuses_url":"https://api.github.com/repos/amiga-mui/texteditor/statuses/62e38fb4f2d6cfcc005b12d3a7696abaf58b2d13","head":{"label":"alpyre:master","ref":"master","sha":"62e38fb4f2d6cfcc005b12d3a7696abaf58b2d13","user":{"login":"alpyre","id":19547271,"avatar_url":"https://avatars.githubusercontent.com/u/19547271?v=3","gravatar_id":"","url":"https://api.github.com/users/alpyre","html_url":"https://github.com/alpyre","followers_url":"https://api.github.com/users/alpyre/followers","following_url":"https://api.github.com/users/alpyre/following{/other_user}","gists_url":"https://api.github.com/users/alpyre/gists{/gist_id}","starred_url":"https://api.github.com/users/alpyre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alpyre/subscriptions","organizations_url":"https://api.github.com/users/alpyre/orgs","repos_url":"https://api.github.com/users/alpyre/repos","events_url":"https://api.github.com/users/alpyre/events{/privacy}","received_events_url":"https://api.github.com/users/alpyre/received_events","type":"User","site_admin":false},"repo":{"id":71933658,"name":"texteditor","full_name":"alpyre/texteditor","owner":{"login":"alpyre","id":19547271,"avatar_url":"https://avatars.githubusercontent.com/u/19547271?v=3","gravatar_id":"","url":"https://api.github.com/users/alpyre","html_url":"https://github.com/alpyre","followers_url":"https://api.github.com/users/alpyre/followers","following_url":"https://api.github.com/users/alpyre/following{/other_user}","gists_url":"https://api.github.com/users/alpyre/gists{/gist_id}","starred_url":"https://api.github.com/users/alpyre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alpyre/subscriptions","organizations_url":"https://api.github.com/users/alpyre/orgs","repos_url":"https://api.github.com/users/alpyre/repos","events_url":"https://api.github.com/users/alpyre/events{/privacy}","received_events_url":"https://api.github.com/users/alpyre/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alpyre/texteditor","description":"A well-known and used MUI custom class (TextEditor.mcc) which provides application programmers a textedit gadget. It supports features like word wrapping, soft styles (bold, italic, underline), a spell checking interface as well as an AREXX interface for scripting.","fork":true,"url":"https://api.github.com/repos/alpyre/texteditor","forks_url":"https://api.github.com/repos/alpyre/texteditor/forks","keys_url":"https://api.github.com/repos/alpyre/texteditor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alpyre/texteditor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alpyre/texteditor/teams","hooks_url":"https://api.github.com/repos/alpyre/texteditor/hooks","issue_events_url":"https://api.github.com/repos/alpyre/texteditor/issues/events{/number}","events_url":"https://api.github.com/repos/alpyre/texteditor/events","assignees_url":"https://api.github.com/repos/alpyre/texteditor/assignees{/user}","branches_url":"https://api.github.com/repos/alpyre/texteditor/branches{/branch}","tags_url":"https://api.github.com/repos/alpyre/texteditor/tags","blobs_url":"https://api.github.com/repos/alpyre/texteditor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alpyre/texteditor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alpyre/texteditor/git/refs{/sha}","trees_url":"https://api.github.com/repos/alpyre/texteditor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alpyre/texteditor/statuses/{sha}","languages_url":"https://api.github.com/repos/alpyre/texteditor/languages","stargazers_url":"https://api.github.com/repos/alpyre/texteditor/stargazers","contributors_url":"https://api.github.com/repos/alpyre/texteditor/contributors","subscribers_url":"https://api.github.com/repos/alpyre/texteditor/subscribers","subscription_url":"https://api.github.com/repos/alpyre/texteditor/subscription","commits_url":"https://api.github.com/repos/alpyre/texteditor/commits{/sha}","git_commits_url":"https://api.github.com/repos/alpyre/texteditor/git/commits{/sha}","comments_url":"https://api.github.com/repos/alpyre/texteditor/comments{/number}","issue_comment_url":"https://api.github.com/repos/alpyre/texteditor/issues/comments{/number}","contents_url":"https://api.github.com/repos/alpyre/texteditor/contents/{+path}","compare_url":"https://api.github.com/repos/alpyre/texteditor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alpyre/texteditor/merges","archive_url":"https://api.github.com/repos/alpyre/texteditor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alpyre/texteditor/downloads","issues_url":"https://api.github.com/repos/alpyre/texteditor/issues{/number}","pulls_url":"https://api.github.com/repos/alpyre/texteditor/pulls{/number}","milestones_url":"https://api.github.com/repos/alpyre/texteditor/milestones{/number}","notifications_url":"https://api.github.com/repos/alpyre/texteditor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alpyre/texteditor/labels{/name}","releases_url":"https://api.github.com/repos/alpyre/texteditor/releases{/id}","deployments_url":"https://api.github.com/repos/alpyre/texteditor/deployments","created_at":"2016-10-25T19:56:11Z","updated_at":"2016-10-25T19:56:13Z","pushed_at":"2016-10-27T07:39:31Z","git_url":"git://github.com/alpyre/texteditor.git","ssh_url":"git@github.com:alpyre/texteditor.git","clone_url":"https://github.com/alpyre/texteditor.git","svn_url":"https://github.com/alpyre/texteditor","homepage":null,"size":1769,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"amiga-mui:master","ref":"master","sha":"780dfe7c823d7fe27db0ec7e872ca5b372109a91","user":{"login":"amiga-mui","id":13694373,"avatar_url":"https://avatars.githubusercontent.com/u/13694373?v=3","gravatar_id":"","url":"https://api.github.com/users/amiga-mui","html_url":"https://github.com/amiga-mui","followers_url":"https://api.github.com/users/amiga-mui/followers","following_url":"https://api.github.com/users/amiga-mui/following{/other_user}","gists_url":"https://api.github.com/users/amiga-mui/gists{/gist_id}","starred_url":"https://api.github.com/users/amiga-mui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amiga-mui/subscriptions","organizations_url":"https://api.github.com/users/amiga-mui/orgs","repos_url":"https://api.github.com/users/amiga-mui/repos","events_url":"https://api.github.com/users/amiga-mui/events{/privacy}","received_events_url":"https://api.github.com/users/amiga-mui/received_events","type":"Organization","site_admin":false},"repo":{"id":40382772,"name":"texteditor","full_name":"amiga-mui/texteditor","owner":{"login":"amiga-mui","id":13694373,"avatar_url":"https://avatars.githubusercontent.com/u/13694373?v=3","gravatar_id":"","url":"https://api.github.com/users/amiga-mui","html_url":"https://github.com/amiga-mui","followers_url":"https://api.github.com/users/amiga-mui/followers","following_url":"https://api.github.com/users/amiga-mui/following{/other_user}","gists_url":"https://api.github.com/users/amiga-mui/gists{/gist_id}","starred_url":"https://api.github.com/users/amiga-mui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amiga-mui/subscriptions","organizations_url":"https://api.github.com/users/amiga-mui/orgs","repos_url":"https://api.github.com/users/amiga-mui/repos","events_url":"https://api.github.com/users/amiga-mui/events{/privacy}","received_events_url":"https://api.github.com/users/amiga-mui/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amiga-mui/texteditor","description":"A well-known and used MUI custom class (TextEditor.mcc) which provides application programmers a textedit gadget. It supports features like word wrapping, soft styles (bold, italic, underline), a spell checking interface as well as an AREXX interface for scripting.","fork":false,"url":"https://api.github.com/repos/amiga-mui/texteditor","forks_url":"https://api.github.com/repos/amiga-mui/texteditor/forks","keys_url":"https://api.github.com/repos/amiga-mui/texteditor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amiga-mui/texteditor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amiga-mui/texteditor/teams","hooks_url":"https://api.github.com/repos/amiga-mui/texteditor/hooks","issue_events_url":"https://api.github.com/repos/amiga-mui/texteditor/issues/events{/number}","events_url":"https://api.github.com/repos/amiga-mui/texteditor/events","assignees_url":"https://api.github.com/repos/amiga-mui/texteditor/assignees{/user}","branches_url":"https://api.github.com/repos/amiga-mui/texteditor/branches{/branch}","tags_url":"https://api.github.com/repos/amiga-mui/texteditor/tags","blobs_url":"https://api.github.com/repos/amiga-mui/texteditor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amiga-mui/texteditor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amiga-mui/texteditor/git/refs{/sha}","trees_url":"https://api.github.com/repos/amiga-mui/texteditor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amiga-mui/texteditor/statuses/{sha}","languages_url":"https://api.github.com/repos/amiga-mui/texteditor/languages","stargazers_url":"https://api.github.com/repos/amiga-mui/texteditor/stargazers","contributors_url":"https://api.github.com/repos/amiga-mui/texteditor/contributors","subscribers_url":"https://api.github.com/repos/amiga-mui/texteditor/subscribers","subscription_url":"https://api.github.com/repos/amiga-mui/texteditor/subscription","commits_url":"https://api.github.com/repos/amiga-mui/texteditor/commits{/sha}","git_commits_url":"https://api.github.com/repos/amiga-mui/texteditor/git/commits{/sha}","comments_url":"https://api.github.com/repos/amiga-mui/texteditor/comments{/number}","issue_comment_url":"https://api.github.com/repos/amiga-mui/texteditor/issues/comments{/number}","contents_url":"https://api.github.com/repos/amiga-mui/texteditor/contents/{+path}","compare_url":"https://api.github.com/repos/amiga-mui/texteditor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amiga-mui/texteditor/merges","archive_url":"https://api.github.com/repos/amiga-mui/texteditor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amiga-mui/texteditor/downloads","issues_url":"https://api.github.com/repos/amiga-mui/texteditor/issues{/number}","pulls_url":"https://api.github.com/repos/amiga-mui/texteditor/pulls{/number}","milestones_url":"https://api.github.com/repos/amiga-mui/texteditor/milestones{/number}","notifications_url":"https://api.github.com/repos/amiga-mui/texteditor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amiga-mui/texteditor/labels{/name}","releases_url":"https://api.github.com/repos/amiga-mui/texteditor/releases{/id}","deployments_url":"https://api.github.com/repos/amiga-mui/texteditor/deployments","created_at":"2015-08-07T22:06:02Z","updated_at":"2016-10-25T19:55:58Z","pushed_at":"2016-10-27T07:39:31Z","git_url":"git://github.com/amiga-mui/texteditor.git","ssh_url":"git@github.com:amiga-mui/texteditor.git","clone_url":"https://github.com/amiga-mui/texteditor.git","svn_url":"https://github.com/amiga-mui/texteditor","homepage":null,"size":1783,"stargazers_count":4,"watchers_count":4,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amiga-mui/texteditor/pulls/7"},"html":{"href":"https://github.com/amiga-mui/texteditor/pull/7"},"issue":{"href":"https://api.github.com/repos/amiga-mui/texteditor/issues/7"},"comments":{"href":"https://api.github.com/repos/amiga-mui/texteditor/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/amiga-mui/texteditor/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/amiga-mui/texteditor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amiga-mui/texteditor/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/amiga-mui/texteditor/statuses/62e38fb4f2d6cfcc005b12d3a7696abaf58b2d13"}}}}
{"actor":{"display_login":"jens-maus"}}