[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typst-ts-mode 57616b137b 165/246: fix: corfu completion is
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typst-ts-mode 57616b137b 165/246: fix: corfu completion issue |
Date: |
Fri, 14 Feb 2025 16:55:05 -0500 (EST) |
branch: elpa/typst-ts-mode
commit 57616b137bed7f4a061eb2f65dfed78343e01776
Author: Meow King <mr.meowking@anche.no>
Commit: Meow King <mr.meowking@anche.no>
fix: corfu completion issue
closes: https://codeberg.org/meow_king/typst-ts-mode/issues/6
---
test/indentation-test.typ | 1 +
typst-ts-editing.el | 26 ++++++++++++++++----------
typst-ts-mode.el | 33 +++++++++++++++++----------------
3 files changed, 34 insertions(+), 26 deletions(-)
diff --git a/test/indentation-test.typ b/test/indentation-test.typ
index a75fbec0e3..322c513cb8 100644
--- a/test/indentation-test.typ
+++ b/test/indentation-test.typ
@@ -5,6 +5,7 @@
// typst-ts-mode-indent-offset: 4
+
#show: cv.with(
author: "",
[
diff --git a/typst-ts-editing.el b/typst-ts-editing.el
index 2c6feaa8e7..95dccede27 100644
--- a/typst-ts-editing.el
+++ b/typst-ts-editing.el
@@ -152,16 +152,22 @@ When prefix ARG is non-nil, call global return function."
))))
;; execute default action if not successful
(unless (eq execute-result 'success)
- (let ((global-ret-function
- (global-key-binding (kbd "RET"))))
- (if (and current-prefix-arg
- (yes-or-no-p
- (format
- "Execute function `%s' with the given prefix argument?"
- global-ret-function)))
- (call-interactively global-ret-function)
- (let ((current-prefix-arg nil))
- (call-interactively global-ret-function)))))))
+ ;; temporary solution for corfu completion
+ ;; see the issue here:
https://codeberg.org/meow_king/typst-ts-mode/issues/6
+ (if (and (boundp 'corfu--input) (fboundp 'corfu-insert)
+ corfu--input)
+ (corfu-insert)
+ (let ((global-ret-function
+ (global-key-binding (kbd "RET"))))
+ (if (and current-prefix-arg
+ (yes-or-no-p
+ (format
+ "Execute function `%s' with the given prefix argument?"
+ global-ret-function)))
+ (call-interactively global-ret-function)
+ (let ((current-prefix-arg nil))
+ (call-interactively global-ret-function)))))))
+ )
(defun typst-ts-mode-insert--item (node)
"Insert an item after NODE.
diff --git a/typst-ts-mode.el b/typst-ts-mode.el
index b77bbff68a..80ce305c1f 100644
--- a/typst-ts-mode.el
+++ b/typst-ts-mode.el
@@ -600,21 +600,22 @@ FILE: file path for the result compile file."
(browse-url file))
;;;###autoload
-(defvar typst-ts-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "C-c C-c c") #'typst-ts-compile-and-preview)
- (define-key map (kbd "C-c C-c C") #'typst-ts-compile)
- (define-key map (kbd "C-c C-c w") #'typst-ts-watch-mode)
- (define-key map (kbd "C-c C-c p") #'typst-ts-mode-preview)
- (define-key map (kbd "M-<left>") #'typst-ts-mode-heading-decrease)
- (define-key map (kbd "M-<right>") #'typst-ts-mode-heading-increase)
- (define-key map (kbd "M-<down>") #'typst-ts-mode-heading-down)
- (define-key map (kbd "M-<up>") #'typst-ts-mode-heading-up)
- (define-key map (kbd "M-<return>") #'typst-ts-mode-meta-return)
- (define-key map (kbd "<return>") #'typst-ts-mode-return)
- (define-key map (kbd "TAB") #'typst-ts-mode-cycle)
- (define-key map (kbd "C-c '") #'typst-ts-edit-indirect)
- map))
+(defvar-keymap typst-ts-mode-map
+ "C-c C-c c" #'typst-ts-compile-and-preview
+ "C-c C-c C" #'typst-ts-compile
+ "C-c C-c w" #'typst-ts-watch-mode
+ "C-c C-c p" #'typst-ts-mode-preview
+
+ "M-<left>" #'typst-ts-mode-heading-decrease
+ "M-<right>" #'typst-ts-mode-heading-increase
+ "M-<down>" #'typst-ts-mode-heading-down
+ "M-<up>" #'typst-ts-mode-heading-up
+ "M-<return>" #'typst-ts-mode-meta-return
+
+ "TAB" #'typst-ts-mode-cycle
+ "RET" #'typst-ts-mode-return
+ "C-c '" #'typst-ts-edit-indirect)
+
(defun typst-ts-mode-indent-line-function ()
"A simple wrapper of `treesit-indent' for handle indentation edge cases.
@@ -690,7 +691,7 @@ typst tree sitter grammar (at least %s)!"
(current-time-string min-time))
:syntax-table typst-ts-mode-syntax-table
:after-hook
(typst-ts-mode-after-hook-function)
-
+
(unless (treesit-ready-p 'typst)
(user-error "Tree-sitter for Typst isn't available"))
- [nongnu] elpa/typst-ts-mode ebcdd7da7f 109/246: feat: notify user when their typst tree sitter grammar is too old, (continued)
- [nongnu] elpa/typst-ts-mode ebcdd7da7f 109/246: feat: notify user when their typst tree sitter grammar is too old, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 1c2d9906ba 120/246: merge: refactor: split files (faces, watch mode, etc.), ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 90be6025c5 106/246: fix: don't auto-insert new item when point is after a linebreak which is the ending of a item, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 364d32c37d 119/246: refactor: Typst watch is now a minor mode., ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode f24e51271d 121/246: chore: doc, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode b18c2a9f3b 126/246: refactor!: change some customizable options' name for `typst-ts-watch-mode`, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 3bb24d0990 133/246: doc: Added block editing to README.md, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 6d94bb6efb 137/246: feat: add edit-indirect support, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 430f0b8d64 143/246: fix: called-interactively-p misses one argument, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode f5de7d33d1 151/246: feat: tinymist eglot support, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 57616b137b 165/246: fix: corfu completion issue,
ELPA Syncer <=
- [nongnu] elpa/typst-ts-mode 60ae3bf967 166/246: doc: fix a nitpick, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode b3f0a9e8a0 170/246: feat: add `typst-ts-mc-export-to-markdown` command, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 4b36b9088d 177/246: fix: return on item node who has more than 2 children, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode fab310f9a0 183/246: refactor: remove autoload on functions that depend on typst-ts-mode, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 2a3fb8e577 184/246: fix: maarkup-extended font feature, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode aee8ff090c 244/246: doc: add Contribute information on README, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 96d82bc4ba 149/246: refactor: separate editing commands into another file, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode d8c64a99f4 150/246: docs: fix typo, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode ed22e9ddc3 164/246: doc(README): update co-maintainer information, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 2132974643 169/246: chore: remove unneeded functions, ELPA Syncer, 2025/02/14