ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Blank lines discarded when \typing
@ 2021-12-03 20:47 Thangalin via ntg-context
  0 siblings, 0 replies; only message in thread
From: Thangalin via ntg-context @ 2021-12-03 20:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Thangalin


[-- Attachment #1.1: Type: text/plain, Size: 1204 bytes --]

Note the presence of double-spaced blank lines in the following document
and in the attached source file:

\setuptyping[numbering=line]
\starttext

\startbuffer[javacode]
try {
  final var num = stack.pop();

  if( num != null ) {
    stack.push( blah );
  }


  return true;
}
\stopbuffer

\type{\typebuffer}:
\typebuffer[javacode]

\type{\typing}:
\starttyping
try {
  final var num = stack.pop();

  if( num != null ) {
    stack.push( blah );
  }


  return true;
}
\stoptyping

\type{\typefile}:
\typefile{t.java}

\stoptext

There appear to be two issues.

First, \typefile produces what I'd consider the "correct" result, where the
double-spaced lines appear on the page as a double-space. Both the
\typebuffer and \typing commands ignore double-spacing. The double-spacing
is also ignored by \xmldisplayverbatim. How would you configure to give
\typebuffer, \typing, and \xmldisplayverbatim to honour double-spaces the
same way as \typefile?

Second, of lesser importance, is that the blank lines aren't numbered. This
makes the line numbers inconsistent with respect to IDEs. How would you
label all blank lines as well?

Out of curiosity, does the second issue relate to the first?

Thank you!

[-- Attachment #1.2: Type: text/html, Size: 1578 bytes --]

[-- Attachment #2: t.java --]
[-- Type: text/x-java, Size: 113 bytes --]

try {
  final var num = stack.pop();
  
  if( num != null ) {
    stack.push( blah );
  }
  
  
  return true;
}

[-- Attachment #3: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-03 20:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03 20:47 Blank lines discarded when \typing Thangalin via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).