Skip to content
Snippets Groups Projects
scintilla.rb 100 KiB
Newer Older
  • Learn to ignore specific revisions
  •     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
    
    
    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 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000
        # 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_FOLDLEVELBOXHEADERFLAG = 0x4000
        SC_FOLDLEVELBOXFOOTERFLAG = 0x8000
        SC_FOLDLEVELCONTRACTED = 0x10000
        SC_FOLDLEVELUNINDENT = 0x20000
        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
        SC_FOLDFLAG_BOX = 0x0001
    
        # 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_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
    
        # 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
    
        # 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
    
        # 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
          sendMessage(2339, 0, 0)
        end
    
        # Duplicate the current line.
        def lineDuplicate
          sendMessage(2404, 0, 0)
        end
    
        # Transform the selection to lower case.
        def lowerCase
          sendMessage(2340, 0, 0)
        end
    
        # Transform the selection to upper case.
        def upperCase
          sendMessage(2341, 0, 0)
        end
    
        # Scroll the document down, keeping the caret visible.
        def lineScrollDown
          sendMessage(2342, 0, 0)
        end
    
        # Scroll the document up, keeping the caret visible.
        def lineScrollUp
          sendMessage(2343, 0, 0)
        end
    
        # Delete the selection or if no selection, the character before the caret.
        # Will not delete the character before at the start of a line.
        def deleteBackNotLine
          sendMessage(2344, 0, 0)
        end
    
        # Move caret to first position on display line.
        def homeDisplay
          sendMessage(2345, 0, 0)
        end
    
        # Move caret to first position on display line extending selection to
        # new caret position.
        def homeDisplayExtend
          sendMessage(2346, 0, 0)
        end
    
        # Move caret to last position on display line.
        def lineEndDisplay
          sendMessage(2347, 0, 0)
        end
    
        # Move caret to last position on display line extending selection to new
        # caret position.
        def lineEndDisplayExtend
          sendMessage(2348, 0, 0)
        end
    
        # These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
        # except they behave differently when word-wrap is enabled:
        # They go first to the start / end of the display line, like (Home|LineEnd)Display
        # The difference is that, the cursor is already at the point, it goes on to the start
        # or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
    
        def homeWrap
          sendMessage(2349, 0, 0)
        end
        def homeWrapExtend
          sendMessage(2450, 0, 0)
        end
        def lineEndWrap
          sendMessage(2451, 0, 0)
        end
        def lineEndWrapExtend
          sendMessage(2452, 0, 0)
        end
        def vCHomeWrap
          sendMessage(2453, 0, 0)
        end
        def vCHomeWrapExtend
          sendMessage(2454, 0, 0)
        end
    
        # Copy the line containing the caret.
        def lineCopy
          sendMessage(2455, 0, 0)
        end
    
        # Move the caret inside current view if it's not there already.
        def moveCaretInsideView
          sendMessage(2401, 0, 0)
        end
    
        # How many characters are on a line, not including end of line characters?
        def lineLength(line)
          sendMessage(2350, line, 0)
        end
    
        # Highlight the characters at two positions.
        def braceHighlight(pos1, pos2)
          sendMessage(2351, pos1, pos2)
        end
    
        # Highlight the character at a position indicating there is no matching brace.
        def braceBadLight(pos)
          sendMessage(2352, pos, 0)
        end
    
        # Find the position of a matching brace or INVALID_POSITION if no match.
        def braceMatch(pos)
          sendMessage(2353, pos, 0)
        end
    
        # Are the end of line characters visible?
        def getViewEOL
          sendMessage(2355, 0, 0) == 1 ? true : false
        end
    
        # Make the end of line characters visible or invisible.
        def setViewEOL(visible)
          sendMessage(2356, visible, 0)
        end
    
        # Retrieve a pointer to the document object.
        def getDocPointer
          sendMessage(2357, 0, 0)
        end
    
        # Change the document object used.
        def setDocPointer(pointer)
          sendMessage(2358, 0, pointer)
        end
    
        # Set which document modification events are sent to the container.
        def setModEventMask(mask)
          sendMessage(2359, mask, 0)
        end
    
        EDGE_NONE = 0
        EDGE_LINE = 1
        EDGE_BACKGROUND = 2
    
        # Retrieve the column number which text should be kept within.
        def getEdgeColumn
          sendMessage(2360, 0, 0)
        end
    
        # Set the column number of the edge.
        # If text goes past the edge then it is highlighted.
        def setEdgeColumn(column)
          sendMessage(2361, column, 0)
        end
    
        # Retrieve the edge highlight mode.
        def getEdgeMode
          sendMessage(2362, 0, 0)
        end
    
        # The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
        # goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
        def setEdgeMode(mode)
          sendMessage(2363, mode, 0)
        end
    
        # Retrieve the colour used in edge indication.
        def getEdgeColour
          sendMessage(2364, 0, 0)
        end
    
        # Change the colour used in edge indication.
        def setEdgeColour(edgeColour)
          sendMessage(2365, edgeColour & 0xffffff, 0)
        end
    
        # Sets the current caret position to be the search anchor.
        def searchAnchor
          sendMessage(2366, 0, 0)
        end
    
        # Find some text starting at the search anchor.
        # Does not ensure the selection is visible.
        def searchNext(flags, text)
          sendMessage(2367, flags, text)
        end
    
        # Find some text starting at the search anchor and moving backwards.
        # Does not ensure the selection is visible.
        def searchPrev(flags, text)
          sendMessage(2368, flags, text)
        end
    
        # Retrieves the number of lines completely visible.
        def linesOnScreen
          sendMessage(2370, 0, 0)
        end
    
        # Set whether a pop up menu is displayed automatically when the user presses
        # the wrong mouse button.
        def usePopUp(allowPopUp)
          sendMessage(2371, allowPopUp, 0)
        end
    
        # Is the selection rectangular? The alternative is the more common stream selection.
        def selectionIsRectangle
          sendMessage(2372, 0, 0) == 1 ? true : false
        end
    
        # Set the zoom level. This number of points is added to the size of all fonts.
        # It may be positive to magnify or negative to reduce.
        def setZoom(zoom)