Skip to content

Commit

Permalink
another approach to Fix selection after running a settings quick action
Browse files Browse the repository at this point in the history
  • Loading branch information
b-j-p committed May 28, 2019
1 parent 6ca56ce commit e57e7fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/src/site-admin/configHelpers.ts
Expand Up @@ -11,7 +11,7 @@ const defaultFormattingOptions: FormattingOptions = {

const setSearchContextLines: ConfigInsertionFunction = config => {
const DEFAULT = 3 // a reasonable value that will be clearly different from the default 1
return { edits: setProperty(config, ['search.contextLines'], DEFAULT, defaultFormattingOptions) }
return { edits: setProperty(config, ['search.contextLines'], DEFAULT, defaultFormattingOptions), selectText: `${DEFAULT}` }
}

const addSearchScopeToSettings: ConfigInsertionFunction = config => {
Expand All @@ -28,7 +28,7 @@ const addSlackWebhook: ConfigInsertionFunction = config => {
webhookURL: 'get webhook URL at https://YOUR-WORKSPACE-NAME.slack.com/apps/new/A0F7XDUAZ-incoming-webhooks',
}
const edits = setProperty(config, ['notifications.slack'], value, defaultFormattingOptions)
return { edits, selectText: '""', cursorOffset: 1 }
return { edits, selectText: 'YOUR-WORKSPACE-NAME' }
}

export interface EditorAction {
Expand Down

0 comments on commit e57e7fa

Please sign in to comment.