-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Add code editor setting dropdowns #36534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
83c9e24
Add code editor settings UI
silverwind 27a8fbe
Update web_src/js/features/codeeditor.ts
silverwind 7f6547c
Apply suggestion from @silverwind
silverwind 963e4a7
Apply suggestion from @silverwind
silverwind b9a69aa
Rename editor options template to settings
silverwind 7fc1b99
fmt
silverwind 75d75c5
Use Fomantic dropdowns for editor option selects
silverwind 92210b3
Fix first menu item border-radius for selection dropdowns
silverwind 5f70d2e
Reset font styles on editor options container
silverwind 9151a8d
Merge branch 'main' into editoropts
silverwind baa4e3e
Reduce editor option dropdown size to match small buttons
silverwind 096e534
Merge branch 'main' into editoropts
wxiaoguang 9a2342a
temp
wxiaoguang b472cf8
use native select
wxiaoguang 49a1926
clean up
wxiaoguang d89ab2c
use optgroups over tooltip
silverwind 450f372
fix js, fix select event
wxiaoguang 39f34fc
reset font size by tailwind
wxiaoguang f9b2135
use mask technique
silverwind 85a38ac
remove unneeded svgs
silverwind 7a49255
restore pointer-events
silverwind 518f02b
fix lint
silverwind 6657a32
Apply suggestion from @silverwind
silverwind 68c549d
Apply suggestion from @silverwind
silverwind 4b1b6de
Merge branch 'main' into editoropts
silverwind e6f179b
use top/translate
silverwind d188d69
Only set tabSize when EditorConfig defines indentation
silverwind 74a2498
Add aria-labels to editor option selects for accessibility
silverwind 3f811fb
fix
wxiaoguang cc81066
fix CodeEditorConfig
wxiaoguang 4934181
fix
wxiaoguang 93d320e
Update web_src/fomantic/build/components/dropdown.js
wxiaoguang 1cb2d6d
Rename CSS variable --gitea-select-arrows to --select-arrows
silverwind File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| {{$indentStyle := $.CodeEditorConfig.IndentStyle}} | ||
| {{$indentSize := or $.CodeEditorConfig.IndentSize 4}} | ||
| {{$lineWrapOn := $.CodeEditorConfig.LineWrapOn}} | ||
| <div class="flex-text-block code-editor-options"> | ||
| <div class="native-select"> | ||
|
silverwind marked this conversation as resolved.
|
||
| <select class="js-indent-style-select" aria-label="{{ctx.Locale.Tr "text_indent_style"}}"> | ||
| <optgroup label="{{ctx.Locale.Tr "text_indent_style"}}"> | ||
| <option{{if eq $indentStyle "space"}} selected{{end}} value="space">{{ctx.Locale.Tr "characters_spaces"}}</option> | ||
| <option{{if eq $indentStyle "tab"}} selected{{end}} value="tab">{{ctx.Locale.Tr "characters_tabs"}}</option> | ||
|
wxiaoguang marked this conversation as resolved.
|
||
| </optgroup> | ||
| </select> | ||
| </div> | ||
| <div class="native-select"> | ||
| <select class="js-indent-size-select" aria-label="{{ctx.Locale.Tr "text_indent_size"}}"> | ||
| <optgroup label="{{ctx.Locale.Tr "text_indent_size"}}"> | ||
| <option{{if eq $indentSize 2}} selected{{end}} value="2">2</option> | ||
| <option{{if eq $indentSize 4}} selected{{end}} value="4">4</option> | ||
| <option{{if eq $indentSize 8}} selected{{end}} value="8">8</option> | ||
| </optgroup> | ||
| </select> | ||
| </div> | ||
| <div class="native-select"> | ||
| <select class="js-line-wrap-select" aria-label="{{ctx.Locale.Tr "text_line_wrap_mode"}}"> | ||
| <optgroup label="{{ctx.Locale.Tr "text_line_wrap_mode"}}"> | ||
| <option{{if $lineWrapOn}} selected{{end}} value="on">{{ctx.Locale.Tr "text_line_wrap"}}</option> | ||
| <option{{if not $lineWrapOn}} selected{{end}} value="off">{{ctx.Locale.Tr "text_line_nowrap"}}</option> | ||
| </optgroup> | ||
| </select> | ||
| </div> | ||
| </div> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.