1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 01:32:42 +01:00
phorge-phorge/src/applications/paste
epriestley d280b24239 Fix "arc paste" to stop creating pastes with an empty string ("") as the "language"
Summary:
See PHI652. When you `echo x | arc paste` today, you end up with a Paste object that has the empty string as its "language".

This is normally not valid. Pastes where the language should be autodetected should have the value `null`, not the empty string.

This behavior likely changed when `paste.create` got rewritten in terms of `paste.edit`. Adjust the implementation so it only adds the LANGUAGE transaction if there's an actual language.

Also, fix an issue where you can't use the "delete" key to delete tokens with the empty string as their value.

Test Plan:
  - Created a paste with `echo x | arc paste`, got a paste in autodetect mode instead of with a bogus language value.
  - Created a paste with `echo x | arc paste --lang rainbow`, got a rainbow paste.
  - Deleted an empty string token with the keyboard.
  - Deleted normal tokens with the keyboard.
  - Edited subscribers/etc normally with the keyboard and mouse to make sure I didn't ruin anything.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D19437
2018-05-09 13:22:58 -07:00
..
application Update Phurl to use EditEngine 2016-09-20 09:38:49 -04:00
capability Paste: Add edit policy 2014-12-31 08:24:57 -08:00
conduit Fix "arc paste" to stop creating pastes with an empty string ("") as the "language" 2018-05-09 13:22:58 -07:00
config Move FontIcon calls to Icon 2016-01-28 08:48:45 -08:00
controller Move Paste line range reading code into AphrontRequest 2018-03-01 11:15:06 -08:00
editor Use object PHIDs for "Thread-Topic" headers in mail 2018-02-08 06:21:00 -08:00
engineextension Give "owners.search" a "paths" attachment and a default "owners" value 2015-12-14 11:53:50 -08:00
lipsum Make bin/lipsum generate hanldle generator keys and arguments more clearly 2017-02-27 09:09:28 -08:00
mail Modularize application transactions in Paste, mostly 2016-06-14 06:13:28 -07:00
phid Mark PhabricatorPHIDType::getPHIDTypeApplicationClass() as abstract 2015-11-03 06:47:12 +11:00
query Get line count before truncating Paste snippets 2017-03-01 22:30:18 +00:00
remarkup Add some missing type hints 2015-05-05 07:33:00 +10:00
snippet Display paste line count alongside snippets 2017-01-26 19:06:23 -05:00
storage Converted Paste language selection to a typeahead 2016-08-30 00:41:47 +00:00
typeahead Converted Paste language selection to a typeahead 2016-08-30 00:41:47 +00:00
view Return $this from setter methods 2015-07-06 22:53:43 +10:00
xaction Fix "arc paste" to stop creating pastes with an empty string ("") as the "language" 2018-05-09 13:22:58 -07:00