1
0
Fork 0
Commit Graph

19 Commits

Author SHA1 Message Date
Irina Truong 73d84eea28 Black. 2022-09-14 14:59:33 -07:00
Irina Truong d6b3472db0 Esc + Enter should sumbit the query in safe multiline mode. 2022-09-14 14:59:33 -07:00
Georgy Frolov 61c81b05f5 removed py2-related stuff 2020-03-14 10:53:43 +08: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 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
Amjith Ramanujam 3a45620731 Add \G as a temporary way to use expanded mode.
This is similar to mycli.
2019-06-02 17:57:36 -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
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
François Pietka 7baa76f2c1
PEP8 lint 2017-07-27 14:20:13 +02:00
François Pietka a9f4864d73
Use raw strings where needed to avoid backslash ambiguity 2017-07-27 14:08:12 +02:00
Joakim Koljonen 99868bbc31
Option for semicolon not to trigger execution in multiline mode
New setting multi_line_mode (default "psql"). If set to "safe",
[Esc] [Enter] or [Alt]-[Enter] is required to execute a query.
2016-09-12 22:28:32 +02:00
Darik Gamble 826016da29 Split table specific parseutils into separate subpackage 2016-07-27 14:27:23 -04:00
Darik Gamble 4e66819343 Don't finish multiline query with an unopen quote 2015-08-18 06:04:08 -04:00
Jonathan Slenders 436dddd3b2 Integration with prompt_toolkit==0.45 2015-07-31 09:40:59 +02:00
Jonathan Slenders 5f8126c179 Upgrade to prompt-toolkit 0.34 2015-05-11 13:29:45 -07:00
Daniel Rocco 01baee4933 Fix incorrect super() calls 2015-05-08 11:39:01 -04:00
Amjith Ramanujam a52aab7873 Handle multi-line mode with \e. 2015-04-22 23:34:39 -07: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