# Vertical line for suggested max line width

**URL:** <https://discuss.kakoune.com/t/vertical-line-for-suggested-max-line-width/2501>\
**Category:** Help\
**Created:** [June 14, 2024, 3:02pm UTC](https://discuss.kakoune.com/t/vertical-line-for-suggested-max-line-width/2501 "2024-06-14T15:02:55Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ftonneau](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/ftonneau/32/295_2.png) [@ftonneau](https://discuss.kakoune.com/u/ftonneau)\
**Post date:** [June 14, 2024, 7:48pm UTC](https://discuss.kakoune.com/t/vertical-line-for-suggested-max-line-width/2501/4 "2024-06-14T19:48:43Z")

</div>

Highlighting a column is the usual way to proceed in terminal-based editors. An alternative (which I find more pleasing) is to highlight a series of columns to create a colored pane on the right. For example:

 ![shot](https://discuss.kakoune.com/uploads/default/original/2X/2/27bb1241201a25c4c37f44a7c28eee6a29bd6a8e.jpeg)

Doing so requires looping over a set of column indices. Usually you would need to shell out for the loop, but here is an alternative without shell calls. The script makes uses of almr’s looping techniques:

> [@Kakscript has loop, catch this, head/tail/shift, int\>=0, streq ... etc](https://discuss.kakoune.com/t/kakscript-has-loop-catch-this-head-tail-shift-int-0-streq-etc/1885):
>
> Note: (entire [demo](https://gitlab.com/kstr0k/sel-editor.kak/-/snippets/2178452) downloadable in one script). Friends, let’s talk about scripting in kakscript, not other languages. Unexpectedly, a lot of things are possible — a lot more than you might think at first. I’ve been using these tricks in [sel-editor](https://discuss.kakoune.com/t/sel-editor-editable-live-selection-summary-buffer/1877/4) and the up-and-coming kak-bundle-plug. I’m curious what experienced users (and @mawww ) think as far as safety and performance — are there any problems with this approach? There was a discussion about hook [re-entrancy](https://discuss.kakoune.com/t/hooks-concurrency-race-conditions/1801/3) a while ago. Without further a…

The script is a zipped text file:

[divider.zip](https://discuss.kakoune.com/uploads/short-url/sEpKPRrCJZsXtCv1xHkpB8P7Ggr.zip) (669 Bytes)

---

_[View the full topic](https://discuss.kakoune.com/t/vertical-line-for-suggested-max-line-width/2501)._
