[code] Drawing horizontal lines between text lines?

From: David Tamar <von.tamar.att.outlook.com>
Date: Sat, 23 Mar 2019 20:11:57 +0000

I'm customizing Textadept to resemble a physical notebook, with the horizontal light blue lines between text lines, and vertical red lines in each side of a page.

The indent indicator from the left is already implemented, but I'm not sure about how to draw a straight vertical line on the right side as well so it'll separate the text from the line numbers and everything else.

For reference, I've seen someone who made this in another editor and then I was inspired to do the same:
https://raw.githubusercontent.com/MarcusE1W/eastend-notebook-syntax/master/screen2-sy.png

I've managed so far to apply a text indicator of a thin underline all over the buffer using the “buffer:indicator_fill_range” function. However, this indicator appears only beneath actual characters and not empty space. Is there any other way to draw lines?

Here's what I've done so far, I'm not sure about its efficiency and elegance:
local NOTEBOOK_LINES = _SCINTILLA.next_indic_number()
buffer.indic_style[NOTEBOOK_LINES] = buffer.INDIC_COMPOSITIONTHIN
buffer.indic_fore[NOTEBOOK_LINES] = 0xf2b761
buffer.indic_under[NOTEBOOK_LINES] = true

local function draw_lines()
  buffer.indicator_current = NOTEBOOK_LINES
  buffer:indicator_clear_range(0, buffer.length)
  buffer:indicator_fill_range(0, buffer.length)
end

events.connect(events.UPDATE_UI, draw_lines)

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Sat 23 Mar 2019 - 16:11:57 EDT

This archive was generated by hypermail 2.2.0 : Sun 24 Mar 2019 - 06:48:28 EDT