|
29 | 29 |
|
30 | 30 | #import <Cocoa/Cocoa.h>
|
31 | 31 |
|
| 32 | +// These codes go in the continuation character to the right of the |
| 33 | +// rightmost column. |
| 34 | +#define EOL_HARD 0 // Hard line break (explicit newline) |
| 35 | +#define EOL_SOFT 1 // Soft line break (a long line was wrapped) |
| 36 | +#define EOL_DWC 2 // Double-width character wrapped to next line |
| 37 | + |
32 | 38 | typedef struct FindContext {
|
33 | 39 | int absBlockNum;
|
34 | 40 | NSString* substring;
|
@@ -100,7 +106,7 @@ typedef struct screen_char_t
|
100 | 106 | // Try to get a line that is lineNum after the first line in this block after wrapping them to a given width.
|
101 | 107 | // If the line is present, return a pointer to its start and fill in *lineLength with the number of bytes in the line.
|
102 | 108 | // If the line is not present, decrement *lineNum by the number of lines in this block and return NULL.
|
103 |
| -- (screen_char_t*) getWrappedLineWithWrapWidth: (int) width lineNum: (int*) lineNum lineLength: (int*) lineLength includesEndOfLine: (BOOL*) includesEndOfLine; |
| 109 | +- (screen_char_t*) getWrappedLineWithWrapWidth: (int) width lineNum: (int*) lineNum lineLength: (int*) lineLength includesEndOfLine: (int*) includesEndOfLine; |
104 | 110 |
|
105 | 111 | // Get the number of lines in this block at a given screen width.
|
106 | 112 | - (int) getNumLinesWithWrapWidth: (int) width;
|
@@ -145,6 +151,9 @@ typedef struct screen_char_t
|
145 | 151 | // Get length of last wrapped line if partial, or 0 if not partial.
|
146 | 152 | - (int) getTrailingWithWidth:(int)width;
|
147 | 153 |
|
| 154 | +// Return a raw line |
| 155 | +- (screen_char_t*) rawLine: (int) linenum; |
| 156 | + |
148 | 157 | // NSLog the contents of the block. For debugging.
|
149 | 158 | - (void)dump:(int)rawOffset;
|
150 | 159 | @end
|
@@ -209,13 +218,13 @@ typedef struct screen_char_t
|
209 | 218 | // Copy a line into the buffer. If the line is shorter than 'width' then only the first 'width'
|
210 | 219 | // characters will be modified.
|
211 | 220 | // 0 <= lineNum < numLinesWithWidth:width
|
212 |
| -// Returns true if a continuation marker is needed at the end of this line. |
213 |
| -- (BOOL) copyLineToBuffer: (screen_char_t*) buffer width: (int) width lineNum: (int) lineNum; |
| 221 | +// Returns EOL code. |
| 222 | +- (int) copyLineToBuffer: (screen_char_t*) buffer width: (int) width lineNum: (int) lineNum; |
214 | 223 |
|
215 | 224 | // Copy up to width chars from the last line into *ptr. The last line will be removed or
|
216 | 225 | // truncated from the buffer. Sets *includesEndOfLine to true if this line should have a
|
217 | 226 | // continuation marker.
|
218 |
| -- (BOOL) popAndCopyLastLineInto: (screen_char_t*) ptr width: (int) width includesEndOfLine: (BOOL*) includesEndOfLine; |
| 227 | +- (BOOL) popAndCopyLastLineInto: (screen_char_t*) ptr width: (int) width includesEndOfLine: (int*) includesEndOfLine; |
219 | 228 |
|
220 | 229 | // Get the number of buffer lines at a given width.
|
221 | 230 | - (int) numLinesWithWidth: (int) width;
|
|
0 commit comments