diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f4e4fab..0f0db7b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,6 +7,8 @@ on: paths: - 'src/**' + workflow_dispatch: + permissions: contents: write pages: write @@ -85,36 +87,4 @@ jobs: git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' git add config.lua src/LuaLS.lua release/basalt.lua CHANGELOG.md git commit -m "Update config, LuaLS definitions, bundle and changelog" || exit 0 - git push - - # Step 8: Build VitePress site - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: npm - - - name: Setup Pages - uses: actions/configure-pages@v4 - - - name: Install dependencies - run: npm ci - - - name: Build with VitePress - run: npm run docs:build - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: docs/.vitepress/dist - - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - needs: build - runs-on: ubuntu-latest - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + git push \ No newline at end of file diff --git a/src/elements/VisualElement.lua b/src/elements/VisualElement.lua index a9fbba6..d91fe66 100644 --- a/src/elements/VisualElement.lua +++ b/src/elements/VisualElement.lua @@ -310,22 +310,6 @@ function VisualElement:blur() self:setCursor(1,1, false) end ---- Calculates the position of the element relative to its parent ---- @shortDescription Calculates the position of the element ---- @return number x The x position ---- @return number y The y position -function VisualElement:calculatePosition() - local x, y = self.get("x"), self.get("y") - if not self.get("ignoreOffset") then - if self.parent ~= nil then - local xO, yO = self.parent.get("offsetX"), self.parent.get("offsetY") - x = x - xO - y = y - yO - end - end - return x, y -end - --- @shortDescription Handles a key event --- @param key number The key that was pressed --- @protected @@ -353,6 +337,22 @@ function VisualElement:char(char) end end +--- Calculates the position of the element relative to its parent +--- @shortDescription Calculates the position of the element +--- @return number x The x position +--- @return number y The y position +function VisualElement:calculatePosition() + local x, y = self.get("x"), self.get("y") + if not self.get("ignoreOffset") then + if self.parent ~= nil then + local xO, yO = self.parent.get("offsetX"), self.parent.get("offsetY") + x = x - xO + y = y - yO + end + end + return x, y +end + --- Returns the absolute position of the element or the given coordinates. --- @shortDescription Returns the absolute position of the element ---@param x? number x position