diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..c2f7e71 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,14 @@ +name: pre-commit + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 diff --git a/clients/vim/README.md b/clients/vim/README.md index 165d8ea..c1c9749 100644 --- a/clients/vim/README.md +++ b/clients/vim/README.md @@ -4,7 +4,7 @@ 1. VIM 9.0+ with `+job` and `+textprop` features enabled. NeoVIM is not supported at the moment. 2. Node.js 16.0+, with `yarn` or `npm` installed. - + ## Setup 1. Build node scripts in `node_scripts/` directory. Use `yarn` as example. You can also use `npm` instead. @@ -34,4 +34,3 @@ 1. In insert mode, Tabby will show code suggestion when you stop typing. Press `` to accpet the current suggestion, `` to see the next suggestion, `` to see previous suggestion, or `` to dismiss. 2. Use command `:Tabby enable` to enable, `:Tabby disable` to disable Tabby, and `:Tabby status` to check status. - diff --git a/clients/vim/autoload/tabby.vim b/clients/vim/autoload/tabby.vim index 8575dd2..ad37660 100644 --- a/clients/vim/autoload/tabby.vim +++ b/clients/vim/autoload/tabby.vim @@ -301,7 +301,7 @@ function! tabby#Accept(fallback) return a:fallback endif let lines = s:prop_shown_lines - if len(lines) == 1 + if len(lines) == 1 let s:text_to_insert = lines[0] let insertion = "\\=tabby#ComsumeInsertion()\" else @@ -331,7 +331,7 @@ function! tabby#Next() if s:completion_index == len(s:completion.choices) let s:completion_index = 0 endif - else + else let s:completion_index += 1 if s:completion_index > len(s:completion.choices) let s:completion_index = 0 @@ -348,7 +348,7 @@ function! tabby#Prev() if s:completion_index == len(s:completion.choices) let s:completion_index = len(s:completion.choices) - 1 endif - else + else let s:completion_index -= 1 if s:completion_index < 0 let s:completion_index = len(s:completion.choices) diff --git a/clients/vim/node_scripts/webpack.config.js b/clients/vim/node_scripts/webpack.config.js index f72c39a..c0319ed 100644 --- a/clients/vim/node_scripts/webpack.config.js +++ b/clients/vim/node_scripts/webpack.config.js @@ -25,4 +25,4 @@ module.exports = { } ] }, -}; \ No newline at end of file +}; diff --git a/clients/vim/plugin/tabby.vim b/clients/vim/plugin/tabby.vim index 4b70f64..a7293bf 100644 --- a/clients/vim/plugin/tabby.vim +++ b/clients/vim/plugin/tabby.vim @@ -25,4 +25,3 @@ augroup tabby autocmd BufLeave * call tabby#Clear() autocmd InsertLeave * call tabby#Clear() augroup END - diff --git a/clients/vscode/src/TabbyStatusBarItem.ts b/clients/vscode/src/TabbyStatusBarItem.ts index b38f3b7..78e0297 100644 --- a/clients/vscode/src/TabbyStatusBarItem.ts +++ b/clients/vscode/src/TabbyStatusBarItem.ts @@ -77,4 +77,3 @@ function toDisabled() { item.tooltip = "Tabby is disabled. Click to enable."; item.command = "tabby.toggleEnabled"; } - diff --git a/tabby/server/models.py b/tabby/server/models.py index 9bda292..44bcf7f 100644 --- a/tabby/server/models.py +++ b/tabby/server/models.py @@ -8,6 +8,7 @@ class Choice(BaseModel): index: int text: str + # https://code.visualstudio.com/docs/languages/identifiers class Language(str, Enum): UNKNOWN = "unknown"