Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git
M src/main/java/com/keenwrite/StatusBarNotifier.java
105105
   */
106106
  private static void update( final String message ) {
107
    try {
108
      throw new RuntimeException();
109
    } catch( final Exception e ) {
110
      e.printStackTrace();
111
    }
112
113107
    runLater(
114108
        () -> {
M src/main/java/com/keenwrite/processors/markdown/CaretExtension.java
2828
package com.keenwrite.processors.markdown;
2929
30
import com.keenwrite.Constants;
3031
import com.vladsch.flexmark.html.AttributeProvider;
3132
import com.vladsch.flexmark.html.AttributeProviderFactory;
...
5152
  /**
5253
   * Responsible for creating the id attribute. This class is instantiated
53
   * each time the document is rendered, thereby resetting the count to zero.
54
   * once: for the HTML element containing the {@link Constants#CARET_ID}.
5455
   */
5556
  public static class IdAttributeProvider implements AttributeProvider {
...
8586
      if( mCaret.isBetweenText( began, ended ) ||
8687
          prev != null && mCaret.isBetweenText( prev.getEndOffset(), began ) ) {
88
89
        // This magic line enables synchronizing the text editor with preview.
8790
        attributes.addValue( AttributeImpl.of( "id", CARET_ID ) );
8891
      }
M src/main/java/com/keenwrite/processors/markdown/CaretPosition.java
4848
  }
4949
50
  /**
51
   * Used for building a new {@link CaretPosition} instance.
52
   */
5053
  public static class Mutator {
5154
    /**
5255
     * Caret's current paragraph index (i.e., current caret line number).
5356
     */
5457
    private ObservableValue<Integer> mParagraph;
5558
59
    /**
60
     * Used to count the number of lines in the text editor document.
61
     */
5662
    private LiveList<Paragraph<Collection<String>, String,
5763
        Collection<String>>> mParagraphs;
...
135141
  }
136142
143
  /**
144
   * Returns the number of lines in the text editor.
145
   *
146
   * @return The size of the text editor's paragraph list plus one.
147
   */
137148
  private int getParagraphCount() {
138149
    return mMutator.mParagraphs.size() + 1;
139150
  }
140151
152
  /**
153
   * Returns the absolute position of the caret within the entire document.
154
   *
155
   * @return A zero-based index of the caret position.
156
   */
141157
  private int getTextOffset() {
142158
    return mMutator.mTextOffset.getValue();
143159
  }
144160
161
  /**
162
   * Returns the position of the caret within the current paragraph being
163
   * edited.
164
   *
165
   * @return A zero-based index of the caret position relative to the
166
   * current paragraph.
167
   */
145168
  private int getParaOffset() {
146169
    return mMutator.mParaOffset.getValue();
M src/main/java/com/keenwrite/processors/markdown/r/RExtension.java
119119
120120
  /**
121
   * Creates an extension capable of handling delimited TeX code in Markdown.
121
   * Creates an extension capable of intercepting R code blocks and preventing
122
   * them from being converted into HTML {@code <code>} elements.
122123
   */
123124
  public static RExtension create() {