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.