aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMTextView.h
Commit message (Collapse)AuthorAgeFilesLines
* • overlapping of completion windows after refreshing its content if db ↵Bibiko2010-04-061-0/+3
| | | | | | structure fetching was finished - for some reasons it could happen that the timer? fires twice, to avoid this changed the re-invocation strategy
* More tidy up. Constants and functions.stuconnolly2010-03-311-15/+0
|
* General tidy up, with a focus on consolidating more constants in ↵stuconnolly2010-03-241-2/+2
| | | | SPConstants.h/m.
* • Query FavoritesBibiko2010-03-161-0/+5
| | | | | | | | | - added support for mirrored snippets $x x:= to be mirrored snippet index - example: SELECT $1.${2:} FROM ${1:¦$SP_ASLIST_ALL_TABLES¦} WHERE $1.${3:} = ${4:value} AND $1.$2 = • CMTextView - fixed completion issue for fuzzy search - added {} chars as auto-pair for connivence
* • added $SP_ASLIST_ALL_FIELDS_FROM_SELECTED_TABLE as pre-defined snippet listBibiko2010-03-091-0/+2
| | | | | • added Show Completion List submenu to the Custom Query Editor gear menu with the items all dbs ^1, all tables ^2, all fields ^3 • if dbStructure is available show these pre-defined completion lists with all info like the completion it does, otherwise fall back to plain style
* • outsourced keyword completion and function completion lists to ↵Bibiko2010-03-081-3/+2
| | | | | | | | | | | CompletionTokens.plist • SPQueryController manages keyword and function completion lists now; this reduces the memory usage a bit and the list is easier to edit • added pre-defined function argument snippets to CompletionTokens.plist (auto-generated from mysql's HELP) • added Preference option for Editor whether a function completion should insert () and if found the function argument snippets automatically or not - last ) will be linked as autopaired then • changed behaviour for wrapping a selection into `"'() etc. - now it re-selects the original selection after wrapping and in addition last wrap character is now marked as autopair-linked • improved logic for popping up the auto-completion list
* • added to CustomQuery's CMTextView the option to set auto-completion ↵Bibiko2010-03-071-2/+5
| | | | | | on/off, settable in Prefs and gear menu - if inserted completion is marked as function it inserts snippet (${}1:) so far; function parameters as snippets follows soon
* • CSV Import Field MapperBibiko2010-03-061-0/+1
| | | | | - fixed some issues for displaying the default values for auto_increment and time_stamp • added possibility to change the tab stop width in each CMTextView via Preference setting in Editor window
* • further preparations to allow to run any bash command(s) incl. any ↵Bibiko2010-02-061-0/+2
| | | | | | | | | scripts like Perl, Ruby, AppleScript etc inside the text macro snippets of the query favorites and insert the result for such a bash command as snippet à la: SELECT ${1:$(cat ~/Desktop/foo.txt)} or ${1:$(open 'http://www.sequelpro.com')} - such a task can be interrupted by pressing ⌘ + . anytime - if the task doesn't exit successfully the error will be written into the the standard Console log - not yet activate
* • sped up Query Editor for larger textBibiko2010-02-011-0/+8
| | | | - rewrote [NoodleLineNumber requiredThickness] completely to avoid stack overflow for larger text due to [NSMutableString string] plus appendString all the time without releasing it in time
* • added observer for all Query Editor colors to avoid initialising colors ↵Bibiko2010-01-301-0/+14
| | | | | | each time for syntax highlighting which speed it up a bit; now if one changes a color the changes are done in view after a delay of 0.1 s if text buffer < 100k for speed reasons • fixed: before highlighting the current query ensure that the text storage is in a stable and clean status; otherwise SP crashes for ranges which aren't rendered yet
* • current query highlighting is done now in drawRect: (much more faster ↵Bibiko2010-01-301-0/+12
| | | | | | | | and thanks to Jakob) • improved snippet background drawings esp. for multiple lines (commit on behalf of Jakob) • simplified code for changing and setting background colors and Pref setting for highlight current query by observers (much more faster)
* • improved the graphical representation of text macro snippetsBibiko2010-01-271-0/+2
|
* • further improvements to allow to insert programmable query favorites (as ↵Bibiko2010-01-251-1/+2
| | | | | | | | snippets) - not yet finished but workable eg fav: "SELECT ${1:`mysql`.`user`.} FROM ${2:`mysql`.`user`} ${3:WHERE}" bound to tab trigger "sel"; then write "sel" press ⇥ to expand, change `mysql`.`user`. or press ESC to insert a field, press ⇥ to select `mysql`.`user`to change if desired, etc. or press ⇧⇥ to select prev. snippet • completion can now be invoked via selection - some other tiny improvements
* • added possibility to add a query favorite by user-definable alphanumeric ↵Bibiko2010-01-241-0/+8
| | | | | | | | | tab trigger; eg if tab trigger is set to "sel" sel⇥ will insert the first query which has the defined the tab trigger • preparations to insert programmable query favorites - eg "SELECT ${*} FROM ${Table}" -- after insertion "SELECT * FROM Table" the '*' is highlighted to change, press ⇥ to select the next snippet 'Table'; ⇧⇥ selects the previous snippet; the snippet selection follows the user input - Note: not yet active
* • completion enhancementsBibiko2010-01-211-1/+1
| | | | | | | - TAB and mouse double-click inserts suggestion - field type info for 'set' and 'enum' is fixed; in addition show an arrow to show the definition - preparations for fuzzy search completion (not yet active) - reduced the font size by 1pt to avoid truncating
* • improved completion for Query Editor bound to ESCBibiko2010-01-191-2/+2
| | | | | | | | | | | | | | | - up to now for MySQL >4 available - implemented by narrow-down, i.e. write/delete to narrow-down/expand the suggestion list - ↩ inserts the suggestion, if suggestion is db/table/field/proc/func name inserts backtick quoted - for a db/table/field/proc/func name press ⇧↩ to insert à la `db`.`table`.`field` relatively to the current selected db - context-sensitive to leading db. or table. or db.table. or .table if uniquely identifiable - mysql and information_schema if available and not selected appear at the end - `|` | := caret shows the current table's fields if any or the current selected db if selected at the top; suggestions are hierarchically arranged by db, table; easiest way to insert a table/field name - e.g. type `max_c` and press ⇧↩ to insert `mysql`.`user`.`max_connections` - for table/field name suggestions press at the right column to get the path info • F5 invokes completion based on spell checker and selected language - since it is not possible to auto-detect if the user wants to complete MySQL statements or prose text Note: GUI needs improvements; completion should be tested exhaustively
* • further improvements for F5 completionBibiko2010-01-131-1/+1
| | | | | | | - first steps for context-sensitive completion: parse left side of current word to look for db.table.field constructions - eg type: mysql.user. and press F5 Note: work in progress :)
* - Upgrade Sequel Pro to be compiled as a 3-way PPC/i386/x86_64 binary for ↵rowanbeentje2010-01-091-6/+6
| | | | | | | release builds, including a large number of 64bit compatibility upgrades and tweaks - Upgrade RegexKitLite to 3.3
* Tidy up.stuconnolly2009-11-071-1/+0
|
* Replace the use of hard coded preference keys with constants to prevent ↵stuconnolly2009-10-171-1/+0
| | | | issues such as the one fixed in revision 1419. All future preference usage should be done so using these constants.
* • tiny improvements for loading SQL files and syntax highlightingBibiko2009-08-281-0/+2
|
* Merge framework integration branch back to trunk. Summary of changes:stuconnolly2009-07-211-5/+4
| | | | | | | | | | | | | | | - Includes all custom code from subclasses CMMCPConnection and CMMCPResult, meaning they have subsequently been removed from the project. - All previous Sequel Pro specific code in the above subclasses has been removed in favour of the delegate (currently set to TableDocumet) informing the framework of such information. - All references to CMMCPConnection and CMMCPResult have subsequently been changed to MCPConnection and MCPResult. - Framework includes MySQL 5.1.36 client libraries and source headers. - Framework is now built as a 4-way (32/64 bit, i386/PPC arch) binary. - All import references to <MCPKit_bundled/MCPKit_bundled.h> have been changed to <MCPKit/MCPKit.h>. - New script 'build-mysql-client.sh' can be used to build the MySQL client libraries from the MySQL source. See the script's header for a list of available options or run it with no arguments to display it's usage. Note that there are still a few changes to be made to the framework with regard to removing Sequel Pro specific calls to the delegate. These however can be made later on as they have no effect on functionality and are merely design changes. Also, note that any future development done on the framework should be made to be as 'generic' as possible, with no Sequel Pro specific references. This should allow the framework to be integrated into another project without the need for SP specific code.
* • some code cleaning and tiny performance enhancements for syntax highlightingBibiko2009-06-211-0/+10
|
* • deleted the drag&drop feature of file path or content from ↵Bibiko2009-06-151-0/+3
| | | | | | | | | | | SPTextViewAdditions - that feature should be added by subclassing NSTextView • fixed focus setting of editSheet • fixed general issue if SP tries to execute a query which is longer than max_allowed_packet - now it reconnects after changing max_allowed_packet (if it's editable) - the user will be informed via a log entry about that change - the new max_allowed_packet size will be valid during the current session; after reconnection to that db the default size will be used
* • moved code for de/increasing font and drag&drop feature (content or ↵Bibiko2009-06-131-4/+0
| | | | | | | | | | | | | | while holding ⌘ path) to SPTextViewAddition - two finger zooming gesture is disabled for NSTableView cells - i.e. all NSTextViews including NSTableView cells inherit these feature • simplified QuickLookFormat IBActions - added bin/text storing type to each action • QuickLook animation set to SP's window middle point • fixed issue that while having an image in editSheet an attribute change (font/size) in the editTextView destroyed the image data • fix to allow again drag&drop an image to editSheet • hide text/image/hex segment controll and QuickLook pull down button if user chose multipleLineEditingButton for non-blob fields • disabled NSLog of print result in TableDocument
* • fixed: suppress highlighting of the current query if something is selectedBibiko2009-06-041-0/+1
| | | | • added: "Select Active Query ^Y" context menu item to the Custom Query Editor
* • improved narrow-down completionBibiko2009-05-251-0/+1
| | | | | - first trial to use images for suggestions (up to now supported: tables/views, funcs, procs, dbs, otherwise show a transparent dummy)
* • improved narrow-down completionBibiko2009-05-241-1/+1
| | | | | - added support for "in-quote completion" based on suggestions of the spell checker dict and the current used words in the textView - still bound to F5
* • activate Preference setting for caret colorBibiko2009-05-241-0/+2
| | | | | | | | • added prototype for new completion (ESC -> Cocoa, F5 -> new completion) - not yet finished - TODO: -- support for NSSpellChecker items -- images for different types of suggestions like proc/func/tabkle/view/sql statement, db name, etc.
* • made mySQLConnection reachable for CMTextViewBibiko2009-05-201-0/+4
| | | | | | | • for MySQL version > 4 added proc/func names to the completion suggestion list • changed the way of adding the table names to the completion suggestion list - now it uses [mySQLConnection listTables] instead of taking the names from the table view list due to the header items • added some pragma marks to CMTextView
* • added ⌘+ and ⌘- for increasing/decreasing the font size by 1 in the ↵Bibiko2009-05-201-1/+3
| | | | Custom Query Editor quickly
* More header updates for source files, including Subversion Id property.stuconnolly2009-05-191-1/+2
|
* • skip auto-pairing if the caret is adjoined to an alphanumeric character ↵Bibiko2009-05-191-0/+1
| | | | except if the inserted character will be a “(” and the caret is located at the end of a string then process the auto-pairing
* • added drag 'n' drop functionality to CMTextView to allow to drag a file ↵Bibiko2009-05-081-0/+2
| | | | | | | | | | path onto the Custom Query editor in order to insert the file content - ⌘ + drag inserts the file name - if file's content size > 1MB it asks for confirmation - it tries to auto-detect the file's encoding (stable for UTF8/16/32, Latin1, MacRoman) - it tries to insert only plain text files (by using of the UNIX 'file -I' command) - error messages etc. are written to the console.log + NSBeep
* • added "Query Editor" preference pane for setting colors, font, and modes ↵Bibiko2009-05-071-4/+5
| | | | | | | | | | | | | | | | | (from the CQ's action gear which are still customizable there) - in addition to the syntax colors it's now possible to change the fore/background color as well • added "Update Help while typing" feature in the Custom Query editor • first trial to improve syntax highlighting for large text in the Custom Query editor - if the text is larger than 10k the highlighting is performed only for the visible text area ±bias (3.5k) - if the user changes the visible area the highlighting follows time-delayed 500ms) to assure user interaction - a test with a 45MB SQL dump worked (of course a tick slowier) -- todo: improve prev/current query detection (mainly the SQLParser) - if the text size is > 6MB the completion list won't show words from the text due to parsing time - if the text size is > 6MB the line numbering will be disabled due to performance issue (improvements should follow) • some tiny clarification changes in the syntax highlighting code • some minor code cosmetics
* • improved completion in CQ's text viewBibiko2009-05-021-1/+8
| | | | | | | - added database names - fixed logic for detecting if caret is inside quotes - if caret inside backticks show only db, table, column names • outsourced syntax highlighting into a method for further improvements
* • changed context menu item in CQ's textview to support "MySQL Help"Bibiko2009-04-301-1/+4
| | | | | • prepared code to work with autoHelp • improved getRangeForCurrentWord (fix for " |a")
* • MySQL HelpBibiko2009-04-301-0/+2
| | | | | | - updated autoHelp, now it recognizes cursor movement via mouse • if the chunk in CQ's textview is too large remove all attributes • some minor code cosmetics
* • MySQL HelpBibiko2009-04-291-0/+4
| | | | | - first trial to implement an "autoHelp" function This function calls showHelpForCurrentWord (or selection) 1 sec after stopping typing and shows the Help in the Help window if the caret is not inside of quotes. To invoke it set autohelpEnabled=YES in CMTextView.m's awakeFromNib method.
* • added - (unsigned int) getLineNumberForCharacterIndex:(unsigned int)anIndex;Bibiko2009-04-211-0/+1
|
* • added selectLineNumber:x to CMTextView to be able to select the line xBibiko2009-04-201-0/+1
| | | | | | | | | • added error highlighting of the first mentioned error - if a "near message" error is provided select that message otherwise select the entire error line and scrolls to it - if no "at line x" and no "near message" is given do nothing - if a selection was given and the user pressed "runAll" destroy the selection before error checking; if no error was found reconstruct that selection (to be able to distinguish between "runSelection" and "runAll" plus selection) * changed slightly the trigger for syntax highlighting/auto-uppercasing for better scrollToRange behaviour
* Add a slightly modified patch to lookup up the selected text in the custom ↵stuconnolly2009-04-191-0/+2
| | | | query editor in the MySQL online documentation. Code contributed via issue #236.
* - Implement line numbering for CMTextView:rowanbeentje2009-04-161-0/+4
| | | | | | - Add an implementation of NoodleLineNumberView, by Paul Kim. Slightly tweaked to remove markers. - Add to CMTextView (to enable it for other CMTextView uses, hook up the scrollView outlet to the containing scroll view)
* • FIXED if deleteBackward: avoid auto-uppercasing if resulting word would ↵Bibiko2009-04-081-0/+1
| | | | | | be a SQL keyword - e.g. type inta and then press deleteBackward:
* - Add the ability for CMTextView to automatically capitalise SQL keywords ↵rowanbeentje2009-04-031-0/+3
| | | | in the text view, currently off by default but saved from preferences. Thanks again to Hans-Jörg Bibiko for this patch; see Issue #218.
* - Add a new "gear" action menu underneath the custom query view, including ↵rowanbeentje2009-04-021-8/+10
| | | | | | | | | | | | a number of items: - Add menu commands for "Run All" and "Run Selected", with additional keyboard shortcuts - cmd-R for Run all, addressing #137 - Add menu commands for indenting text, outdenting text, and to show autocompletion is available - Add menu commands to toggle autopairing and autoindenting - Also hidden menu commands for history navigation and clearing, not hooked in yet (see #207) - Add a new method to our string additions: lineRangesForRange - Add "shift right" (indent) and "shift left" (outdent) support to CMTextView, including for multiple lines
* - Add autopairing support to CMTextView - many thanks to Hans-Jörg Bibiko ↵rowanbeentje2009-04-011-3/+15
| | | | | | | | for the original patch (see http://code.google.com/p/sequel-pro/issues/detail?id=208 for full details). Applied with slight amendments. - Further changes to make CMTextView more standalone and reusable - autopairing and autoindenting can now be enabled/disabled and checked. - Autopairing and autoindenting moved to app preferences.
* MERGED r262:266 from branches/stuart02 to trunk to include new project ↵stuconnolly2008-12-101-0/+32
structure.
ef='#n1460'>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 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245