Skip to content

Commit

Permalink
Merge pull request #23 from lukas-reineke/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-reineke authored Mar 7, 2022
2 parents 555695b + c1f1d59 commit 68f6165
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 20 deletions.
55 changes: 38 additions & 17 deletions .github/workflows/pr_check.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@
name: Pull request check

on:
pull_request:
pull_request:

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: JohnnyMorganz/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --check .

block-fixup:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Block Fixup Commit Merge
uses: 13rac1/[email protected]
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: JohnnyMorganz/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --check .

block-fixup:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Block Fixup Commit Merge
uses: 13rac1/[email protected]

luacheck:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- uses: leafo/[email protected]
with:
luaVersion: 'luajit-2.1.0-beta3'

- uses: leafo/[email protected]

- name: build
run: |
luarocks install luacheck
- name: test
run: |
luacheck lua
2 changes: 2 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
globals = { "vim", "_" }
max_line_length = false
5 changes: 4 additions & 1 deletion doc/format.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


Author: Lukas Reineke <[email protected]>
Version: 2.1.0
Version: 2.1.1

==============================================================================
CONTENTS *lsp-format*
Expand Down Expand Up @@ -86,6 +86,9 @@ the `order` list. (same logic as |vim.lsp.buf.formatting_seq_sync()|)
==============================================================================
4. CHANGELOG *lsp-format-changelog*

2.1.1
* Don't overwrite the buffer when currently in insert mode

2.1.0
* Sequentially format with all attached LSP server
* Add special `order` format option
Expand Down
5 changes: 3 additions & 2 deletions lua/lsp-format/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ M.setup = function(format_options)
end
if
vim.api.nvim_buf_get_var(ctx.bufnr, "format_changedtick")
== vim.api.nvim_buf_get_var(ctx.bufnr, "changedtick")
== vim.api.nvim_buf_get_var(ctx.bufnr, "changedtick")
and not vim.startswith(vim.api.nvim_get_mode().mode, "i")
then
local view = vim.fn.winsaveview()
vim.lsp.util.apply_text_edits(result, ctx.bufnr, "utf-16")
Expand All @@ -32,8 +33,8 @@ M.setup = function(format_options)
vim.b.format_saving = true
vim.cmd [[update]]
vim.b.format_saving = false
M._next()
end
M._next()
end
end
end
Expand Down

0 comments on commit 68f6165

Please sign in to comment.