chore: add pre-commit workflow (#72)
* chore: add pre-commit workflow * fix pre-commitadd-more-languages
parent
9915c57e02
commit
e28877fbbb
|
|
@ -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
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
1. VIM 9.0+ with `+job` and `+textprop` features enabled. NeoVIM is not supported at the moment.
|
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.
|
2. Node.js 16.0+, with `yarn` or `npm` installed.
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
1. Build node scripts in `node_scripts/` directory. Use `yarn` as example. You can also use `npm` instead.
|
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 `<Tab>` to accpet the current suggestion, `<M-]>` to see the next suggestion, `<M-[>` to see previous suggestion, or `<C-]>` to dismiss.
|
1. In insert mode, Tabby will show code suggestion when you stop typing. Press `<Tab>` to accpet the current suggestion, `<M-]>` to see the next suggestion, `<M-[>` to see previous suggestion, or `<C-]>` to dismiss.
|
||||||
|
|
||||||
2. Use command `:Tabby enable` to enable, `:Tabby disable` to disable Tabby, and `:Tabby status` to check status.
|
2. Use command `:Tabby enable` to enable, `:Tabby disable` to disable Tabby, and `:Tabby status` to check status.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -301,7 +301,7 @@ function! tabby#Accept(fallback)
|
||||||
return a:fallback
|
return a:fallback
|
||||||
endif
|
endif
|
||||||
let lines = s:prop_shown_lines
|
let lines = s:prop_shown_lines
|
||||||
if len(lines) == 1
|
if len(lines) == 1
|
||||||
let s:text_to_insert = lines[0]
|
let s:text_to_insert = lines[0]
|
||||||
let insertion = "\<C-R>\<C-O>=tabby#ComsumeInsertion()\<CR>"
|
let insertion = "\<C-R>\<C-O>=tabby#ComsumeInsertion()\<CR>"
|
||||||
else
|
else
|
||||||
|
|
@ -331,7 +331,7 @@ function! tabby#Next()
|
||||||
if s:completion_index == len(s:completion.choices)
|
if s:completion_index == len(s:completion.choices)
|
||||||
let s:completion_index = 0
|
let s:completion_index = 0
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
let s:completion_index += 1
|
let s:completion_index += 1
|
||||||
if s:completion_index > len(s:completion.choices)
|
if s:completion_index > len(s:completion.choices)
|
||||||
let s:completion_index = 0
|
let s:completion_index = 0
|
||||||
|
|
@ -348,7 +348,7 @@ function! tabby#Prev()
|
||||||
if s:completion_index == len(s:completion.choices)
|
if s:completion_index == len(s:completion.choices)
|
||||||
let s:completion_index = len(s:completion.choices) - 1
|
let s:completion_index = len(s:completion.choices) - 1
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
let s:completion_index -= 1
|
let s:completion_index -= 1
|
||||||
if s:completion_index < 0
|
if s:completion_index < 0
|
||||||
let s:completion_index = len(s:completion.choices)
|
let s:completion_index = len(s:completion.choices)
|
||||||
|
|
|
||||||
|
|
@ -25,4 +25,4 @@ module.exports = {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -25,4 +25,3 @@ augroup tabby
|
||||||
autocmd BufLeave * call tabby#Clear()
|
autocmd BufLeave * call tabby#Clear()
|
||||||
autocmd InsertLeave * call tabby#Clear()
|
autocmd InsertLeave * call tabby#Clear()
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,4 +77,3 @@ function toDisabled() {
|
||||||
item.tooltip = "Tabby is disabled. Click to enable.";
|
item.tooltip = "Tabby is disabled. Click to enable.";
|
||||||
item.command = "tabby.toggleEnabled";
|
item.command = "tabby.toggleEnabled";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ class Choice(BaseModel):
|
||||||
index: int
|
index: int
|
||||||
text: str
|
text: str
|
||||||
|
|
||||||
|
|
||||||
# https://code.visualstudio.com/docs/languages/identifiers
|
# https://code.visualstudio.com/docs/languages/identifiers
|
||||||
class Language(str, Enum):
|
class Language(str, Enum):
|
||||||
UNKNOWN = "unknown"
|
UNKNOWN = "unknown"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue