Преглед изворни кода

Closes #601 - adds setting to control relative date markers

main
Eric Amodio пре 6 година
родитељ
комит
7e083866f4
4 измењених фајлова са 12 додато и 0 уклоњено
  1. +1
    -0
      README.md
  2. +6
    -0
      package.json
  3. +1
    -0
      src/ui/config.ts
  4. +4
    -0
      src/views/nodes/helpers.ts

+ 1
- 0
README.md Прегледај датотеку

@ -820,6 +820,7 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
| `gitlens.views.commitFormat` | Specifies the format of committed changes in the views. See the [GitLens docs](https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting) for advanced formatting<br /><br />Available tokens<br />`${id}`&mdash; commit id<br />`${author}` &mdash; commit author<br />`${message}`&mdash; commit message<br />`${ago}` &mdash; relative commit date (e.g. 1 day ago)<br />`${date}`&mdash; formatted commit date (format specified by`gitlens.statusBar.dateFormat`)<br />`${agoOrDate}` &mdash; commit date specified by `gitlens.defaultDateStyle`<br />`${authorAgo}`&mdash; commit author, relative commit date<br />`${authorAgoOrDate}` &mdash; commit author, commit date specified by `gitlens.defaultDateStyle` |
| `gitlens.views.commitDescriptionFormat` | Specifies the description format of committed changes in the views. See the [GitLens docs](https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting) for advanced formatting<br /><br />Available tokens<br />`${id}`&mdash; commit id<br />`${author}` &mdash; commit author<br />`${message}`&mdash; commit message<br />`${ago}` &mdash; relative commit date (e.g. 1 day ago)<br />`${date}`&mdash; formatted commit date (format specified by`gitlens.statusBar.dateFormat`)<br />`${agoOrDate}` &mdash; commit date specified by `gitlens.defaultDateStyle`<br />`${authorAgo}`&mdash; commit author, relative commit date<br />`${authorAgoOrDate}` &mdash; commit author, commit date specified by `gitlens.defaultDateStyle` |
| `gitlens.views.defaultItemLimit` | Specifies the default number of items to show in a view list. Use 0 to specify no limit |
| `gitlens.views.showRelativeDateMarkers` | Specifies whether to show relative date markers (_Less than a week ago_, _Over a week ago_, _Over a month ago_, etc) on revision (commit) histories in the views |
| `gitlens.views.stashFileFormat` | Specifies the format of a stashed file in the views<br /><br />Available tokens<br />`${directory}` &mdash; directory name<br />`${file}` &mdash; file name<br />`${filePath}` &mdash; formatted file name and path<br />`${path}` &mdash; full file path |
| `gitlens.views.stashFileDescriptionFormat` | Specifies the description format of a stashed file in the views<br /><br />Available tokens<br />`${directory}` &mdash; directory name<br />`${file}` &mdash; file name<br />`${filePath}` &mdash; formatted file name and path<br />`${path}` &mdash; full file path |
| `gitlens.views.stashFormat` | Specifies the format of stashed changes in the views. See the [GitLens docs](https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting) for advanced formatting<br /><br />Available tokens<br />`${id}` &mdash; commit id<br />`${author}` &mdash; commit author<br />`${message}` &mdash; commit message<br />`${ago}` &mdash; relative commit date (e.g. 1 day ago)<br />`${date}`&mdash; formatted commit date (format specified by `gitlens.statusBar.dateFormat`)<br />`${agoOrDate}` &mdash; commit date specified by `gitlens.defaultDateStyle`<br />`${authorAgo}` &mdash; commit author, relative commit date<br />`${authorAgoOrDate}` &mdash; commit author, commit date specified by `gitlens.defaultDateStyle` |

+ 6
- 0
package.json Прегледај датотеку

@ -1497,6 +1497,12 @@
"markdownDescription": "Specifies where to show the _Search Commits_ view",
"scope": "window"
},
"gitlens.views.showRelativeDateMarkers": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show relative date markers (_Less than a week ago_, _Over a week ago_, _Over a month ago_, etc) on revision (commit) histories in the views",
"scope": "window"
},
"gitlens.views.stashFileFormat": {
"type": "string",
"default": "${file}",

+ 1
- 0
src/ui/config.ts Прегледај датотеку

@ -372,6 +372,7 @@ export interface ViewsConfig {
lineHistory: LineHistoryViewConfig;
repositories: RepositoriesViewConfig;
search: SearchViewConfig;
showRelativeDateMarkers: boolean;
stashFileDescriptionFormat: string;
stashFileFormat: string;
stashDescriptionFormat: string;

+ 4
- 0
src/views/nodes/helpers.ts Прегледај датотеку

@ -36,6 +36,10 @@ export function* insertDateMarkers
parent: ViewNode,
skip?: number
): Iterable<ViewNode> {
if (!parent.view.config.showRelativeDateMarkers) {
return yield* iterable;
}
let index = skip || 0;
let time = undefined;
const now = Date.now();

Loading…
Откажи
Сачувај