Skip to content
Snippets Groups Projects
scintilla.rb 135 KiB
Newer Older
  • Learn to ignore specific revisions
  •     end
    
        # Show or hide the horizontal scroll bar.
        def setHScrollBar(show)
          sendMessage(2130, show, 0)
        end
    
        # Is the horizontal scroll bar visible?
        def getHScrollBar
          sendMessage(2131, 0, 0) == 1 ? true : false
        end
    
    
        SC_IV_NONE = 0
        SC_IV_REAL = 1
        SC_IV_LOOKFORWARD = 2
        SC_IV_LOOKBOTH = 3
    
    
        # Show or hide indentation guides.
    
        def setIndentationGuides(indentView)
          sendMessage(2132, indentView, 0)
    
        end
    
        # Are the indentation guides visible?
        def getIndentationGuides
    
        end
    
        # Set the highlighted indentation guide column.
        # 0 = no highlighted guide.
        def setHighlightGuide(column)
          sendMessage(2134, column, 0)
        end
    
        # Get the highlighted indentation guide column.
        def getHighlightGuide
          sendMessage(2135, 0, 0)
        end
    
        # Get the position after the last visible characters on a line.
        def getLineEndPosition(line)
          sendMessage(2136, line, 0)
        end
    
        # Get the code page used to interpret the bytes of the document as characters.
        def getCodePage
          sendMessage(2137, 0, 0)
        end
    
        # Get the foreground colour of the caret.
        def getCaretFore
          sendMessage(2138, 0, 0)
        end
    
        # In palette mode?
        def getUsePalette
          sendMessage(2139, 0, 0) == 1 ? true : false
        end
    
        # In read-only mode?
        def getReadOnly
          sendMessage(2140, 0, 0) == 1 ? true : false
        end
    
        # Sets the position of the caret.
        def setCurrentPos(pos)
          sendMessage(2141, pos, 0)
        end
    
        # Sets the position that starts the selection - this becomes the anchor.
        def setSelectionStart(pos)
          sendMessage(2142, pos, 0)
        end
    
        # Returns the position at the start of the selection.
        def getSelectionStart
          sendMessage(2143, 0, 0)
        end
    
        # Sets the position that ends the selection - this becomes the currentPosition.
        def setSelectionEnd(pos)
          sendMessage(2144, pos, 0)
        end
    
        # Returns the position at the end of the selection.
        def getSelectionEnd
          sendMessage(2145, 0, 0)
        end
    
    
        # Set caret to a position, while removing any existing selection.
        def setEmptySelection(pos)
          sendMessage(2556, pos, 0)
        end
    
    
    1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435
        # Sets the print magnification added to the point size of each style for printing.
        def setPrintMagnification(magnification)
          sendMessage(2146, magnification, 0)
        end
    
        # Returns the print magnification.
        def getPrintMagnification
          sendMessage(2147, 0, 0)
        end
    
        # PrintColourMode - use same colours as screen.
        SC_PRINT_NORMAL = 0
        # PrintColourMode - invert the light value of each style for printing.
        SC_PRINT_INVERTLIGHT = 1
        # PrintColourMode - force black text on white background for printing.
        SC_PRINT_BLACKONWHITE = 2
        # PrintColourMode - text stays coloured, but all background is forced to be white for printing.
        SC_PRINT_COLOURONWHITE = 3
        # PrintColourMode - only the default-background is forced to be white for printing.
        SC_PRINT_COLOURONWHITEDEFAULTBG = 4
    
        # Modify colours when printing for clearer printed text.
        def setPrintColourMode(mode)
          sendMessage(2148, mode, 0)
        end
    
        # Returns the print colour mode.
        def getPrintColourMode
          sendMessage(2149, 0, 0)
        end
    
        SCFIND_WHOLEWORD = 2
        SCFIND_MATCHCASE = 4
        SCFIND_WORDSTART = 0x00100000
        SCFIND_REGEXP = 0x00200000
        SCFIND_POSIX = 0x00400000
    
        # Find some text in the document.
        def findText(flags, ft)
          sendMessage(2150, flags, ft)
        end
    
        # On Windows, will draw the document into a display context such as a printer.
        def formatRange(draw, fr)
          sendMessage(2151, draw, fr)
        end
    
        # Retrieve the display line at the top of the display.
        def getFirstVisibleLine
          sendMessage(2152, 0, 0)
        end
    
        # Retrieve the contents of a line.
        # Returns the length of the line.
        def getLine(line)
          buffer = "".ljust(line)
          sendMessage(2153, line, buffer)
          buffer
        end
    
        # Returns the number of lines in the document. There is always at least one.
        def getLineCount
          sendMessage(2154, 0, 0)
        end
    
        # Sets the size in pixels of the left margin.
        def setMarginLeft(pixelWidth)
          sendMessage(2155, 0, pixelWidth)
        end
    
        # Returns the size in pixels of the left margin.
        def getMarginLeft
          sendMessage(2156, 0, 0)
        end
    
        # Sets the size in pixels of the right margin.
        def setMarginRight(pixelWidth)
          sendMessage(2157, 0, pixelWidth)
        end
    
        # Returns the size in pixels of the right margin.
        def getMarginRight
          sendMessage(2158, 0, 0)
        end
    
        # Is the document different from when it was last saved?
        def getModify
          sendMessage(2159, 0, 0) == 1 ? true : false
        end
    
        # Select a range of text.
        def setSel(start, last)
          sendMessage(2160, start, last)
        end
    
        # Retrieve the selected text.
        # Return the length of the text.
        def getSelText
          sendMessage(2161, 0, text)
        end
    
        # Retrieve a range of text.
        # Return the length of the text.
        def getTextRange(tr)
          sendMessage(2162, 0, tr)
        end
    
        # Draw the selection in normal style or with selection highlighted.
        def hideSelection(normal)
          sendMessage(2163, normal, 0)
        end
    
        # Retrieve the x value of the point in the window where a position is displayed.
        def pointXFromPosition(pos)
          sendMessage(2164, 0, pos)
        end
    
        # Retrieve the y value of the point in the window where a position is displayed.
        def pointYFromPosition(pos)
          sendMessage(2165, 0, pos)
        end
    
        # Retrieve the line containing a position.
        def lineFromPosition(pos)
          sendMessage(2166, pos, 0)
        end
    
        # Retrieve the position at the start of a line.
        def positionFromLine(line)
          sendMessage(2167, line, 0)
        end
    
        # Scroll horizontally and vertically.
        def lineScroll(columns, lines)
          sendMessage(2168, columns, lines)
        end
    
        # Ensure the caret is visible.
        def scrollCaret
          sendMessage(2169, 0, 0)
        end
    
        # Replace the selected text with the argument text.
        def replaceSel(text)
          sendMessage(2170, 0, text)
        end
    
        # Set to read only or read write.
        def setReadOnly(readOnly)
          sendMessage(2171, readOnly, 0)
        end
    
        # Null operation.
        def null
          sendMessage(2172, 0, 0)
        end
    
        # Will a paste succeed?
        def canPaste
          sendMessage(2173, 0, 0) == 1 ? true : false
        end
    
        # Are there any undoable actions in the undo history?
        def canUndo
          sendMessage(2174, 0, 0) == 1 ? true : false
        end
    
        # Delete the undo history.
        def emptyUndoBuffer
          sendMessage(2175, 0, 0)
        end
    
        # Undo one action in the undo history.
        def undo
          sendMessage(2176, 0, 0)
        end
    
        # Cut the selection to the clipboard.
        def cut
          sendMessage(2177, 0, 0)
        end
    
        # Copy the selection to the clipboard.
        def copy
          sendMessage(2178, 0, 0)
        end
    
        # Paste the contents of the clipboard into the document replacing the selection.
        def paste
          sendMessage(2179, 0, 0)
        end
    
        # Clear the selection.
        def clear
          sendMessage(2180, 0, 0)
        end
    
        # Replace the contents of the document with the argument text.
        def setText(text)
          sendMessage(2181, 0, text)
        end
    
        # Retrieve all the text in the document.
        # Returns number of characters retrieved.
        def getText(length)
          buffer = "".ljust(length)
          sendMessage(2182, length, buffer)
          buffer
        end
    
        # Retrieve the number of characters in the document.
        def getTextLength
          sendMessage(2183, 0, 0)
        end
    
        # Retrieve a pointer to a function that processes messages for this Scintilla.
        def getDirectFunction
          sendMessage(2184, 0, 0)
        end
    
        # Retrieve a pointer value to use as the first argument when calling
        # the function returned by GetDirectFunction.
        def getDirectPointer
          sendMessage(2185, 0, 0)
        end
    
        # Set to overtype (true) or insert mode.
        def setOvertype(overtype)
          sendMessage(2186, overtype, 0)
        end
    
        # Returns true if overtype mode is active otherwise false is returned.
        def getOvertype
          sendMessage(2187, 0, 0) == 1 ? true : false
        end
    
        # Set the width of the insert mode caret.
        def setCaretWidth(pixelWidth)
          sendMessage(2188, pixelWidth, 0)
        end
    
        # Returns the width of the insert mode caret.
        def getCaretWidth
          sendMessage(2189, 0, 0)
        end
    
        # Sets the position that starts the target which is used for updating the
        # document without affecting the scroll position.
        def setTargetStart(pos)
          sendMessage(2190, pos, 0)
        end
    
        # Get the position that starts the target.
        def getTargetStart
          sendMessage(2191, 0, 0)
        end
    
        # Sets the position that ends the target which is used for updating the
        # document without affecting the scroll position.
        def setTargetEnd(pos)
          sendMessage(2192, pos, 0)
        end
    
        # Get the position that ends the target.
        def getTargetEnd
          sendMessage(2193, 0, 0)
        end
    
        # Replace the target text with the argument text.
        # Text is counted so it can contain NULs.
        # Returns the length of the replacement text.
        def replaceTarget(length, text)
          sendMessage(2194, length, text)
        end
    
        # Replace the target text with the argument text after \d processing.
        # Text is counted so it can contain NULs.
        # Looks for \d where d is between 1 and 9 and replaces these with the strings
        # matched in the last search operation which were surrounded by \( and \).
        # Returns the length of the replacement text including any change
        # caused by processing the \d patterns.
        def replaceTargetRE(length, text)
          sendMessage(2195, length, text)
        end
    
        # Search for a counted string in the target and set the target to the found
        # range. Text is counted so it can contain NULs.
        # Returns length of range or -1 for failure in which case target is not moved.
        def searchInTarget(length, text)
          sendMessage(2197, length, text)
        end
    
        # Set the search flags used by SearchInTarget.
        def setSearchFlags(flags)
          sendMessage(2198, flags, 0)
        end
    
        # Get the search flags used by SearchInTarget.
        def getSearchFlags
          sendMessage(2199, 0, 0)
        end
    
        # Show a call tip containing a definition near position pos.
        def callTipShow(pos, definition)
          sendMessage(2200, pos, definition)
        end
    
        # Remove the call tip from the screen.
        def callTipCancel
          sendMessage(2201, 0, 0)
        end
    
        # Is there an active call tip?
        def callTipActive
          sendMessage(2202, 0, 0) == 1 ? true : false
        end
    
        # Retrieve the position where the caret was before displaying the call tip.
        def callTipPosStart
          sendMessage(2203, 0, 0)
        end
    
        # Highlight a segment of the definition.
        def callTipSetHlt(start, last)
          sendMessage(2204, start, last)
        end
    
        # Set the background colour for the call tip.
        def callTipSetBack(back)
          sendMessage(2205, back & 0xffffff, 0)
        end
    
        # Set the foreground colour for the call tip.
        def callTipSetFore(fore)
          sendMessage(2206, fore & 0xffffff, 0)
        end
    
        # Set the foreground colour for the highlighted part of the call tip.
        def callTipSetForeHlt(fore)
          sendMessage(2207, fore & 0xffffff, 0)
        end
    
    
        # Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
        def callTipUseStyle(tabSize)
          sendMessage(2212, tabSize, 0)
        end
    
    
        # Find the display line of a document line taking hidden lines into account.
        def visibleFromDocLine(line)
          sendMessage(2220, line, 0)
        end
    
        # Find the document line of a display line taking hidden lines into account.
        def docLineFromVisible(lineDisplay)
          sendMessage(2221, lineDisplay, 0)
        end
    
        # The number of display lines needed to wrap a document line
        def wrapCount(line)
          sendMessage(2235, line, 0)
        end
    
        SC_FOLDLEVELBASE = 0x400
        SC_FOLDLEVELWHITEFLAG = 0x1000
        SC_FOLDLEVELHEADERFLAG = 0x2000
        SC_FOLDLEVELNUMBERMASK = 0x0FFF
    
        # Set the fold level of a line.
        # This encodes an integer level along with flags indicating whether the
        # line is a header and whether it is effectively white space.
        def setFoldLevel(line, level)
          sendMessage(2222, line, level)
        end
    
        # Retrieve the fold level of a line.
        def getFoldLevel(line)
          sendMessage(2223, line, 0)
        end
    
        # Find the last child line of a header line.
        def getLastChild(line, level)
          sendMessage(2224, line, level)
        end
    
        # Find the parent line of a child line.
        def getFoldParent(line)
          sendMessage(2225, line, 0)
        end
    
        # Make a range of lines visible.
        def showLines(lineStart, lineEnd)
          sendMessage(2226, lineStart, lineEnd)
        end
    
        # Make a range of lines invisible.
        def hideLines(lineStart, lineEnd)
          sendMessage(2227, lineStart, lineEnd)
        end
    
        # Is a line visible?
        def getLineVisible(line)
          sendMessage(2228, line, 0) == 1 ? true : false
        end
    
        # Show the children of a header line.
        def setFoldExpanded(line, expanded)
          sendMessage(2229, line, expanded)
        end
    
        # Is a header line expanded?
        def getFoldExpanded(line)
          sendMessage(2230, line, 0) == 1 ? true : false
        end
    
        # Switch a header line between expanded and contracted.
        def toggleFold(line)
          sendMessage(2231, line, 0)
        end
    
        # Ensure a particular line is visible by expanding any header line hiding it.
        def ensureVisible(line)
          sendMessage(2232, line, 0)
        end
    
        SC_FOLDFLAG_LINEBEFORE_EXPANDED = 0x0002
        SC_FOLDFLAG_LINEBEFORE_CONTRACTED = 0x0004
        SC_FOLDFLAG_LINEAFTER_EXPANDED = 0x0008
        SC_FOLDFLAG_LINEAFTER_CONTRACTED = 0x0010
        SC_FOLDFLAG_LEVELNUMBERS = 0x0040
    
        # Set some style options for folding.
        def setFoldFlags(flags)
          sendMessage(2233, flags, 0)
        end
    
        # Ensure a particular line is visible by expanding any header line hiding it.
        # Use the currently set visibility policy to determine which range to display.
        def ensureVisibleEnforcePolicy(line)
          sendMessage(2234, line, 0)
        end
    
        # Sets whether a tab pressed when caret is within indentation indents.
        def setTabIndents(tabIndents)
          sendMessage(2260, tabIndents, 0)
        end
    
        # Does a tab pressed when caret is within indentation indent?
        def getTabIndents
          sendMessage(2261, 0, 0) == 1 ? true : false
        end
    
        # Sets whether a backspace pressed when caret is within indentation unindents.
        def setBackSpaceUnIndents(bsUnIndents)
          sendMessage(2262, bsUnIndents, 0)
        end
    
        # Does a backspace pressed when caret is within indentation unindent?
        def getBackSpaceUnIndents
          sendMessage(2263, 0, 0) == 1 ? true : false
        end
    
        SC_TIME_FOREVER = 10000000
    
        # Sets the time the mouse must sit still to generate a mouse dwell event.
        def setMouseDwellTime(periodMilliseconds)
          sendMessage(2264, periodMilliseconds, 0)
        end
    
        # Retrieve the time the mouse must sit still to generate a mouse dwell event.
        def getMouseDwellTime
          sendMessage(2265, 0, 0)
        end
    
        # Get position of start of word.
        def wordStartPosition(pos, onlyWordCharacters)
          sendMessage(2266, pos, onlyWordCharacters)
        end
    
        # Get position of end of word.
        def wordEndPosition(pos, onlyWordCharacters)
          sendMessage(2267, pos, onlyWordCharacters)
        end
    
        SC_WRAP_NONE = 0
        SC_WRAP_WORD = 1
        SC_WRAP_CHAR = 2
    
        # Sets whether text is word wrapped.
        def setWrapMode(mode)
          sendMessage(2268, mode, 0)
        end
    
        # Retrieve whether text is word wrapped.
        def getWrapMode
          sendMessage(2269, 0, 0)
        end
    
        SC_WRAPVISUALFLAG_NONE = 0x0000
        SC_WRAPVISUALFLAG_END = 0x0001
        SC_WRAPVISUALFLAG_START = 0x0002
    
        # Set the display mode of visual flags for wrapped lines.
        def setWrapVisualFlags(wrapVisualFlags)
          sendMessage(2460, wrapVisualFlags, 0)
        end
    
        # Retrive the display mode of visual flags for wrapped lines.
        def getWrapVisualFlags
          sendMessage(2461, 0, 0)
        end
    
        SC_WRAPVISUALFLAGLOC_DEFAULT = 0x0000
        SC_WRAPVISUALFLAGLOC_END_BY_TEXT = 0x0001
        SC_WRAPVISUALFLAGLOC_START_BY_TEXT = 0x0002
    
        # Set the location of visual flags for wrapped lines.
        def setWrapVisualFlagsLocation(wrapVisualFlagsLocation)
          sendMessage(2462, wrapVisualFlagsLocation, 0)
        end
    
        # Retrive the location of visual flags for wrapped lines.
        def getWrapVisualFlagsLocation
          sendMessage(2463, 0, 0)
        end
    
        # Set the start indent for wrapped lines.
        def setWrapStartIndent(indent)
          sendMessage(2464, indent, 0)
        end
    
        # Retrive the start indent for wrapped lines.
        def getWrapStartIndent
          sendMessage(2465, 0, 0)
        end
    
    
        SC_WRAPINDENT_FIXED = 0
        SC_WRAPINDENT_SAME = 1
        SC_WRAPINDENT_INDENT = 2
    
        # Sets how wrapped sublines are placed. Default is fixed.
        def setWrapIndentMode(mode)
          sendMessage(2472, mode, 0)
        end
    
        # Retrieve how wrapped sublines are placed. Default is fixed.
        def getWrapIndentMode
          sendMessage(2473, 0, 0)
        end
    
    
        SC_CACHE_NONE = 0
        SC_CACHE_CARET = 1
        SC_CACHE_PAGE = 2
        SC_CACHE_DOCUMENT = 3
    
        # Sets the degree of caching of layout information.
        def setLayoutCache(mode)
          sendMessage(2272, mode, 0)
        end
    
        # Retrieve the degree of caching of layout information.
        def getLayoutCache
          sendMessage(2273, 0, 0)
        end
    
        # Sets the document width assumed for scrolling.
        def setScrollWidth(pixelWidth)
          sendMessage(2274, pixelWidth, 0)
        end
    
        # Retrieve the document width assumed for scrolling.
        def getScrollWidth
          sendMessage(2275, 0, 0)
        end
    
    
        # Sets whether the maximum width line displayed is used to set scroll width.
        def setScrollWidthTracking(tracking)
          sendMessage(2516, tracking, 0)
        end
    
        # Retrieve whether the scroll width tracks wide lines.
        def getScrollWidthTracking
          sendMessage(2517, 0, 0) == 1 ? true : false
        end
    
    
        # Measure the pixel width of some text in a particular style.
        # NUL terminated text argument.
        # Does not handle tab or control characters.
        def textWidth(style, text)
          sendMessage(2276, style, text)
        end
    
        # Sets the scroll range so that maximum scroll position has
        # the last line at the bottom of the view (default).
        # Setting this to false allows scrolling one page below the last line.
        def setEndAtLastLine(endAtLastLine)
          sendMessage(2277, endAtLastLine, 0)
        end
    
        # Retrieve whether the maximum scroll position has the last
        # line at the bottom of the view.
        def getEndAtLastLine
          sendMessage(2278, 0, 0) == 1 ? true : false
        end
    
        # Retrieve the height of a particular line of text in pixels.
        def textHeight(line)
          sendMessage(2279, line, 0)
        end
    
        # Show or hide the vertical scroll bar.
        def setVScrollBar(show)
          sendMessage(2280, show, 0)
        end
    
        # Is the vertical scroll bar visible?
        def getVScrollBar
          sendMessage(2281, 0, 0) == 1 ? true : false
        end
    
        # Append a string to the end of the document without changing the selection.
        def appendText(length, text)
          sendMessage(2282, length, text)
        end
    
        # Is drawing done in two phases with backgrounds drawn before faoregrounds?
        def getTwoPhaseDraw
          sendMessage(2283, 0, 0) == 1 ? true : false
        end
    
        # In twoPhaseDraw mode, drawing is performed in two phases, first the background
        # and then the foreground. This avoids chopping off characters that overlap the next run.
        def setTwoPhaseDraw(twoPhase)
          sendMessage(2284, twoPhase, 0)
        end
    
    
        # Control font anti-aliasing.
    
        SC_EFF_QUALITY_MASK = 0xF
        SC_EFF_QUALITY_DEFAULT = 0
        SC_EFF_QUALITY_NON_ANTIALIASED = 1
        SC_EFF_QUALITY_ANTIALIASED = 2
        SC_EFF_QUALITY_LCD_OPTIMIZED = 3
    
        # Choose the quality level for text from the FontQuality enumeration.
        def setFontQuality(fontQuality)
          sendMessage(2611, fontQuality, 0)
        end
    
        # Retrieve the quality level for text.
        def getFontQuality
          sendMessage(2612, 0, 0)
        end
    
        # Scroll so that a display line is at the top of the display.
        def setFirstVisibleLine(lineDisplay)
          sendMessage(2613, lineDisplay, 0)
        end
    
        SC_MULTIPASTE_ONCE = 0
        SC_MULTIPASTE_EACH = 1
    
        # Change the effect of pasting when there are multiple selections.
        def setMultiPaste(multiPaste)
          sendMessage(2614, multiPaste, 0)
        end
    
        # Retrieve the effect of pasting when there are multiple selections..
        def getMultiPaste
          sendMessage(2615, 0, 0)
        end
    
        # Retrieve the value of a tag from a regular expression search.
        def getTag(tagNumber)
          buffer = "".ljust(tagNumber)
          sendMessage(2616, tagNumber, buffer)
          buffer
        end
    
    
        # Make the target range start and end be the same as the selection range start and end.
        def targetFromSelection
          sendMessage(2287, 0, 0)
        end
    
        # Join the lines in the target.
        def linesJoin
          sendMessage(2288, 0, 0)
        end
    
        # Split the lines in the target into lines that are less wide than pixelWidth
        # where possible.
        def linesSplit(pixelWidth)
          sendMessage(2289, pixelWidth, 0)
        end
    
        # Set the colours used as a chequerboard pattern in the fold margin
        def setFoldMarginColour(useSetting, back)
          sendMessage(2290, useSetting, back & 0xffffff)
        end
        def setFoldMarginHiColour(useSetting, fore)
          sendMessage(2291, useSetting, fore & 0xffffff)
        end
    
    
        # Move caret down one line.
        def lineDown
          sendMessage(2300, 0, 0)
        end
    
        # Move caret down one line extending selection to new caret position.
        def lineDownExtend
          sendMessage(2301, 0, 0)
        end
    
        # Move caret up one line.
        def lineUp
          sendMessage(2302, 0, 0)
        end
    
        # Move caret up one line extending selection to new caret position.
        def lineUpExtend
          sendMessage(2303, 0, 0)
        end
    
        # Move caret left one character.
        def charLeft
          sendMessage(2304, 0, 0)
        end
    
        # Move caret left one character extending selection to new caret position.
        def charLeftExtend
          sendMessage(2305, 0, 0)
        end
    
        # Move caret right one character.
        def charRight
          sendMessage(2306, 0, 0)
        end
    
        # Move caret right one character extending selection to new caret position.
        def charRightExtend
          sendMessage(2307, 0, 0)
        end
    
        # Move caret left one word.
        def wordLeft
          sendMessage(2308, 0, 0)
        end
    
        # Move caret left one word extending selection to new caret position.
        def wordLeftExtend
          sendMessage(2309, 0, 0)
        end
    
        # Move caret right one word.
        def wordRight
          sendMessage(2310, 0, 0)
        end
    
        # Move caret right one word extending selection to new caret position.
        def wordRightExtend
          sendMessage(2311, 0, 0)
        end
    
        # Move caret to first position on line.
        def home
          sendMessage(2312, 0, 0)
        end
    
        # Move caret to first position on line extending selection to new caret position.
        def homeExtend
          sendMessage(2313, 0, 0)
        end
    
        # Move caret to last position on line.
        def lineEnd
          sendMessage(2314, 0, 0)
        end
    
        # Move caret to last position on line extending selection to new caret position.
        def lineEndExtend
          sendMessage(2315, 0, 0)
        end
    
        # Move caret to first position in document.
        def documentStart
          sendMessage(2316, 0, 0)
        end
    
        # Move caret to first position in document extending selection to new caret position.
        def documentStartExtend
          sendMessage(2317, 0, 0)
        end
    
        # Move caret to last position in document.
        def documentEnd
          sendMessage(2318, 0, 0)
        end
    
        # Move caret to last position in document extending selection to new caret position.
        def documentEndExtend
          sendMessage(2319, 0, 0)
        end
    
        # Move caret one page up.
        def pageUp
          sendMessage(2320, 0, 0)
        end
    
        # Move caret one page up extending selection to new caret position.
        def pageUpExtend
          sendMessage(2321, 0, 0)
        end
    
        # Move caret one page down.
        def pageDown
          sendMessage(2322, 0, 0)
        end
    
        # Move caret one page down extending selection to new caret position.
        def pageDownExtend
          sendMessage(2323, 0, 0)
        end
    
        # Switch from insert to overtype mode or the reverse.
        def editToggleOvertype
          sendMessage(2324, 0, 0)
        end
    
        # Cancel any modes such as call tip or auto-completion list display.
        def cancel
          sendMessage(2325, 0, 0)
        end
    
        # Delete the selection or if no selection, the character before the caret.
        def deleteBack
          sendMessage(2326, 0, 0)
        end
    
        # If selection is empty or all on one line replace the selection with a tab character.
        # If more than one line selected, indent the lines.
        def tab
          sendMessage(2327, 0, 0)
        end
    
        # Dedent the selected lines.
        def backTab
          sendMessage(2328, 0, 0)
        end
    
        # Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
        def newLine
          sendMessage(2329, 0, 0)
        end
    
        # Insert a Form Feed character.
        def formFeed
          sendMessage(2330, 0, 0)
        end
    
        # Move caret to before first visible character on line.
        # If already there move to first character on line.
        def vCHome
          sendMessage(2331, 0, 0)
        end
    
        # Like VCHome but extending selection to new caret position.
        def vCHomeExtend
          sendMessage(2332, 0, 0)
        end
    
        # Magnify the displayed text by increasing the sizes by 1 point.
        def zoomIn
          sendMessage(2333, 0, 0)
        end
    
        # Make the displayed text smaller by decreasing the sizes by 1 point.
        def zoomOut
          sendMessage(2334, 0, 0)
        end
    
        # Delete the word to the left of the caret.
        def delWordLeft
          sendMessage(2335, 0, 0)
        end
    
        # Delete the word to the right of the caret.
        def delWordRight
          sendMessage(2336, 0, 0)
        end
    
    
        # Delete the word to the right of the caret, but not the trailing non-word characters.
        def delWordRightEnd
          sendMessage(2518, 0, 0)
        end
    
    
        # Cut the line containing the caret.
        def lineCut
          sendMessage(2337, 0, 0)
        end
    
        # Delete the line containing the caret.
        def lineDelete
          sendMessage(2338, 0, 0)
        end
    
        # Switch the current line with the previous.
        def lineTranspose