1
0
Fork 0
Commit Graph

42 Commits

Author SHA1 Message Date
Irina Truong d6b3472db0 Esc + Enter should sumbit the query in safe multiline mode. 2022-09-14 14:59:33 -07:00
Daniel Kukula 372da81ec4
add explain visualizer (#1279)
* add explain visualizer

* format files

* remove humanize dependency

* disable by default

* add explain visualizer

* run black
2022-04-03 19:20:02 -07:00
Georgy Frolov 61c81b05f5 removed py2-related stuff 2020-03-14 10:53:43 +08:00
Owen Stephens 995e7a9deb Disable escape-enter keybinding in vi mode
Escape then enter intended as two separate key presses is a very common
sequence when using vi mode - returning to normal mode from insert mode
(escape) and then submitting the query (enter). The presence of the
escape-enter key binding overrides this behaviour by inserting
undesirable newlines (newline is be easily inserted when in insert mode
by pressing enter) or by introducing a noticable delay/lag before enter
can be pressed after escape, due to prompt toolkit not being able to
recognise escape immediately (since it may form part of an escape-enter
sequence).
2019-10-23 23:12:54 +01:00
Amjith Ramanujam f25e49555a Fix the condition for <enter> key. (#1114)
* Fix the condition for <enter> key.

* Improve the debug message and remove debug statement.
2019-10-23 22:11:44 +01:00
Owen Stephens 629a931aed fixup! fixup! Handle a multi-line query on Enter key-press (fixes #1031) 2019-10-16 22:26:25 +01:00
Owen Stephens 6763433a68 fixup! Handle a multi-line query on Enter key-press (fixes #1031) 2019-10-13 13:50:36 +01:00
Owen Stephens 7f44748149 Handle a multi-line query on Enter key-press (fixes #1031)
Use a (conditional) Enter key-binding to force-handle a multi-line
buffer, rather than doing so by (conditionally) disabling the multiline
mode of prompt_toolkit.

This has the benefit of being more efficient (the multiline Condition
filter is called very often, which (due to the repeated query parsing)
causes editing to become slow with a large buffer that ends in a
semicolon), clearer in intent (we want to force-handle the query, rather
than (temporarily) disable multiline mode which indirectly forces the
buffer to be handled) and avoids a bug in multi-line history search
(issue #1031)
2019-10-13 01:07:57 +01:00
Pedro Ferrari 19c3e0eeb8 Add key bindings to consistently move up and down in history (#1084) 2019-07-29 13:00:33 -07:00
Pablo 6d6ab3dab7 Add keybinding for alt-enter to introduce a line break (#1065)
* Add keybinding for alt-enter to introduce a line break.

* Update changelog.

* Added myself to AUTHORS file

* Fixed quote issue by pre-commit
2019-06-02 19:15:16 -07:00
Irina Truong 8cb7009bcd
black all the things. (#1049)
* added black to develop guide

* no need for pep8radius.

* changelog.

* Add pre-commit checkbox.

* Add pre-commit to dev reqs.

* Add pyproject.toml for black.

* Pre-commit config.

* Add black to travis and dev reqs.

* Install and run black in travis.

* Remove black from dev reqs.

* Lower black target version.

* Re-format with black.
2019-05-25 13:08:56 -07:00
Nathan Vērzemnieks 4af4e33e31 Allow escape to switch to vi navigation mode (#1039) 2019-04-13 13:22:03 -07:00
Amjith Ramanujam 83e17e825f Remove the expand_tab option from pgclirc. 2019-03-16 14:09:39 -07:00
Amjith Ramanujam cbd944ffab
Merge branch 'master' into tab-on-line-start 2019-03-16 14:06:24 -07:00
ಠ_ಠ bd0aaefdd2 keybinding for dismissing autocompletelist (#1007)
* +added esc key to dismiss the autocomple list

* +added esc key to dismiss the autocomple list
2019-02-12 16:18:32 -08:00
Artur Balabanov f897ea466e Merge branch 'master' into tab-on-line-start 2018-10-01 10:25:13 +01:00
Irina Truong 392491a74d
Cherry-picked prompt-toolkit 2.0 changes. (#930)
* Cherry-picked prompt-toolkit 2.0 changes.

* Increase help timeout.

* Missed one.

* Fixes editor command.

* Expect exact to fix named query error.

* Unicode is non-optional with ptk 2.0.

* Unicode literals all the things (almost).

* PEP8.

* Change how we swap completers.

* By default, bottom toolbar styles are reversed. We don't want that.

* Adapt styles to 2.0.

* The future is now. Switch to ptk 2.0 style names.

* PEP8.

* Flag for enable_open_in_editor.

* add class:prompt to prompt

* Removed workaround for #668. Some renaming.

* use pgcli.completer instead of app.current_buffer.completer

* enable_system_prompt=True like old prompt toolkit

* keep search_ignore_case enabled (was ignore_case)

* fix closing parenthese

* keep marking class:continuation token for continuation

* capture KeyboardInterrupt manually

AbortAction has been removed in Prompt_toolkit 2.0

* replace C-J with enter, add more comments

* reversed ([...]) to [(...)] (oops)

* pep8 fixes

* Does Vi mode have to be applied to session every time?

* (workaround) also enable vi_mode after edit command

* Fixed test errors after rebasing on master.
2018-09-28 14:18:40 -07:00
Artur Balabanov 7602998c81 On the first line only autocomplete is always triggered, regardless of whether it's empty or not 2018-07-29 09:38:23 +01:00
Artur Balabanov 77170407ad Access the current line directly from the Document instance instead of calculating it manually 2018-07-29 09:35:15 +01:00
Artur Balabanov 3cef794dd4 PEP8 warnings fixed 2018-07-27 18:08:03 +01:00
Artur Balabanov 676b5e6ff6 Add a config option -- expand_tab. If set, \t character will be replaced by 4 spaces when a <Tab> key is pressed on an empty line 2018-07-27 17:07:18 +01:00
Artur Balabanov 2870103d5d Docstring updated for the Tab key binding method 2018-07-27 16:47:15 +01:00
Artur Balabanov 205949a79b Tab press on an empty line is interrupted as a \t character insert 2018-07-27 16:44:38 +01:00
Amjith Ramanujam 925341cbce Add fish-style autosuggestion. 2017-07-16 15:20:10 -07:00
Jonathan Slenders e4552e5f13 Upgrade to prompt-toolkit 1.0.0 2016-05-05 20:10:59 +02:00
Jonathan Slenders 67d76bf7e8 Upgrade to prompt-toolkit-0.57 2016-01-17 05:52:15 +01:00
Matheus Rosa b9cb367003 Makes "enter" key function as the "tab" key only when the completion menu is displayed 2015-10-10 00:59:57 -03:00
Jonathan Slenders 954fc158fa Upgrade to prompt_toolkit 0.46 2015-08-08 22:48:08 +02:00
Jonathan Slenders 436dddd3b2 Integration with prompt_toolkit==0.45 2015-07-31 09:40:59 +02:00
Jonathan Slenders e5f4e65658 Upgrade to prompt_toolkit==0.39 2015-06-04 17:13:41 +02:00
Jonathan Slenders 5f8126c179 Upgrade to prompt-toolkit 0.34 2015-05-11 13:29:45 -07:00
Daniel Rocco 1f168bd5b8 Differentiate Tab (complete next) from Ctrl-Space (show completions) 2015-04-28 21:11:28 -04:00
Daniel Rocco 810d202df9 Have Tab autocomplete at cursor
Closes #222
2015-04-27 22:25:17 -04:00
Amjith Ramanujam 112f166f11 Make F4 toggle vi/emacs modes. 2015-02-12 22:29:00 -08:00
Jay Zeng 9d6adb9b09 Get vi mode working 2015-02-12 14:32:13 -08:00
Amjith Ramanujam dae5bb7174 Use the KeyBindingManager. 2015-01-11 23:37:32 -08:00
Karl-Aksel Puulmann 0b7e04a161 Update prompt_toolkit version, now supporting CTRL+arrow shortcuts.
There were some incompatibilities with the previous API, outlined in their commit
0d0a5566a8.
2015-01-08 22:18:31 +02:00
Amjith Ramanujam e5024c8869 Refactor pgcompleter. 2015-01-04 16:46:58 -08:00
Iryna Cherniavska d41d7073df removed unnecessary keybinding in selection mode 2014-12-19 22:36:58 -08:00
Iryna Cherniavska 2e64ba3e1f added binding on control-space; changed order to order by 2014-12-19 08:21:59 -08:00
Amjith Ramanujam 312770e10e F3 to toggle multi-line. 2014-12-15 22:04:03 -08:00
Amjith Ramanujam 764b5d5a8f Add a toolbar and keybinding F2 for smart completion. 2014-12-11 00:26:32 -08:00