<blockquote>
<p>No, its only automatic.</p>
<p>The margin width is automatic based on the number of lines in the file so space isn't wasted for small files and it still allows stupidly huge log files to be opened.</p>
</blockquote>
<p>lie</p>
<blockquote>
<p>Is there a way to set the min-width of the line numbers column?<br>
Just because line 1 to 9 doesn't have the same width of line 100 to 999.</p>
</blockquote>
<p>yes we can<br>
compare function below with source<br>
src/sciwrappers.c:99</p>
<div class="highlight highlight-source-c"><pre><span class="pl-k">void</span> <span class="pl-en">sci_set_line_numbers</span>(ScintillaObject *sci, gboolean set)
{
  <span class="pl-k">if</span> (set)
  {
    gchar tmp_str[<span class="pl-c1">15</span>];
    gint len = (gint) <span class="pl-c1">SSM</span>(sci, SCI_GETLINECOUNT, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>);
    gint width;

    <span class="pl-c1">g_snprintf</span>(tmp_str, <span class="pl-c1">15</span>, <span class="pl-s"><span class="pl-pds">"</span>_<span class="pl-c1">%d</span><span class="pl-pds">"</span></span>, len + <span class="pl-c1">4</span>);
    width =  <span class="pl-c1">sci_text_width</span>(sci, STYLE_LINENUMBER, <span class="pl-s"><span class="pl-pds">"</span>_99999<span class="pl-pds">"</span></span>);
    <span class="pl-c1">SSM</span>(sci, SCI_SETMARGINWIDTHN, <span class="pl-c1">0</span>, width);
    <span class="pl-c1">SSM</span>(sci, SCI_SETMARGINSENSITIVEN, <span class="pl-c1">0</span>, <span class="pl-c1">FALSE</span>); <span class="pl-c"><span class="pl-c">/*</span> use default behaviour <span class="pl-c">*/</span></span>
  }
  <span class="pl-k">else</span>
  {
    <span class="pl-c1">SSM</span>(sci, SCI_SETMARGINWIDTHN, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>);
  }
}</pre></div>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1694#issuecomment-466801353">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ6l6O_WpvBA8J-tBMKAnqIlKjjxyks5vQtZ3gaJpZM4Qlq2w">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJ-X23T0eFP2kHAcT1i8D90wowe1Hks5vQtZ3gaJpZM4Qlq2w.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@B4PzwL3YVGa6 in #1694: \u003e No, its only automatic.\r\n\u003e \r\n\u003e The margin width is automatic based on the number of lines in the file so space isn't wasted for small files and it still allows stupidly huge log files to be opened.\r\n\r\nlie\r\n\r\n\r\n\r\n\u003e Is there a way to set the min-width of the line numbers column?\r\n\u003e Just because line 1 to 9 doesn't have the same width of line 100 to 999.\r\n\r\nyes we can\r\ncompare function below with source\r\nsrc/sciwrappers.c:99\r\n\r\n```C\r\nvoid sci_set_line_numbers(ScintillaObject *sci, gboolean set)\r\n{\r\n  if (set)\r\n  {\r\n    gchar tmp_str[15];\r\n    gint len = (gint) SSM(sci, SCI_GETLINECOUNT, 0, 0);\r\n    gint width;\r\n\r\n    g_snprintf(tmp_str, 15, \"_%d\", len + 4);\r\n    width =  sci_text_width(sci, STYLE_LINENUMBER, \"_99999\");\r\n    SSM(sci, SCI_SETMARGINWIDTHN, 0, width);\r\n    SSM(sci, SCI_SETMARGINSENSITIVEN, 0, FALSE); /* use default behaviour */\r\n  }\r\n  else\r\n  {\r\n    SSM(sci, SCI_SETMARGINWIDTHN, 0, 0);\r\n  }\r\n}\r\n```"}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1694#issuecomment-466801353"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/1694#issuecomment-466801353",
"url": "https://github.com/geany/geany/issues/1694#issuecomment-466801353",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>