Skip to content

Mechanism to Monkey Patch core files? #433

Closed Answered by orbitalquark
Gavin-Holt asked this question in Q&A
Discussion options

You must be logged in to vote

For set_title(), just take a look and see what event is calling it. For the latest nightly, it's 5 events:

textadept/core/ui.lua

Lines 269 to 274 in 19cfa3c

local function set_title()
local filename, basename = get_display_names(buffer)
ui.title = string.format('%s %s Textadept (%s)', basename, buffer.modify and '*' or '-', filename)
end
events.connect(events.SAVE_POINT_REACHED, set_title)
events.connect(events.SAVE_POINT_LEFT, set_title)
and

textadept/core/ui.lua

Lines 355 to 361 in 19cfa3c

local function update_bars()
set_title()
events.emit(events.UPDATE_UI, 3)
end
events.connect(events.BUFFER_NEW, update_bars)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Gavin-Holt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants