adityam / filter

ConTeXt module to process contents of a start-stop environment through an external program
45 stars 10 forks source link

numberdistance not considering margin #53

Closed champignoom closed 2 years ago

champignoom commented 2 years ago
\usemodule[vim]

\setupvimtyping[vimcommand=nvim]
\definevimtyping[CPP][syntax=cpp, numbering=yes, numberdistance=1em, margin=10em]

\starttext
\startCPP
#include <iostream>
using std::cout;

int main() {
    cout <<"Hello world!\n";
}
\stopCPP
\stoptext

t-vim-margin-numbering

Line numbers are way farther than 1em to the code.

champignoom commented 2 years ago

numbering=-9em works in this case, so it's probably sufficient to clarify the vim-README a bit:

To change the distance between the numbers and the rest of the code text area, use numberdistance=... option.

adityam commented 2 years ago

Thanks. Updated the documentation with a bit more detail.

champignoom commented 2 years ago

By default, the numbers are placed on the right of the text area.

Isn't it on the left by default?

adityam commented 2 years ago

D'oh. Fixed.