Skip to content

Commit

Permalink
Fix: Get into C-c C-v C-t state, incorporating my-life.el
Browse files Browse the repository at this point in the history
  • Loading branch information
alhassy committed Nov 8, 2024
1 parent 117e79c commit c1c289c
Show file tree
Hide file tree
Showing 4 changed files with 1,270 additions and 1,357 deletions.
1 change: 1 addition & 0 deletions .aspell.en.pws
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
personal_ws-1.1 en 380
ACSII
AST
ASTs
Expand Down
56 changes: 1 addition & 55 deletions init-test.el
Original file line number Diff line number Diff line change
@@ -1,58 +1,4 @@
;; [[file:init.org::*Word Completion and Documentation Pop-ups][Word Completion and Documentation Pop-ups:2]]
(ert-deftest company-works-as-expected-in-text-mode ()
:tags '(company)
(switch-to-buffer "*TESTING COMPANY MODE ~ Text*")

;; Ensure we have a clear buffer, and enter some text. (Namely, Python code).
(erase-buffer)
(insert "\n def first(x): pass")
(insert "\n def fierce(a, b): pass")

;; Completion anything mode is enabled by default.
(should company-mode)

;; There are 2 completion candidates: The two we wrote.
(insert "\n fi")
(company-manual-begin) ;; i.e., C-/
(should (equal company-candidates '("fierce" "first")))

;; [fi ↦ fierce] Default option is the most recently matching written word.
(insert "\n fi")
(execute-kbd-macro (kbd "C-/ <return>"))
(should (looking-back "fierce"))

;; [fi ↦ first] We can use M-2 to select the candidate “first”
(insert "\n fi")
(execute-kbd-macro (kbd "C-/ M-2"))
(should (looking-back "first"))

(kill-buffer))

;; Let's enter Python mode and see how things change

(ert-deftest company-shows-keywords-alongside-completions-alphabetically ()
:tags '(company)
(switch-to-buffer "*TESTING COMPANY MODE ~ Python*")
(python-mode)

;; Ensure we have a clear buffer, and enter some text. (Namely, Python code).
(erase-buffer)
(insert "\n def first(x): pass")
(insert "\n def fierce(a, b): pass")

;; There are 3 completion candidates: The two we wrote, & the third being a Python keyword.
(insert "\n fi")
(company-manual-begin)
(should (equal company-candidates '("fierce" "first" #("finally" 0 7 (company-backend company-keywords)))))

;; Candidates are shown alphabetically: M-2 yields “finally”.
(execute-kbd-macro (kbd "C-g C-/ M-2")) ;; Quit and restart the completion, to get to starting position, then M-2.
(should (looking-back "finally"))

(kill-buffer))
;; Word Completion and Documentation Pop-ups:2 ends here

;; [[file:init.org::*E2E Test][E2E Test:1]]
;; [[file:init.org::#E2E-Test][E2E Test:1]]
(ert-deftest hideshow-is-enabled-and-folds-by-default ()
:tags '(hideshow)
;; Make a temporary scratch.js file with the given contents.
Expand Down
Loading

0 comments on commit c1c289c

Please sign in to comment.