aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMTextView.m
Commit message (Collapse)AuthorAgeFilesLines
* Fix a number of memory leaks, and over-releases, as both a result of manual ↵rowanbeentje2010-02-101-2/+2
| | | | inspection of leaks and Clang static analysis.
* • initial implementation of bash execution inside ${x:…} snippetsBibiko2010-02-061-25/+52
| | | | | | - eg SELECT "${2:$(curl 'http://www.sequelpro.com/index.html' | perl -pe 's/\"/\\"/g')}" - testing phase! - each bash task can be interrupted by ⌘.
* • further preparations to allow to run any bash command(s) incl. any ↵Bibiko2010-02-061-0/+57
| | | | | | | | | 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
* • fixed undo behaviour of insertion of history/query favsBibiko2010-02-041-2/+11
| | | | • improved text macro/query favs insertion logic
* • CMTextViewBibiko2010-02-021-1/+4
| | | | | | - suppress current query/syntax highlighting for text buffer size > 20MB to allow at least editing and performing queries • Main Menu - set hidden new Export menu item to key ⇧⌘E and reset "Use selection for searching" to ⌘E since it's a standard Mac binding
* • fixed partially syntax highlighting for very very long linesBibiko2010-02-021-7/+25
| | | | • fixed some NSUInteger checks à la while(NSUInterger >= 0) since it's always > 0
* • added key-shortcut ⌘= to make the textview size largerBibiko2010-02-021-7/+46
| | | | | | | | • ⌘-, ⌘+, ⌘= changes the font size temporarily (Mac app conform) • added key-shortcut ⌘0 to reset the font to pref default • fixed search field background for Tables List • fixed NSUInteger for completion parsing; interrupt completion if parsed string length is larger than 100000 since it doesn't make sense and leads to warnings
* • fixed in CMTextView several NSInteger which has to be NSUInteger; this ↵Bibiko2010-02-021-21/+21
| | | | | | led to an issue that SP crashed for very very long lines/queries - this has to be investigate further!
* • sped up Query Editor for larger textBibiko2010-02-011-19/+26
| | | | - 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
* • CMTextView: switch off syntax highlighting if text buffer size is larger ↵Bibiko2010-02-011-6/+24
| | | | | | than SP_SYNTAX_HILITE_BIAS (has to be improved) • added SPFieldMapperController
* • re-enabled possibility to change the font size of non-editable ↵Bibiko2010-02-011-2/+2
| | | | CMTextViews via ⌘+, ⌘-, or trackpad pinch in/out gesture
* • Added basic print support for each CMTextViewBibiko2010-02-011-38/+57
| | | | • first steps to renew the field mapper sheet for CSV Import
* • improved text macro snippet logicBibiko2010-02-011-17/+19
|
* • Content Table and Query Editor table's tooltip are displayed by using ↵Bibiko2010-01-311-96/+10
| | | | | | the same font/size as the table cells • CMTextView: make sure that some methods are never called if the CMTextView is set to 'not ediable'
* • CMTextView's colours are set via observer, live changed in editable ↵Bibiko2010-01-301-35/+53
| | | | | | | | textviews • added Preference setting "Table font" in "Table" pane to set the table font/size for all result tables (Content, Custom Query) • added to SPTableView the method setFont: • fixed the initialisation of vars in CMTextView (fixes the displaying of create syntax)
* • added observer for all Query Editor colors to avoid initialising colors ↵Bibiko2010-01-301-96/+115
| | | | | | 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-23/+131
| | | | | | | | 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)
* • text macro logicBibiko2010-01-291-17/+27
| | | | | | | - improved highlighting of multi-line snippets (many thanks to jabakobob for this patch!) - some tiny cosmetics • error message highlighting in Custom Query Editor - removed near message length checking to be larger than 2, not necessary
* • further tiny improvements to avoid exceptional cases while highlighting ↵Bibiko2010-01-291-0/+3
| | | | | | | | | the erroneous query - added check for near message length - make an intersection with the buffer range before selecting • text macro - each selection of a snippet breaks the undo buffer - note: undo behaviour while text macro session is active needs to be solved ⇢ work in progress
* • fixed some issues and improved the text macro behaviourBibiko2010-01-291-62/+53
|
* • text macro improvementsBibiko2010-01-281-5/+44
| | | | | | | | - added dynamically set SP variables $SP_SELECTED_TABLE and $SP_SELECTED_DATABASE available in each ${x:…} snippet to allow to create a query fav à la: SELECT ${1:$SP_SELECTED_TABLE.} FROM ${1:$SP_SELECTED_TABLE} whereby for the first snippet one can press ESC to insert one or by holding down the CTRL key while inserting more field names from the current table - improved snippet range detection for current caret position - reduced the border width of snippet highlighting and changed slightly the colour for the current selected snippet
* • for [CMTextView selectLineNumber:…] added safety-check for lineNumber < 1Bibiko2010-01-281-1/+2
| | | | | | | | • error message highlighting in CustomQuery - check for error ID 1064 before trying to select the erroneous line given as '… at line x' (this solves the issue that other error messages could end by a number) - improved regexp to get rid of localized error messages for parsing the erroneous line number (thanks to Jakob) - look the last number in a string - improved regexp to parse for the 'near message' for localized error messages
* • ESC completionBibiko2010-01-281-15/+9
| | | | - speed up gathering data by avoiding the check for uniqueness if not necessary, make usage of NSMutableSet to collect unique data automatically, and rely on NSSubTextStorage to get all words from the text buffer (if text buffer size less than 6MB)
* • Query Favorite text macroBibiko2010-01-271-19/+24
| | | | | | - fixed bug for deletion nested snippet ranges after editing - further improvement of the graphical representation - selected snippet will be drawn differently
* • improved the graphical representation of text macro snippetsBibiko2010-01-271-6/+19
|
* • query favorite snippet session (text macro)Bibiko2010-01-271-1/+49
| | | | | - draw a bezier path around defined snippets to group them graphically (test phase) - allow the user to go into a snippet by using the mouse
* • query favorite snippet sessionBibiko2010-01-261-1/+3
| | | | - ⇧⇥ on the first snippet won't end the snippet session
* • allow user to define nested snippets inside of the query favoritesBibiko2010-01-261-252/+325
| | | | | | - eg: SELECT ${1:${2:`mysql`.`user`.} AS ${5:a}} FROM ${7:`mysql`.`user`} ${9:WHERE } • improvements of the general control of the a snippet session • code cosmetics
* • further improvements to allow to insert programmable query favorites (as ↵Bibiko2010-01-251-45/+141
| | | | | | | | 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-2/+146
| | | | | | | | | 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
* • bound Custom Query gear menu item "Completion List" (CTRL key is ↵Bibiko2010-01-221-13/+11
| | | | | | | recognized) • use regexp to get a list of current words and reduced that method to invoked if the text buffer is less than 60KB to speed up the completion (it's more likely that the user wants to complete a sql related term) • some code cosmetics
* • updated/added syntax highlighting tokens and completion suggestionsBibiko2010-01-211-1/+18
|
* • tiny undo improvement for completionBibiko2010-01-211-0/+1
|
* • added call to update the completion list to neuralgic placesBibiko2010-01-211-1/+9
| | | | - next steps to minimize the traffic - ie manipulating the dict directly without querying - follows
* • completionBibiko2010-01-211-6/+7
| | | | | | | - CTRL+ESC invokes the fuzzy search completion; eg: i_s.pcss. will show all fields from `information_schema`.`PROCESSLIST`. if no other matches are found; the search is a regexp ".*?i.*?_.*?s.*?\. …" etc. by using RegexKitLite which is much more faster than NSPredicate and can handle long regexps - improved type display: if a type definition contains a , split it to avoid splitting of the tokenFields - while insertion of an item and holding down the CTRL key the list keeps open to allow to insert more suggestions separated by ", " from the current list (very useful if one wants to insert only selected fields from a table)
* • completion enhancementsBibiko2010-01-211-10/+43
| | | | | | | - 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
* • completionBibiko2010-01-201-5/+18
| | | | | | | | - auto-completes the common prefix of all suggestions - makes typing much more faster - “ ” as allowed character to be typed for narrow-down the list is set automatically if at least one suggestion contains a “ ” - fixed two tiny memory leaks - fixed detecting db/table/field names containing ` as char - removed ⇥ binding to complete the common prefix since it's done automatically
* • improved completion for Query Editor bound to ESCBibiko2010-01-191-133/+168
| | | | | | | | | | | | | | | - 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
* - removed F5 completion debug outputBibiko2010-01-151-2/+2
| | | | - fixed issue while ‘normal’ completion after “table.” completion
* • refactored parsing code for F5 completionBibiko2010-01-151-157/+95
| | | | | - improved ⇧↩ insertion - improved backtick behaviour
* • fixed several sheetDidEnd selectors to close a NSAlert or NSWindow ↵Bibiko2010-01-131-3/+10
| | | | | | | properly to avoid overlapping sheets • F5 completion - if a table is selected and no further parsing info is given show that table and its fields at the top of the suggestions
* • F5 compeltionBibiko2010-01-131-2/+10
| | | | | - fixed issues if no db is selected - trial: ⇧↩ inserts the entire path db.table or db.table.field; if invoked inside of backticks backticked
* • further improvements for F5 completionBibiko2010-01-131-60/+242
| | | | | | | - 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 :)
* • CMTextView: Bibiko2010-01-121-2/+37
| | | | | - re-defined 34 tab stops for better editing behaviour - soft wrapped lines are slightly indented
* • further developments for the F5 completionBibiko2010-01-111-2/+21
| | | | Note: not yet finished!
* • further preparations to F5 completionBibiko2010-01-111-38/+83
| | | | Note: not yet active - only querying the data in background will be performed for testing
* • first preparations to improve the Custom Query database names/table ↵Bibiko2010-01-101-0/+3
| | | | | | | | | names/field names + type and encoding completion - after connecting and updating the table list a background task executed on a different connection will be performed to query the information_schema db (MySQL >= 5 only so far) - the MCPConnection object holds a NSDictionary with all structural data Note: not yet active
* • made lexer 64bit compatibleBibiko2010-01-101-1/+4
| | | | | | - 'int' has to be replaced by 'size_t' • F5 completion - if inside of backticks after completion move caret one char rightwards to go out of the backticks
* • F5 completionBibiko2010-01-091-1/+3
| | | | | - fixed forgotten range checking to suppress Console warning - `|` [ | := caret ] shows all field names - up to now only those from the current table - table/db/proc/func names
* • reimplemented the F5 completion for quoted text i.e. completion based on ↵Bibiko2010-01-091-7/+15
| | | | NSSpellChecker only; language is selectable via right-click "Spelling and Grammar"