orbitalquark / textadept

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

better char to comment lines in batch files #217

Closed ousia closed 2 years ago

ousia commented 2 years ago

@orbitalquark,

by default, Textadept uses : to comment lines in batch files.

According to https://stackoverflow.com/a/2198015 (among many others), this is a way to anchor the destination of a goto command.

:: would be right here, but it can lead to issues with delayed expansion enabled (as explained in https://stackoverflow.com/a/16839602).

REM would be the best option here.

Sorry for not providing a PR myself, but I don’t know which file contains this info.

I hope it helps.

snoopy commented 2 years ago

It is located here: https://github.com/orbitalquark/textadept/blob/22330d3fec748312184973069c84f861f45133da/modules/textadept/editing.lua#L80

You can also overwrite it in your own init.lua like so: textadept.editing.comment_string.batch = 'REM' The reasoning sounds good though so it probably makes sense to replace it within Textadept itself.

orbitalquark commented 2 years ago

Closed in favor of https://github.com/orbitalquark/textadept/pull/219

ousia commented 2 years ago

It is located here:

https://github.com/orbitalquark/textadept/blob/22330d3fec748312184973069c84f861f45133da/modules/textadept/editing.lua#L80

Many thanks for the reference, @snoopy.

You can also overwrite it in your own init.lua like so: textadept.editing.comment_string.batch = 'REM'

This is were I started (adding this to my own file).

But I failed to show that REM actually reads REM␣.

The reasoning sounds good though so it probably makes sense to replace it within Textadept itself.

Many thanks for the reference and providing a patch, @snoopy.

Many thanks for the final fix, @orbitalquark.