Re: [code] [textadept] Column Marks for TA

From: Procházka Lukáš Ing. <>
Date: Fri, 09 Aug 2019 08:46:03 +0200


thank you for the add-in.

Just a point - to check your add-ins were successfully installed, could you provide some print-screens?

- one with menu which shows the add-in menu items (if any),
- one which shows TA with column marks.

Thank you.

Best regards,


On Thu, 08 Aug 2019 21:12:57 +0200, Qwerky <> wrote:

> Hello, TA world!
> Like many editors, TextAdept has a capability to indicate the
> right-margin of a document, either by a coloured vertical line at that
> column, or by a coloured background for columns beyond the margin. It
> also has the capability to display multiple vertical lines to indicate
> specified column positions. But these two mutually exclusive abilities
> are an all-or-nothing feature--once set, they apply to all open files.
> 'Column Marks' for TA provides the ability for each open file to have to
> have its own edge-mode (either none, background, line, or multiline),
> its own edge-column or multiple column marks, and its own
> edge-background/edge-column, or column mark colour. It also adds a
> 'Column Marks' menu which allows setting the Edge Mode (Background,
> Line, Multiline, None), setting the Edge Column and Edge Colour, and
> setting multiple Column Marks and Column Mark Colour.
> Additionally, 'Column Marks' provides two functions, 'Next Column Mark'
> and 'Previous Column Mark', which may be bound to keys, to move the
> caret to the next or previous column mark column. This is invaluable
> for editing columnar-type data.
> Secret Hint: once multiple column marks are set, the edge-mode may be
> set to another setting (background, line, none), and the 'Next Column
> Mark' and 'Previous Column Mark' functions will continue to operate,
> even without the column marks being visible.
> Bonus: 'Column Marks' also allows the insert/overtype mode to be set
> individually for each file.
> 'History' for TA has also been updated to save and restore the
> edge-mode, edge-column, edge-colour, column-mark-colour, and
> column-marks for each file, when 'Column Marks' is installed. Because
> of this, I am including the updated 'History' as well.
> To install either 'Column Marks' or 'History', either:
> A. Place the columnmarks.lua or history.lua file in your
> /USERHOME/modules/common/ directory, where it should be automatically
> 'require'd if you have installed the appropriate code from the TextAdept
> wiki; or
> B. In your /USERHOME/modules/ directory, create a 'columnmarks' or
> 'history' directory, copy the columnmarks.lua or history.lua file to
> that directory but rename it to 'init.lua', and then 'require' that
> directory in your user 'init.lua' file.
> Please see the 'NOTES:' section at the beginning of the
> 'columnmarks.lua' file or 'history.lua' file for settings you may wish
> to change.
> In particular, 'History' monitors 'events.INITIALIZED', 'events.QUIT',
> 'events.FILE_OPENED', and 'events.FILE_AFTER_SAVE', in order to load,
> update, and save the history file. However, TA provides no event for a
> file being closed, and therefore if a file is closed before the program
> is exited, 'History' will not be able to update that file's history.
> To overcome this, I have added the monitoring of an
> 'events.FILE_BEFORE_CLOSE' event to 'History'. This event is defined in
> 'History' as "local events_FILE_BEFORE_CLOSE = 'file_before_close'".This will, of course, have no effect (nor cause any issue) unless such
> an event is emitted elsewhere. To accomplish this the user may add, if
> he so chooses, the single line `events.emit('file_before_close',
> buffer.filename)` immediately before the `buffer:delete()` line at the
> end of the `io.close_buffer()` function, within the
> `/textadept/core/file_io.lua` file.
> This may be considered a request to Mitchell to add a file-close event.In my own case, the added line is actually
> 'events.emit(events.FILE_BEFORE_CLOSE, buffer.filename)', having
> documented and defined the event in the appropriate locations at the top
> of the file, with the lines:
> -- @field (string)
> -- Emitted right before closing a file.
> -- Emitted by [`io.close_buffer()`]().
> -- Arguments:
> --
> -- * _`filename`_: The filename of the file being closed.
> and
> events.FILE_BEFORE_CLOSE = 'file_before_close'
> Feedback is welcome. I hope 'Column Marks' and 'History' will prove
> useful to other users as well.
> qwerky

Ing. Lukáš Procházka |
Pontex s. r. o.      | | | IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4
Mob.: +420 702 033 396
You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Fri 09 Aug 2019 - 02:46:03 EDT

This archive was generated by hypermail 2.2.0 : Fri 09 Aug 2019 - 06:50:26 EDT