diff --git a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php index 15002dc8d2..462029a83e 100644 --- a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php +++ b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php @@ -181,7 +181,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView { $editor_link = null; if ($paths && $this->user) { $editor_link = $this->user->loadEditorLink( - implode(' ', $paths), + $paths, 1, // line number $this->repository->getCallsign()); if ($editor_link) { diff --git a/src/applications/people/storage/PhabricatorUser.php b/src/applications/people/storage/PhabricatorUser.php index 01d760f9f5..a0d621ca8c 100644 --- a/src/applications/people/storage/PhabricatorUser.php +++ b/src/applications/people/storage/PhabricatorUser.php @@ -450,6 +450,19 @@ final class PhabricatorUser extends PhabricatorUserDAO implements PhutilPerson { public function loadEditorLink($path, $line, $callsign) { $editor = $this->loadPreferences()->getPreference( PhabricatorUserPreferences::PREFERENCE_EDITOR); + + if (is_array($path)) { + $multiedit = $this->loadPreferences()->getPreference( + PhabricatorUserPreferences::PREFERENCE_MULTIEDIT); + switch ($multiedit) { + case '': + $path = implode(' ', $path); + break; + case 'disable': + return null; + } + } + if ($editor) { return strtr($editor, array( '%%' => '%', diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php index 1f6c22faf8..b4fbdc457f 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php @@ -21,6 +21,7 @@ final class PhabricatorSettingsPanelDisplayPreferences $pref_monospaced = PhabricatorUserPreferences::PREFERENCE_MONOSPACED; $pref_editor = PhabricatorUserPreferences::PREFERENCE_EDITOR; + $pref_multiedit = PhabricatorUserPreferences::PREFERENCE_MULTIEDIT; $pref_titles = PhabricatorUserPreferences::PREFERENCE_TITLES; $pref_symbols = PhabricatorUserPreferences::PREFERENCE_DIFFUSION_SYMBOLS; $pref_monospaced_textareas = @@ -34,6 +35,9 @@ final class PhabricatorSettingsPanelDisplayPreferences $preferences->setPreference($pref_titles, $request->getStr($pref_titles)); $preferences->setPreference($pref_editor, $request->getStr($pref_editor)); + $preferences->setPreference( + $pref_multiedit, + $request->getStr($pref_multiedit)); $preferences->setPreference( $pref_symbols, $request->getStr($pref_symbols)); @@ -96,6 +100,15 @@ EXAMPLE; 'callsign, %% by literal %. '. "For documentation, see {$editor_doc_link}.") ->setValue($preferences->getPreference($pref_editor))) + ->appendChild( + id(new AphrontFormSelectControl()) + ->setLabel('Edit Multiple Files') + ->setName($pref_multiedit) + ->setOptions(array( + '' => 'Supported (paths separated by spaces)', + 'disable' => 'Not Supported', + )) + ->setValue($preferences->getPreference($pref_multiedit))) ->appendChild( id(new AphrontFormTextControl()) ->setLabel('Monospaced Font') diff --git a/src/applications/settings/storage/PhabricatorUserPreferences.php b/src/applications/settings/storage/PhabricatorUserPreferences.php index 081fd9dd51..28bd1fbf9e 100644 --- a/src/applications/settings/storage/PhabricatorUserPreferences.php +++ b/src/applications/settings/storage/PhabricatorUserPreferences.php @@ -4,6 +4,7 @@ final class PhabricatorUserPreferences extends PhabricatorUserDAO { const PREFERENCE_MONOSPACED = 'monospaced'; const PREFERENCE_EDITOR = 'editor'; + const PREFERENCE_MULTIEDIT = 'multiedit'; const PREFERENCE_TITLES = 'titles'; const PREFERENCE_MONOSPACED_TEXTAREAS = 'monospaced-textareas';