Skip to content

Add user preference to turn off keystroke formatting

What does this MR do?

Many coding/programming environments provide the ability to surround any selected text with a quote or brace, such as typing selecting the text merge request and typing a " would give you "merge request"

However these editors give the user the ability to turn this feature off. For example RubyMine has the option Surround selection on typing quote or brace. Visual Studio Code has the option Auto Surround: Controls whether the editor should automatically surround selections when typing quotes or brackets.

This MR adds a checkbox to the Behaviors section of the user preferences, https://gitlab.com/-/profile/preferences

Screenshots (strongly suggested)

Proposing adding the "Surround text selection..." checkbox

Screen_Shot_2021-02-23_at_2.42.23_PM

Migration

> rake db:migrate:up VERSION=20210209232508
== 20210209232508 AddMarkdownSurroundSelectionToUserPreferences: migrating ====
-- add_column(:user_preferences, :markdown_surround_selection, :boolean, {:default=>true, :null=>false})
   -> 0.0027s
== 20210209232508 AddMarkdownSurroundSelectionToUserPreferences: migrated (0.0104s)
> rake db:migrate:down VERSION=20210209232508
== 20210209232508 AddMarkdownSurroundSelectionToUserPreferences: reverting ====
-- remove_column(:user_preferences, :markdown_surround_selection, :boolean)
   -> 0.0069s
== 20210209232508 AddMarkdownSurroundSelectionToUserPreferences: reverted (0.0161s)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #247918 (closed)

Edited by Brett Walker

Merge request reports