Re: [textadept] theme tweaking

From: mitchell <c....at.caladbolg.net>
Date: Wed, 8 Dec 2010 09:14:47 -0500 (Eastern Standard Time)

Hi Scott,

> I'm making a serious go of migrating to TA again (I tried earlier this
> year and grew frustrated) and am finding some of my earlier tweaks
> aren't working now.
>
> Eg I want to change the font without having to edit the theme file(s).
> I had this in my init.lua:
>
> local function set_font()
> local c = _SCINTILLA.constants
> local buffer = buffer
> buffer.style_font[0] = 'Consolas'
> buffer.zoom = 0
> buffer.tab_width = 4
> buffer.indent = 4
> buffer.margin_width_n[0] = 4 + 3 *
> buffer:text_width(c.STYLE_LINENUMBER, '9')
> end
>
> events.connect('buffer_after_switch', set_font)
> events.connect('view_after_switch', set_font)

You will have to iterate through all styles to set the font:

for i = 0, 100 do -- styles go up to 255, I just picked 100
   buffer.style_font[i] = '!Consolas' -- need '!' for antialiasing
end

It is HIGHLY recommended to just copy a theme. It's really not so bad. The
theme files very rarely change from version to version; they only changed
in 3.5 because I added a lot of options to view.lua so people who wanted
to modify themes don't have to look up all the options.

mitchell

>
> However, the buffer.lua file in the theme makes no mention of fonts,
> and indeed the above doesn't have any effect on the font. It does
> modify the tab settings.
>
> Did something change since I last tried this? I think I wrote it for
> TA 3.0. How do you tweak the font?
>
> Another question. I like the TA file_browser I found. How do I bind it
> to a key (eg keys.co) to start in either the directory of the
> currently viewed buffer, or if no file is already open, the cwd?
>
> keys.co = { function() _m.textadept.file_browser.init(BUFFER_DIR or
> CWD) end }
>
> --
> You received this message because you are subscribed to the Google Groups "textadept" group.
> To post to this group, send email to textadept.at.googlegroups.com.
> To unsubscribe from this group, send email to textadept+unsubscribe.at.googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/textadept?hl=en.
>
>

mitchell
Received on Wed 08 Dec 2010 - 09:14:47 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:55:36 EST