aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMTextView.m
Commit message (Collapse)AuthorAgeFilesLines
* Tried to fine-tune the auto-completion behaviour esp. for automatically ↵Bibiko2010-04-071-2/+1
| | | | | | inserted suggestions and increased the minimum auto-complete delay to 0.5s since below that a fight between computer speed and user typing speed could occur. This addresses i625.
* • overlapping of completion windows after refreshing its content if db ↵Bibiko2010-04-061-1/+12
| | | | | | 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-1/+0
|
* • if document window will close sent a ↵Bibiko2010-03-311-2/+3
| | | | | | 'cancelPreviousPerformRequestsWithTarget' to the custom query editor to stop auto-completion and auto-help timer to avoid crashes after closing • improved some minor stuff for completion's re-invocation
* • querying for db structure is queued for the same connection to avoid ↵Bibiko2010-03-311-12/+41
| | | | | | | | | | | 'overlapping' access to global variables • after querying db structure write back data on main thread • completion list displays animated sync images if connection is just querying db structure data • fixed some minor issue for completion list • make sure that if last window of a connection is closed all relevant data will be removed from global variables Note: please test!
* • some speed improvements and code simplifications for navigatorBibiko2010-03-301-7/+2
| | | | | | • avoid making the completion key list unique since it's possible to insert unique items only • added trigger to query db structure after SQL import • some work to avoid http://log.sequelpro.com/view/90 (not yet ideally - WIP)
* • improved completion suggestion for db schemataBibiko2010-03-291-3/+6
| | | | | | | | - if user typed "foo." and there's an unique schema path regardless cases (like there's an item Foo) show the content of the path Foo - now getUniqueDbIdentifierFor:term returns an array of found type (db or table) and the found string to handle case better for completion • tried to speed up the search in the navigator by using a NSPredicate • [MCPConennection allKeysofDbStructure] - fixed issue while returning if allKeysofDbStructure == nil
* • fixed several issue for completion listsBibiko2010-03-291-2/+2
| | | | | | | • improved gathering and caching of structure data coming from connection windows with the same connection • made the structure querying more stable against threading issues • moved getUniqueDbIdentifierFor from MCPConnection to SPNavigatorController to be up-to-date in all connection windows • improved detection if db structure querying should be performed or not (not yet finished)
* - db structure for tables and views will now be queried by using SHOW… ↵Bibiko2010-03-281-16/+36
| | | | | | | | | | | statements - completion now works for server versions < 5 as well - proc/func info will be queried by using information_schema for mysql >= 5 - changed completion logic to handle new format - completion will get the info from SPNavigator since this controller caches all information about db structure - optimization and fine-tuning will follow very soon
* • first steps to ease the structure querying for auto-completion and navigatorBibiko2010-03-261-1/+9
| | | | | | | - now it accumulates the data and caches them db by db, ie one has to select a db before using its structure for completion and navigator - next step is to avoid querying info_schema as much as possible - it will only query the structure if something was changed - next steps follows as soon as possible
* • fixed the type info display of fields in the auto-completion list due ↵Bibiko2010-03-251-1/+1
| | | | the changed queried structure
* - Remove observers for key paths when dealloc'ing objects to fix later ↵rowanbeentje2010-03-231-0/+17
| | | | | | | crashes when changing those keyvalues (eg changing query editor background colour after closing windows - http://log.sequelpro.com/view/44 ) - Fix a memory leak of a prefs reference in CMTextView
* • NavigatorBibiko2010-03-211-0/+38
| | | | | | | | | | - added 'sync' mode - the navigator follows the active window db/table selection if navigator has not multiple selected items - added drag support of selected items -- as comma separated and backtick quoted string for external apps -- as array of schema paths for SP • CMTextView - added drop support for selected items coming from the Navigator - insert them as comma list relative to current selected db/table
* • some improvements for navigatorBibiko2010-03-191-1/+1
|
* • further work on Navigator (not yet active but workable -> unHide menu item)Bibiko2010-03-191-43/+68
|
* • changed NSDictionary structure for [MCPConnection queryDbStructure]Bibiko2010-03-171-2/+4
| | | | | | - added key, extra, privileges information to it - changed object type for 'field_name' to an array containing the values type, charset, key, extra, priv - completion for fields now also shows PRI, MUL, etc. keys
* - fixed bug for nested snippets if a nested snippet is located at the very ↵Bibiko2010-03-171-1/+10
| | | | | | end of the text buffer and has no default value - added a range sanity check for completion before insertion of the chosen item
* • fixed bug while presetting the mirrored snippets to their counterparts; ↵Bibiko2010-03-161-5/+5
| | | | take into account the relative position of the insertion point (tab trigger)
* • Query FavoritesBibiko2010-03-161-7/+188
| | | | | | | | | - 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
* - Make a number of changes to attempt to improve disconnection/quit ↵rowanbeentje2010-03-161-2/+0
| | | | | | | | | crashes: prevent multiple disconnects, add more checks, cancel current queries, and add a tiny delay to allow mysql cleanup. - Alter MCPStreamingResult to no longer return a retained instance, setting up correct result disposal on autorelease but changing callers to retain as soon as they receive. - Review and change a number of local variables shadowing/shielding other local or global variables.
* - Fix some leaks and autoreleases after checking static analysisrowanbeentje2010-03-131-7/+6
|
* • fixed printing of Extended Table Info if Create Table Syntax view has focusBibiko2010-03-131-0/+10
| | | | | - regardless of focus it prints the table info sheet - only if user selects something then the create syntax will be printed
* • shortened SP_ASLIST_ALL_FIELDS_FROM_SELECTED_TABLE to ↵Bibiko2010-03-091-1/+1
| | | | | | SP_ASLIST_ALL_FIELDS since it's too long • some GUI improvements for Query Fav Editor's "Insert placeholder"
* • for auto-completion suppress the caret moving inside `foo`|Bibiko2010-03-091-1/+1
|
* • added $SP_ASLIST_ALL_FIELDS_FROM_SELECTED_TABLE as pre-defined snippet listBibiko2010-03-091-54/+165
| | | | | • 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
* • fixed bug in snippet list - now it inserts the chosen item correctly ↵Bibiko2010-03-091-25/+77
| | | | | | | | | | | | | after narrow-down the list • added chance to invoke the snippet list in fuzzy search mode by the template ¦¦a¦b¦¦ • added new snippet placeholders: ¦$SP_ASLIST_ALL_TABLES¦ displays a list of all tables incl. views from the current db ¦$SP_ASLIST_ALL_DATABASES¦ displays a list of all dbs from the current connection This makes it possible to write eg a query fav: USE ¦¦$SP_ASLIST_ALL_DATABASES¦¦; to search via fuzzy mode for a db and to use it
* • fixed some minor GUI issues for SPNarrowDownCompletion windowBibiko2010-03-091-2/+4
| | | | - added oneColumn mode for dict and list view to decrease the window's width
* • added possibility to define a snippet via ¦a¦b¦ – such a snippet ↵Bibiko2010-03-081-3/+42
| | | | | | | | will be shown as completion list with the items “a” and “b” • set auto-completion default Pref setting to true • fixed some auto-completion issues like do not insert common prefix automatically and some others • applied ¦a¦b¦ template to CompletionTokens.plist and some tiny corrections and improvements
* • auto-completionBibiko2010-03-081-1/+1
| | | | - make sure it will only be invoked if there're pending changes to the text buffer -this fixes issue that auto-completion was invoke by eg Run All
* • outsourced keyword completion and function completion lists to ↵Bibiko2010-03-081-1006/+56
| | | | | | | | | | | 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-10/+46
| | | | | | 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
* • set CMTextView temporarily to editable:YES if the tab stops width is ↵Bibiko2010-03-061-0/+6
| | | | changed to avoid exceptions
* • CSV Import Field MapperBibiko2010-03-061-33/+48
| | | | | - 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
* • CSV Import Field MapperBibiko2010-03-051-1/+1
| | | | | | | | | | | - removed Advanced sheet, instead resize the main sheet and display these settings in it - added advanced options LOW/HIGH_PRIORITY - improved logic for adv. settings, disabling UPDATE if target table has less than 2 fields, etc. - fixed URL for displaying the source file name - removed Help text since it's too large - should be go to the general help • CMTextView - fixed bug if ESC Completion is invoked if caret position is 0 • fixed document URL handling to come up with the correct icons etc.
* • REPAIR, OPTIMIZE, ANALYZE, FLUSH, CHECKSUM now can be applied to more ↵Bibiko2010-02-261-1/+1
| | | | | | | | than one selected item in the TablesList; if no error alert OK, if not or for CHECKSUM list the output in a table view - while sheet is open showing the accessory table user can press ⌘C for copying it - added missing NSLocalizeStrings • fixed a tiny issue for $SP_SELECTED_TABLES
* • Query Favorites:Bibiko2010-02-251-0/+13
| | | | | | | | - added snippet variable $SP_SELECTED_TABLES which inserts `table1`,`table2`, etc. (ONLY tables) • improved "Check Table" - now one can select more than one table to execute "CHECK TABLE table1,table2,… ; if all tables passed successfully alert OK, if not show the result as accessory table in the sheet note: OPTIMIZE, REPAIR, FLUSH, CHECKSUM, ANALYZE follow
* • corrected regexp for parsing text macro snippetsBibiko2010-02-151-3/+3
|
* • improved text macro snippet behaviourBibiko2010-02-131-40/+72
| | | | | | • improved the ability to run bash commands inside of snippets • ignore most of the syntax highlighting inside snippet declarations • fixed issue in CMTextView to use obj class variables only to generalise this object
* 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