orbitalquark / textadept

Textadept is a fast, minimalist, and remarkably extensible cross-platform text editor for programmers.
https://orbitalquark.github.io/textadept
MIT License
636 stars 38 forks source link

`view.element_color[view.ELEMENT_CARET]` and `ui.find.entry_font` in `~/.textadept/init.lua` have no effect #465

Closed georgeraraujo closed 11 months ago

georgeraraujo commented 11 months ago

Hi,

I just downloaded the 09/26 nightly (bca2495) for Windows (thanks for fixing #464!).

I deleted %USERPROFILE%\.textadept to start from scratch, clicked "Edit", "Preferences", and input the following code:

view:set_theme( 'light', { font = 'JetBrains Mono NL', size = 11 } )

ui.find.entry_font = 'Segoe UI 10'

view.caret_width = 2
view.element_color[view.ELEMENT_CARET] = 0x000099  -- red

view.edge_mode   = view.EDGE_LINE
view.edge_column = 80

Then I clicked "Tools", "Command Entry", and ran reset(). view.element_color[view.ELEMENT_CARET] and ui.find.entry_font didn't have any effect - the font in the "Find" and "Replace" entries remained the same as the one I set for the theme, and the caret remained black:

image

Also, is there a way to display the number of buffers in the title bar?

Thanks for any attention.

orbitalquark commented 11 months ago

Those particular settings belong in a theme file (https://orbitalquark.github.io/textadept/manual.html#themes). Despite you setting them in your ~/.textadept/init.lua, they are actually overwritten when the theme is applied. If you create and set your own theme, you should see what you expect.

As for displaying the number of buffers in the title bar, you can add to your ~/.textadept/init.lua

https://github.com/orbitalquark/textadept/blob/3d868ac3f8d6c49bdf1941018bec1d988a30737e/core/ui.lua#L185-L191

and

https://github.com/orbitalquark/textadept/blob/3d868ac3f8d6c49bdf1941018bec1d988a30737e/core/ui.lua#L269-L274

Add a %d placeholder in the string on line 271 and a #_BUFFERS argument in the correct place. Your code will overwrite Textadept's setting of the title bar.

georgeraraujo commented 11 months ago

Thanks!