diff --git a/bench.esy.lock/index.json b/bench.esy.lock/index.json index 5259faaa59..d4edc50d00 100644 --- a/bench.esy.lock/index.json +++ b/bench.esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "e77e22f99ed9e9a0a930e9ed15400c83", + "checksum": "292ec1cefdfbf010326612a2a0aee562", "root": "Oni2@link-dev:./package.json", "node": { "yarn-pkg-config@github:esy-ocaml/yarn-pkg-config#db3a0b63883606dd57c54a7158d560d6cba8cd79@d41d8cd9": { @@ -118,7 +118,7 @@ }, "overrides": [], "dependencies": [ - "revery@github:revery-ui/revery#11d4fb4@d41d8cd9", + "revery@github:revery-ui/revery#d2e614a@d41d8cd9", "isolinear@github:revery-ui/isolinear#8cad3b0@d41d8cd9", "@revery/esy-libvterm@1.0.3@d41d8cd9", "@onivim/reason-native-crash-utils@1.0.1@d41d8cd9", @@ -126,13 +126,13 @@ ], "devDependencies": [] }, - "revery@github:revery-ui/revery#11d4fb4@d41d8cd9": { - "id": "revery@github:revery-ui/revery#11d4fb4@d41d8cd9", + "revery@github:revery-ui/revery#d2e614a@d41d8cd9": { + "id": "revery@github:revery-ui/revery#d2e614a@d41d8cd9", "name": "revery", - "version": "github:revery-ui/revery#11d4fb4", + "version": "github:revery-ui/revery#d2e614a", "source": { "type": "install", - "source": [ "github:revery-ui/revery#11d4fb4" ] + "source": [ "github:revery-ui/revery#d2e614a" ] }, "overrides": [], "dependencies": [ @@ -209,7 +209,7 @@ "@reason-native/console@0.0.3@d41d8cd9", "@opam/lwt@opam:4.5.0@542100aa", "@opam/lambda-term@opam:3.1.0@8adc2660", - "@opam/fpath@opam:0.7.2@3fd2da53", "@opam/dune@opam:2.5.0@e0bac278", + "@opam/fpath@opam:0.7.3@674d8125", "@opam/dune@opam:2.5.0@e0bac278", "@esy-ocaml/reason@3.6.2@d41d8cd9" ], "devDependencies": [ "@opam/dune@opam:2.5.0@e0bac278" ] @@ -938,7 +938,7 @@ "overrides": [ "bench.json" ], "dependencies": [ "revery-terminal@github:revery-ui/revery-terminal#37e19a3@d41d8cd9", - "revery@github:revery-ui/revery#11d4fb4@d41d8cd9", + "revery@github:revery-ui/revery#d2e614a@d41d8cd9", "reperf@1.5.0@d41d8cd9", "rench@github:bryphe/rench#a976fe5@d41d8cd9", "refmterr@3.3.2@d41d8cd9", @@ -2360,7 +2360,7 @@ "overrides": [], "dependencies": [ "ocaml@4.10.0@d41d8cd9", "@opam/tyxml@opam:4.4.0@1dca5713", - "@opam/result@opam:1.5@6b753c82", "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/result@opam:1.5@6b753c82", "@opam/fpath@opam:0.7.3@674d8125", "@opam/dune@opam:2.5.0@e0bac278", "@opam/cppo@opam:1.6.6@f4f83858", "@opam/cmdliner@opam:1.0.4@93208aac", "@opam/astring@opam:0.8.5@1300cee8", @@ -2368,7 +2368,7 @@ ], "devDependencies": [ "ocaml@4.10.0@d41d8cd9", "@opam/tyxml@opam:4.4.0@1dca5713", - "@opam/result@opam:1.5@6b753c82", "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/result@opam:1.5@6b753c82", "@opam/fpath@opam:0.7.3@674d8125", "@opam/dune@opam:2.5.0@e0bac278", "@opam/cmdliner@opam:1.0.4@93208aac", "@opam/astring@opam:0.8.5@1300cee8" @@ -2451,7 +2451,7 @@ "@opam/odoc@opam:1.5.1@52a58c0b", "@opam/ocaml-migrate-parsetree@opam:1.7.3@dbcf3b47", "@opam/menhir@opam:20200624@8629ff13", - "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/fpath@opam:0.7.3@674d8125", "@opam/fix@opam:20200131@0ecd2f01", "@opam/dune@opam:2.5.0@e0bac278", "@opam/cmdliner@opam:1.0.4@93208aac", "@opam/base-unix@opam:base@87d0b2eb", @@ -2465,7 +2465,7 @@ "@opam/odoc@opam:1.5.1@52a58c0b", "@opam/ocaml-migrate-parsetree@opam:1.7.3@dbcf3b47", "@opam/menhir@opam:20200624@8629ff13", - "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/fpath@opam:0.7.3@674d8125", "@opam/fix@opam:20200131@0ecd2f01", "@opam/dune@opam:2.5.0@e0bac278", "@opam/cmdliner@opam:1.0.4@93208aac", "@opam/base-unix@opam:base@87d0b2eb", @@ -3173,34 +3173,32 @@ "@opam/dune@opam:2.5.0@e0bac278" ] }, - "@opam/fpath@opam:0.7.2@3fd2da53": { - "id": "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/fpath@opam:0.7.3@674d8125": { + "id": "@opam/fpath@opam:0.7.3@674d8125", "name": "@opam/fpath", - "version": "opam:0.7.2", + "version": "opam:0.7.3", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/52/52c7ecb0bf180088336f3c645875fa41#md5:52c7ecb0bf180088336f3c645875fa41", - "archive:http://erratique.ch/software/fpath/releases/fpath-0.7.2.tbz#md5:52c7ecb0bf180088336f3c645875fa41" + "archive:https://opam.ocaml.org/cache/md5/07/0740b530e8fed5b0adc5eee8463cfc2f#md5:0740b530e8fed5b0adc5eee8463cfc2f", + "archive:https://erratique.ch/software/fpath/releases/fpath-0.7.3.tbz#md5:0740b530e8fed5b0adc5eee8463cfc2f" ], "opam": { "name": "fpath", - "version": "0.7.2", - "path": "bench.esy.lock/opam/fpath.0.7.2" + "version": "0.7.3", + "path": "bench.esy.lock/opam/fpath.0.7.3" } }, "overrides": [], "dependencies": [ "ocaml@4.10.0@d41d8cd9", "@opam/topkg@opam:1.0.2@3c5942ad", - "@opam/result@opam:1.5@6b753c82", "@opam/ocamlfind@opam:1.8.1@ff07b0f9", "@opam/ocamlbuild@opam:0.14.0@6ac75d03", "@opam/astring@opam:0.8.5@1300cee8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.10.0@d41d8cd9", "@opam/result@opam:1.5@6b753c82", - "@opam/astring@opam:0.8.5@1300cee8" + "ocaml@4.10.0@d41d8cd9", "@opam/astring@opam:0.8.5@1300cee8" ] }, "@opam/fp@github:bryphe/reason-native:fp.opam#fd0225c@d41d8cd9": { @@ -3705,7 +3703,7 @@ "@opam/rresult@opam:0.6.0@4b185e72", "@opam/ocamlfind@opam:1.8.1@ff07b0f9", "@opam/ocamlbuild@opam:0.14.0@6ac75d03", - "@opam/logs@opam:0.7.0@1d03143e", "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/logs@opam:0.7.0@1d03143e", "@opam/fpath@opam:0.7.3@674d8125", "@opam/fmt@opam:0.8.8@01c3a23c", "@opam/base-unix@opam:base@87d0b2eb", "@opam/astring@opam:0.8.5@1300cee8", @@ -3713,7 +3711,7 @@ ], "devDependencies": [ "ocaml@4.10.0@d41d8cd9", "@opam/rresult@opam:0.6.0@4b185e72", - "@opam/logs@opam:0.7.0@1d03143e", "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/logs@opam:0.7.0@1d03143e", "@opam/fpath@opam:0.7.3@674d8125", "@opam/fmt@opam:0.8.8@01c3a23c", "@opam/base-unix@opam:base@87d0b2eb", "@opam/astring@opam:0.8.5@1300cee8" diff --git a/bench.esy.lock/opam/fpath.0.7.2/opam b/bench.esy.lock/opam/fpath.0.7.2/opam deleted file mode 100644 index f90f49ff02..0000000000 --- a/bench.esy.lock/opam/fpath.0.7.2/opam +++ /dev/null @@ -1,34 +0,0 @@ -opam-version: "2.0" -maintainer: "Daniel Bünzli " -authors: ["Daniel Bünzli "] -homepage: "http://erratique.ch/software/fpath" -doc: "http://erratique.ch/software/fpath/doc" -dev-repo: "git+http://erratique.ch/repos/fpath.git" -bug-reports: "https://github.com/dbuenzli/fpath/issues" -tags: [ "file" "system" "path" "org:erratique" ] -license: "ISC" -depends: [ - "ocaml" {>= "4.01.0" & < "4.12"} - "ocamlfind" {build} - "ocamlbuild" {build} - "topkg" {build & >= "0.9.0"} - "result" - "astring" -] -build: [[ - "ocaml" "pkg/pkg.ml" "build" - "--dev-pkg" "%{pinned}%" ]] -synopsis: "File system paths for OCaml" -description: """ -Fpath is an OCaml module for handling file system paths with POSIX or -Windows conventions. Fpath processes paths without accessing the file -system and is independent from any system library. - -Fpath depends on [Astring][astring] and is distributed under the ISC -license. - -[astring]: http://erratique.ch/software/astring""" -url { - src: "http://erratique.ch/software/fpath/releases/fpath-0.7.2.tbz" - checksum: "md5=52c7ecb0bf180088336f3c645875fa41" -} diff --git a/bench.esy.lock/opam/fpath.0.7.3/opam b/bench.esy.lock/opam/fpath.0.7.3/opam new file mode 100644 index 0000000000..ae3336e426 --- /dev/null +++ b/bench.esy.lock/opam/fpath.0.7.3/opam @@ -0,0 +1,36 @@ +opam-version: "2.0" +maintainer: "Daniel Bünzli " +authors: ["The fpath programmers"] +homepage: "https://erratique.ch/software/fpath" +doc: "https://erratique.ch/software/fpath/doc" +dev-repo: "git+https://erratique.ch/repos/fpath.git" +bug-reports: "https://github.com/dbuenzli/fpath/issues" +tags: [ "file" "system" "path" "org:erratique" ] +license: "ISC" +depends: [ + "ocaml" {>= "4.03.0"} + "ocamlfind" {build} + "ocamlbuild" {build} + "topkg" {build & >= "0.9.0"} + "astring" +] +build: [[ + "ocaml" "pkg/pkg.ml" "build" + "--dev-pkg=true" {dev} ]] + +synopsis: """File system paths for OCaml""" +description: """\ + +Fpath is an OCaml module for handling file system paths with POSIX or +Windows conventions. Fpath processes paths without accessing the file +system and is independent from any system library. + +Fpath depends on [Astring][astring] and is distributed under the ISC +license. + +[astring]: http://erratique.ch/software/astring +""" +url { +archive: "https://erratique.ch/software/fpath/releases/fpath-0.7.3.tbz" +checksum: "0740b530e8fed5b0adc5eee8463cfc2f" +} diff --git a/esy.lock/index.json b/esy.lock/index.json index 5297d2e9c6..75637919f8 100644 --- a/esy.lock/index.json +++ b/esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "e77e22f99ed9e9a0a930e9ed15400c83", + "checksum": "292ec1cefdfbf010326612a2a0aee562", "root": "Oni2@link-dev:./package.json", "node": { "yarn-pkg-config@github:esy-ocaml/yarn-pkg-config#db3a0b63883606dd57c54a7158d560d6cba8cd79@d41d8cd9": { @@ -118,7 +118,7 @@ }, "overrides": [], "dependencies": [ - "revery@github:revery-ui/revery#11d4fb4@d41d8cd9", + "revery@github:revery-ui/revery#d2e614a@d41d8cd9", "isolinear@github:revery-ui/isolinear#8cad3b0@d41d8cd9", "@revery/esy-libvterm@1.0.3@d41d8cd9", "@onivim/reason-native-crash-utils@1.0.1@d41d8cd9", @@ -126,13 +126,13 @@ ], "devDependencies": [] }, - "revery@github:revery-ui/revery#11d4fb4@d41d8cd9": { - "id": "revery@github:revery-ui/revery#11d4fb4@d41d8cd9", + "revery@github:revery-ui/revery#d2e614a@d41d8cd9": { + "id": "revery@github:revery-ui/revery#d2e614a@d41d8cd9", "name": "revery", - "version": "github:revery-ui/revery#11d4fb4", + "version": "github:revery-ui/revery#d2e614a", "source": { "type": "install", - "source": [ "github:revery-ui/revery#11d4fb4" ] + "source": [ "github:revery-ui/revery#d2e614a" ] }, "overrides": [], "dependencies": [ @@ -209,7 +209,7 @@ "@reason-native/console@0.0.3@d41d8cd9", "@opam/lwt@opam:4.5.0@542100aa", "@opam/lambda-term@opam:3.1.0@8adc2660", - "@opam/fpath@opam:0.7.2@3fd2da53", "@opam/dune@opam:2.5.0@e0bac278", + "@opam/fpath@opam:0.7.3@674d8125", "@opam/dune@opam:2.5.0@e0bac278", "@esy-ocaml/reason@3.6.2@d41d8cd9" ], "devDependencies": [ "@opam/dune@opam:2.5.0@e0bac278" ] @@ -938,7 +938,7 @@ "overrides": [], "dependencies": [ "revery-terminal@github:revery-ui/revery-terminal#37e19a3@d41d8cd9", - "revery@github:revery-ui/revery#11d4fb4@d41d8cd9", + "revery@github:revery-ui/revery#d2e614a@d41d8cd9", "rench@github:bryphe/rench#a976fe5@d41d8cd9", "refmterr@3.3.2@d41d8cd9", "reasonFuzz@github:CrossR/reasonFuzz#1ad6f5d@d41d8cd9", @@ -2359,7 +2359,7 @@ "overrides": [], "dependencies": [ "ocaml@4.10.0@d41d8cd9", "@opam/tyxml@opam:4.4.0@1dca5713", - "@opam/result@opam:1.5@6b753c82", "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/result@opam:1.5@6b753c82", "@opam/fpath@opam:0.7.3@674d8125", "@opam/dune@opam:2.5.0@e0bac278", "@opam/cppo@opam:1.6.6@f4f83858", "@opam/cmdliner@opam:1.0.4@93208aac", "@opam/astring@opam:0.8.5@1300cee8", @@ -2367,7 +2367,7 @@ ], "devDependencies": [ "ocaml@4.10.0@d41d8cd9", "@opam/tyxml@opam:4.4.0@1dca5713", - "@opam/result@opam:1.5@6b753c82", "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/result@opam:1.5@6b753c82", "@opam/fpath@opam:0.7.3@674d8125", "@opam/dune@opam:2.5.0@e0bac278", "@opam/cmdliner@opam:1.0.4@93208aac", "@opam/astring@opam:0.8.5@1300cee8" @@ -2450,7 +2450,7 @@ "@opam/odoc@opam:1.5.1@52a58c0b", "@opam/ocaml-migrate-parsetree@opam:1.7.3@dbcf3b47", "@opam/menhir@opam:20200624@8629ff13", - "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/fpath@opam:0.7.3@674d8125", "@opam/fix@opam:20200131@0ecd2f01", "@opam/dune@opam:2.5.0@e0bac278", "@opam/cmdliner@opam:1.0.4@93208aac", "@opam/base-unix@opam:base@87d0b2eb", @@ -2464,7 +2464,7 @@ "@opam/odoc@opam:1.5.1@52a58c0b", "@opam/ocaml-migrate-parsetree@opam:1.7.3@dbcf3b47", "@opam/menhir@opam:20200624@8629ff13", - "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/fpath@opam:0.7.3@674d8125", "@opam/fix@opam:20200131@0ecd2f01", "@opam/dune@opam:2.5.0@e0bac278", "@opam/cmdliner@opam:1.0.4@93208aac", "@opam/base-unix@opam:base@87d0b2eb", @@ -3172,34 +3172,32 @@ "@opam/dune@opam:2.5.0@e0bac278" ] }, - "@opam/fpath@opam:0.7.2@3fd2da53": { - "id": "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/fpath@opam:0.7.3@674d8125": { + "id": "@opam/fpath@opam:0.7.3@674d8125", "name": "@opam/fpath", - "version": "opam:0.7.2", + "version": "opam:0.7.3", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/52/52c7ecb0bf180088336f3c645875fa41#md5:52c7ecb0bf180088336f3c645875fa41", - "archive:http://erratique.ch/software/fpath/releases/fpath-0.7.2.tbz#md5:52c7ecb0bf180088336f3c645875fa41" + "archive:https://opam.ocaml.org/cache/md5/07/0740b530e8fed5b0adc5eee8463cfc2f#md5:0740b530e8fed5b0adc5eee8463cfc2f", + "archive:https://erratique.ch/software/fpath/releases/fpath-0.7.3.tbz#md5:0740b530e8fed5b0adc5eee8463cfc2f" ], "opam": { "name": "fpath", - "version": "0.7.2", - "path": "esy.lock/opam/fpath.0.7.2" + "version": "0.7.3", + "path": "esy.lock/opam/fpath.0.7.3" } }, "overrides": [], "dependencies": [ "ocaml@4.10.0@d41d8cd9", "@opam/topkg@opam:1.0.2@3c5942ad", - "@opam/result@opam:1.5@6b753c82", "@opam/ocamlfind@opam:1.8.1@ff07b0f9", "@opam/ocamlbuild@opam:0.14.0@6ac75d03", "@opam/astring@opam:0.8.5@1300cee8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.10.0@d41d8cd9", "@opam/result@opam:1.5@6b753c82", - "@opam/astring@opam:0.8.5@1300cee8" + "ocaml@4.10.0@d41d8cd9", "@opam/astring@opam:0.8.5@1300cee8" ] }, "@opam/fp@github:bryphe/reason-native:fp.opam#fd0225c@d41d8cd9": { @@ -3704,7 +3702,7 @@ "@opam/rresult@opam:0.6.0@4b185e72", "@opam/ocamlfind@opam:1.8.1@ff07b0f9", "@opam/ocamlbuild@opam:0.14.0@6ac75d03", - "@opam/logs@opam:0.7.0@1d03143e", "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/logs@opam:0.7.0@1d03143e", "@opam/fpath@opam:0.7.3@674d8125", "@opam/fmt@opam:0.8.8@01c3a23c", "@opam/base-unix@opam:base@87d0b2eb", "@opam/astring@opam:0.8.5@1300cee8", @@ -3712,7 +3710,7 @@ ], "devDependencies": [ "ocaml@4.10.0@d41d8cd9", "@opam/rresult@opam:0.6.0@4b185e72", - "@opam/logs@opam:0.7.0@1d03143e", "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/logs@opam:0.7.0@1d03143e", "@opam/fpath@opam:0.7.3@674d8125", "@opam/fmt@opam:0.8.8@01c3a23c", "@opam/base-unix@opam:base@87d0b2eb", "@opam/astring@opam:0.8.5@1300cee8" diff --git a/esy.lock/opam/fpath.0.7.2/opam b/esy.lock/opam/fpath.0.7.2/opam deleted file mode 100644 index f90f49ff02..0000000000 --- a/esy.lock/opam/fpath.0.7.2/opam +++ /dev/null @@ -1,34 +0,0 @@ -opam-version: "2.0" -maintainer: "Daniel Bünzli " -authors: ["Daniel Bünzli "] -homepage: "http://erratique.ch/software/fpath" -doc: "http://erratique.ch/software/fpath/doc" -dev-repo: "git+http://erratique.ch/repos/fpath.git" -bug-reports: "https://github.com/dbuenzli/fpath/issues" -tags: [ "file" "system" "path" "org:erratique" ] -license: "ISC" -depends: [ - "ocaml" {>= "4.01.0" & < "4.12"} - "ocamlfind" {build} - "ocamlbuild" {build} - "topkg" {build & >= "0.9.0"} - "result" - "astring" -] -build: [[ - "ocaml" "pkg/pkg.ml" "build" - "--dev-pkg" "%{pinned}%" ]] -synopsis: "File system paths for OCaml" -description: """ -Fpath is an OCaml module for handling file system paths with POSIX or -Windows conventions. Fpath processes paths without accessing the file -system and is independent from any system library. - -Fpath depends on [Astring][astring] and is distributed under the ISC -license. - -[astring]: http://erratique.ch/software/astring""" -url { - src: "http://erratique.ch/software/fpath/releases/fpath-0.7.2.tbz" - checksum: "md5=52c7ecb0bf180088336f3c645875fa41" -} diff --git a/esy.lock/opam/fpath.0.7.3/opam b/esy.lock/opam/fpath.0.7.3/opam new file mode 100644 index 0000000000..ae3336e426 --- /dev/null +++ b/esy.lock/opam/fpath.0.7.3/opam @@ -0,0 +1,36 @@ +opam-version: "2.0" +maintainer: "Daniel Bünzli " +authors: ["The fpath programmers"] +homepage: "https://erratique.ch/software/fpath" +doc: "https://erratique.ch/software/fpath/doc" +dev-repo: "git+https://erratique.ch/repos/fpath.git" +bug-reports: "https://github.com/dbuenzli/fpath/issues" +tags: [ "file" "system" "path" "org:erratique" ] +license: "ISC" +depends: [ + "ocaml" {>= "4.03.0"} + "ocamlfind" {build} + "ocamlbuild" {build} + "topkg" {build & >= "0.9.0"} + "astring" +] +build: [[ + "ocaml" "pkg/pkg.ml" "build" + "--dev-pkg=true" {dev} ]] + +synopsis: """File system paths for OCaml""" +description: """\ + +Fpath is an OCaml module for handling file system paths with POSIX or +Windows conventions. Fpath processes paths without accessing the file +system and is independent from any system library. + +Fpath depends on [Astring][astring] and is distributed under the ISC +license. + +[astring]: http://erratique.ch/software/astring +""" +url { +archive: "https://erratique.ch/software/fpath/releases/fpath-0.7.3.tbz" +checksum: "0740b530e8fed5b0adc5eee8463cfc2f" +} diff --git a/integration_test/RegressionCommandLineNoCompletionTest.re b/integration_test/RegressionCommandLineNoCompletionTest.re index 8231915f61..3bf0084bd1 100644 --- a/integration_test/RegressionCommandLineNoCompletionTest.re +++ b/integration_test/RegressionCommandLineNoCompletionTest.re @@ -15,7 +15,8 @@ runTest(~name="Regression: Command line no completions", (dispatch, wait, _) => dispatch(KeyboardInput({isText: true, input: "e"})); wait(~name="Mode switches to command line", (state: State.t) => switch (state.quickmenu) { - | Some(quickmenu) => quickmenu.inputText |> Feature_InputText.value == "e" + | Some(quickmenu) => + quickmenu.inputText |> Component_InputText.value == "e" | None => false } ); @@ -25,7 +26,7 @@ runTest(~name="Regression: Command line no completions", (dispatch, wait, _) => wait(~name="Mode switches to command line", (state: State.t) => switch (state.quickmenu) { | Some(quickmenu) => - quickmenu.inputText |> Feature_InputText.value == "eh" + quickmenu.inputText |> Component_InputText.value == "eh" | None => false } ); diff --git a/integration_test/VimlConfigurationTest.re b/integration_test/VimlConfigurationTest.re index 5f9e8c9170..8c0434a57a 100644 --- a/integration_test/VimlConfigurationTest.re +++ b/integration_test/VimlConfigurationTest.re @@ -25,7 +25,7 @@ runTest( wait(~name="Mode switches to command line", (state: State.t) => switch (state.quickmenu) { | Some(quickmenu) => - quickmenu.inputText |> Feature_InputText.value == "e" + quickmenu.inputText |> Component_InputText.value == "e" | None => false } ); @@ -35,7 +35,7 @@ runTest( wait(~name="Mode switches to command line", (state: State.t) => switch (state.quickmenu) { | Some(quickmenu) => - quickmenu.inputText |> Feature_InputText.value == "eh" + quickmenu.inputText |> Component_InputText.value == "eh" | None => false } ); diff --git a/integrationtest.esy.lock/index.json b/integrationtest.esy.lock/index.json index 0cae38072f..b0e3c5219d 100644 --- a/integrationtest.esy.lock/index.json +++ b/integrationtest.esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "e77e22f99ed9e9a0a930e9ed15400c83", + "checksum": "292ec1cefdfbf010326612a2a0aee562", "root": "Oni2@link-dev:./package.json", "node": { "yarn-pkg-config@github:esy-ocaml/yarn-pkg-config#db3a0b63883606dd57c54a7158d560d6cba8cd79@d41d8cd9": { @@ -118,7 +118,7 @@ }, "overrides": [], "dependencies": [ - "revery@github:revery-ui/revery#11d4fb4@d41d8cd9", + "revery@github:revery-ui/revery#d2e614a@d41d8cd9", "isolinear@github:revery-ui/isolinear#8cad3b0@d41d8cd9", "@revery/esy-libvterm@1.0.3@d41d8cd9", "@onivim/reason-native-crash-utils@1.0.1@d41d8cd9", @@ -126,13 +126,13 @@ ], "devDependencies": [] }, - "revery@github:revery-ui/revery#11d4fb4@d41d8cd9": { - "id": "revery@github:revery-ui/revery#11d4fb4@d41d8cd9", + "revery@github:revery-ui/revery#d2e614a@d41d8cd9": { + "id": "revery@github:revery-ui/revery#d2e614a@d41d8cd9", "name": "revery", - "version": "github:revery-ui/revery#11d4fb4", + "version": "github:revery-ui/revery#d2e614a", "source": { "type": "install", - "source": [ "github:revery-ui/revery#11d4fb4" ] + "source": [ "github:revery-ui/revery#d2e614a" ] }, "overrides": [], "dependencies": [ @@ -209,7 +209,7 @@ "@reason-native/console@0.0.3@d41d8cd9", "@opam/lwt@opam:4.5.0@542100aa", "@opam/lambda-term@opam:3.1.0@8adc2660", - "@opam/fpath@opam:0.7.2@3fd2da53", "@opam/dune@opam:2.5.0@e0bac278", + "@opam/fpath@opam:0.7.3@674d8125", "@opam/dune@opam:2.5.0@e0bac278", "@esy-ocaml/reason@3.6.2@d41d8cd9" ], "devDependencies": [ "@opam/dune@opam:2.5.0@e0bac278" ] @@ -938,7 +938,7 @@ "overrides": [ "integrationtest.json" ], "dependencies": [ "revery-terminal@github:revery-ui/revery-terminal#37e19a3@d41d8cd9", - "revery@github:revery-ui/revery#11d4fb4@d41d8cd9", + "revery@github:revery-ui/revery#d2e614a@d41d8cd9", "rench@github:bryphe/rench#a976fe5@d41d8cd9", "refmterr@3.3.2@d41d8cd9", "reasonFuzz@github:CrossR/reasonFuzz#1ad6f5d@d41d8cd9", @@ -2359,7 +2359,7 @@ "overrides": [], "dependencies": [ "ocaml@4.10.0@d41d8cd9", "@opam/tyxml@opam:4.4.0@1dca5713", - "@opam/result@opam:1.5@6b753c82", "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/result@opam:1.5@6b753c82", "@opam/fpath@opam:0.7.3@674d8125", "@opam/dune@opam:2.5.0@e0bac278", "@opam/cppo@opam:1.6.6@f4f83858", "@opam/cmdliner@opam:1.0.4@93208aac", "@opam/astring@opam:0.8.5@1300cee8", @@ -2367,7 +2367,7 @@ ], "devDependencies": [ "ocaml@4.10.0@d41d8cd9", "@opam/tyxml@opam:4.4.0@1dca5713", - "@opam/result@opam:1.5@6b753c82", "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/result@opam:1.5@6b753c82", "@opam/fpath@opam:0.7.3@674d8125", "@opam/dune@opam:2.5.0@e0bac278", "@opam/cmdliner@opam:1.0.4@93208aac", "@opam/astring@opam:0.8.5@1300cee8" @@ -2450,7 +2450,7 @@ "@opam/odoc@opam:1.5.1@52a58c0b", "@opam/ocaml-migrate-parsetree@opam:1.7.3@dbcf3b47", "@opam/menhir@opam:20200624@8629ff13", - "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/fpath@opam:0.7.3@674d8125", "@opam/fix@opam:20200131@0ecd2f01", "@opam/dune@opam:2.5.0@e0bac278", "@opam/cmdliner@opam:1.0.4@93208aac", "@opam/base-unix@opam:base@87d0b2eb", @@ -2464,7 +2464,7 @@ "@opam/odoc@opam:1.5.1@52a58c0b", "@opam/ocaml-migrate-parsetree@opam:1.7.3@dbcf3b47", "@opam/menhir@opam:20200624@8629ff13", - "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/fpath@opam:0.7.3@674d8125", "@opam/fix@opam:20200131@0ecd2f01", "@opam/dune@opam:2.5.0@e0bac278", "@opam/cmdliner@opam:1.0.4@93208aac", "@opam/base-unix@opam:base@87d0b2eb", @@ -3173,34 +3173,32 @@ "@opam/dune@opam:2.5.0@e0bac278" ] }, - "@opam/fpath@opam:0.7.2@3fd2da53": { - "id": "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/fpath@opam:0.7.3@674d8125": { + "id": "@opam/fpath@opam:0.7.3@674d8125", "name": "@opam/fpath", - "version": "opam:0.7.2", + "version": "opam:0.7.3", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/52/52c7ecb0bf180088336f3c645875fa41#md5:52c7ecb0bf180088336f3c645875fa41", - "archive:http://erratique.ch/software/fpath/releases/fpath-0.7.2.tbz#md5:52c7ecb0bf180088336f3c645875fa41" + "archive:https://opam.ocaml.org/cache/md5/07/0740b530e8fed5b0adc5eee8463cfc2f#md5:0740b530e8fed5b0adc5eee8463cfc2f", + "archive:https://erratique.ch/software/fpath/releases/fpath-0.7.3.tbz#md5:0740b530e8fed5b0adc5eee8463cfc2f" ], "opam": { "name": "fpath", - "version": "0.7.2", - "path": "integrationtest.esy.lock/opam/fpath.0.7.2" + "version": "0.7.3", + "path": "integrationtest.esy.lock/opam/fpath.0.7.3" } }, "overrides": [], "dependencies": [ "ocaml@4.10.0@d41d8cd9", "@opam/topkg@opam:1.0.2@3c5942ad", - "@opam/result@opam:1.5@6b753c82", "@opam/ocamlfind@opam:1.8.1@ff07b0f9", "@opam/ocamlbuild@opam:0.14.0@6ac75d03", "@opam/astring@opam:0.8.5@1300cee8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.10.0@d41d8cd9", "@opam/result@opam:1.5@6b753c82", - "@opam/astring@opam:0.8.5@1300cee8" + "ocaml@4.10.0@d41d8cd9", "@opam/astring@opam:0.8.5@1300cee8" ] }, "@opam/fp@github:bryphe/reason-native:fp.opam#fd0225c@d41d8cd9": { @@ -3705,7 +3703,7 @@ "@opam/rresult@opam:0.6.0@4b185e72", "@opam/ocamlfind@opam:1.8.1@ff07b0f9", "@opam/ocamlbuild@opam:0.14.0@6ac75d03", - "@opam/logs@opam:0.7.0@1d03143e", "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/logs@opam:0.7.0@1d03143e", "@opam/fpath@opam:0.7.3@674d8125", "@opam/fmt@opam:0.8.8@01c3a23c", "@opam/base-unix@opam:base@87d0b2eb", "@opam/astring@opam:0.8.5@1300cee8", @@ -3713,7 +3711,7 @@ ], "devDependencies": [ "ocaml@4.10.0@d41d8cd9", "@opam/rresult@opam:0.6.0@4b185e72", - "@opam/logs@opam:0.7.0@1d03143e", "@opam/fpath@opam:0.7.2@3fd2da53", + "@opam/logs@opam:0.7.0@1d03143e", "@opam/fpath@opam:0.7.3@674d8125", "@opam/fmt@opam:0.8.8@01c3a23c", "@opam/base-unix@opam:base@87d0b2eb", "@opam/astring@opam:0.8.5@1300cee8" diff --git a/integrationtest.esy.lock/opam/fpath.0.7.2/opam b/integrationtest.esy.lock/opam/fpath.0.7.2/opam deleted file mode 100644 index f90f49ff02..0000000000 --- a/integrationtest.esy.lock/opam/fpath.0.7.2/opam +++ /dev/null @@ -1,34 +0,0 @@ -opam-version: "2.0" -maintainer: "Daniel Bünzli " -authors: ["Daniel Bünzli "] -homepage: "http://erratique.ch/software/fpath" -doc: "http://erratique.ch/software/fpath/doc" -dev-repo: "git+http://erratique.ch/repos/fpath.git" -bug-reports: "https://github.com/dbuenzli/fpath/issues" -tags: [ "file" "system" "path" "org:erratique" ] -license: "ISC" -depends: [ - "ocaml" {>= "4.01.0" & < "4.12"} - "ocamlfind" {build} - "ocamlbuild" {build} - "topkg" {build & >= "0.9.0"} - "result" - "astring" -] -build: [[ - "ocaml" "pkg/pkg.ml" "build" - "--dev-pkg" "%{pinned}%" ]] -synopsis: "File system paths for OCaml" -description: """ -Fpath is an OCaml module for handling file system paths with POSIX or -Windows conventions. Fpath processes paths without accessing the file -system and is independent from any system library. - -Fpath depends on [Astring][astring] and is distributed under the ISC -license. - -[astring]: http://erratique.ch/software/astring""" -url { - src: "http://erratique.ch/software/fpath/releases/fpath-0.7.2.tbz" - checksum: "md5=52c7ecb0bf180088336f3c645875fa41" -} diff --git a/integrationtest.esy.lock/opam/fpath.0.7.3/opam b/integrationtest.esy.lock/opam/fpath.0.7.3/opam new file mode 100644 index 0000000000..ae3336e426 --- /dev/null +++ b/integrationtest.esy.lock/opam/fpath.0.7.3/opam @@ -0,0 +1,36 @@ +opam-version: "2.0" +maintainer: "Daniel Bünzli " +authors: ["The fpath programmers"] +homepage: "https://erratique.ch/software/fpath" +doc: "https://erratique.ch/software/fpath/doc" +dev-repo: "git+https://erratique.ch/repos/fpath.git" +bug-reports: "https://github.com/dbuenzli/fpath/issues" +tags: [ "file" "system" "path" "org:erratique" ] +license: "ISC" +depends: [ + "ocaml" {>= "4.03.0"} + "ocamlfind" {build} + "ocamlbuild" {build} + "topkg" {build & >= "0.9.0"} + "astring" +] +build: [[ + "ocaml" "pkg/pkg.ml" "build" + "--dev-pkg=true" {dev} ]] + +synopsis: """File system paths for OCaml""" +description: """\ + +Fpath is an OCaml module for handling file system paths with POSIX or +Windows conventions. Fpath processes paths without accessing the file +system and is independent from any system library. + +Fpath depends on [Astring][astring] and is distributed under the ISC +license. + +[astring]: http://erratique.ch/software/astring +""" +url { +archive: "https://erratique.ch/software/fpath/releases/fpath-0.7.3.tbz" +checksum: "0740b530e8fed5b0adc5eee8463cfc2f" +} diff --git a/package.json b/package.json index 67eba7e6f4..8820d691d0 100644 --- a/package.json +++ b/package.json @@ -252,7 +252,7 @@ "revery-terminal": "*" }, "resolutions": { - "revery": "revery-ui/revery#11d4fb4", + "revery": "revery-ui/revery#d2e614a", "esy-skia": "revery-ui/esy-skia#a3785f9", "rench": "bryphe/rench#a976fe5", "reasonFuzz": "CrossR/reasonFuzz#1ad6f5d", diff --git a/src/Components/InputText/Component_InputText.re b/src/Components/InputText/Component_InputText.re new file mode 100644 index 0000000000..56b958388f --- /dev/null +++ b/src/Components/InputText/Component_InputText.re @@ -0,0 +1,16 @@ +include Model; + +[@deriving show] +type model = Model.t; + +module View = View; + +module ContextKeys = { + open WhenExpr.ContextKeys.Schema; + + let textInputFocus = bool("textInputFocus", isFocused); +}; + +module Contributions = { + let contextKeys = ContextKeys.[textInputFocus]; +}; diff --git a/src/Feature/InputText/Feature_InputText.rei b/src/Components/InputText/Component_InputText.rei similarity index 83% rename from src/Feature/InputText/Feature_InputText.rei rename to src/Components/InputText/Component_InputText.rei index aa8940e2ba..cc4fa7009d 100644 --- a/src/Feature/InputText/Feature_InputText.rei +++ b/src/Components/InputText/Component_InputText.rei @@ -6,13 +6,17 @@ type msg; [@deriving show] type model; +type outmsg = + | Nothing + | Focus; + let value: model => string; let create: (~placeholder: string) => model; let empty: model; -let update: (msg, model) => model; +let update: (msg, model) => (model, outmsg); let handleInput: (~key: string, model) => model; @@ -33,7 +37,6 @@ module View: { ~key: Brisk_reconciler.Key.t=?, ~model: model, ~theme: ColorTheme.Colors.t, - ~style: list(Revery.UI.Style.allProps)=?, ~fontSize: float=?, ~fontFamily: Revery.Font.Family.t=?, ~placeholderColor: Revery.Color.t=?, @@ -46,3 +49,7 @@ module View: { ) => Revery.UI.element; }; + +module Contributions: { + let contextKeys: list(WhenExpr.ContextKeys.Schema.entry(model)); +}; diff --git a/src/Feature/InputText/Model.re b/src/Components/InputText/Model.re similarity index 98% rename from src/Feature/InputText/Model.re rename to src/Components/InputText/Model.re index 088f878c7a..2684e4ff47 100644 --- a/src/Feature/InputText/Model.re +++ b/src/Components/InputText/Model.re @@ -2,17 +2,25 @@ open Oni_Core; [@deriving show] type msg = + | GainedFocus + | LostFocus | Sneaked | Clicked({selection: Selection.t}); +type outmsg = + | Nothing + | Focus; + [@deriving show] type t = { + isFocused: bool, value: string, selection: Selection.t, placeholder: string, }; let create = (~placeholder) => { + isFocused: false, value: "", selection: Selection.initial, placeholder, @@ -21,13 +29,16 @@ let create = (~placeholder) => { let empty = create(~placeholder=""); let isEmpty = ({value, _}) => value == ""; +let isFocused = ({isFocused, _}) => isFocused; let value = ({value, _}) => value; let update = (msg, model) => switch (msg) { - | Sneaked => model - | Clicked({selection}) => {...model, selection} + | GainedFocus => ({...model, isFocused: true}, Nothing) + | LostFocus => ({...model, isFocused: false}, Nothing) + | Sneaked => (model, Focus) + | Clicked({selection}) => ({...model, selection}, Focus) }; module Internal = { @@ -270,12 +281,14 @@ let%test_module "Model" = value: text, selection: Selection.create(~text, ~anchor=position, ~focus=position), placeholder: "", + isFocused: false, }; let notCollapsed = (~text=testString, ~anchor, ~focus, ()) => { value: text, selection: Selection.create(~text, ~anchor, ~focus), placeholder: "", + isFocused: false, }; let uTestString = "😊↪Вім is Cool"; diff --git a/src/Feature/InputText/Selection.re b/src/Components/InputText/Selection.re similarity index 100% rename from src/Feature/InputText/Selection.re rename to src/Components/InputText/Selection.re diff --git a/src/Feature/InputText/Selection.rei b/src/Components/InputText/Selection.rei similarity index 100% rename from src/Feature/InputText/Selection.rei rename to src/Components/InputText/Selection.rei diff --git a/src/Feature/InputText/View.re b/src/Components/InputText/View.re similarity index 77% rename from src/Feature/InputText/View.re rename to src/Components/InputText/View.re index b03b6de7fc..6ee00a05cd 100644 --- a/src/Feature/InputText/View.re +++ b/src/Components/InputText/View.re @@ -81,21 +81,71 @@ module Colors = { }; module Styles = { - let default = (~theme) => + open Style; + let default = (~theme, ~focused) => Style.[ color(Colors.foreground(theme)), paddingVertical(8), paddingHorizontal(12), - border(~width=1, ~color=Colors.border(theme)), + border(~width=focused ? 2 : 1, ~color=Colors.border(theme)), backgroundColor(Colors.background(theme)), + boxShadow( + ~xOffset=4., + ~yOffset=4., + ~blurRadius=focused ? 8. : 0., + ~spreadRadius=0., + ~color=Color.rgba(0., 0., 0., 0.5), + ), ]; + + let _all = (~theme, focused) => [ + flexDirection(`Row), + alignItems(`Center), + justifyContent(`FlexStart), + cursor(MouseCursors.text), + ...default(~theme, ~focused), + ]; + + let box = (~style: list(Revery.UI.Style.viewStyleProps), ~theme, ~focused) => { + ignore(style); + _all(~theme, focused); + }; + + let marginContainer = [ + flexDirection(`Row), + alignItems(`Center), + justifyContent(`FlexStart), + flexGrow(1), + overflow(`Hidden), + ]; + + let cursor = offset => [ + position(`Absolute), + marginTop(2), + transform(Transform.[TranslateX(float(offset))]), + ]; + + let selection = offset => [ + position(`Absolute), + marginTop(2), + transform(Transform.[TranslateX(float(offset))]), + ]; + + let textContainer = [flexGrow(1), overflow(`Hidden)]; + + let text = (~showPlaceholder, ~placeholderColor, ~textColor, ~scrollOffset) => [ + color(showPlaceholder ? placeholderColor : textColor), + alignItems(`Center), + justifyContent(`FlexStart), + textWrap(TextWrapping.NoWrap), + transform(Transform.[TranslateX(float(- scrollOffset^))]), + ]; }; let%component make = ( - ~model, + ~model: Model.t, ~theme, - ~style=Styles.default(~theme), ~fontSize=18., ~fontFamily=Revery.Font.Family.fromFile("Roboto-Regular.ttf"), ~placeholderColor=Colors.placeholderForeground(theme), @@ -109,60 +159,25 @@ let%component make = let%hook textRef = Hooks.ref(None); let%hook scrollOffset = Hooks.ref(0); - let {placeholder, value, selection}: Model.t = model; - let displayValue = prefix ++ value; - let showPlaceholder = displayValue == ""; - - module Styles = { - open Style; - include Styles; - - let textColor = Selector.select(style, Color, Colors.foreground(theme)); - - let _all = - merge( - ~source=[ - flexDirection(`Row), - alignItems(`Center), - justifyContent(`FlexStart), - overflow(`Hidden), - cursor(MouseCursors.text), - ...default(~theme), - ], - ~target=style, - ); + let style = Styles.default(~theme, ~focused=isFocused); - let box = extractViewStyles(_all); - - let marginContainer = [ - flexDirection(`Row), - alignItems(`Center), - justifyContent(`FlexStart), - flexGrow(1), - ]; - - let cursor = offset => [ - position(`Absolute), - marginTop(2), - transform(Transform.[TranslateX(float(offset))]), - ]; - - let selection = offset => [ - position(`Absolute), - marginTop(2), - transform(Transform.[TranslateX(float(offset))]), - ]; + let%hook () = + Hooks.effect( + OnMountAndIf((!=), isFocused), + () => { + if (isFocused) { + dispatch(Model.GainedFocus); + } else { + dispatch(LostFocus); + }; - let textContainer = [flexGrow(1), overflow(`Hidden)]; + Some(() => dispatch(LostFocus)); + }, + ); - let text = [ - color(showPlaceholder ? placeholderColor : textColor), - alignItems(`Center), - justifyContent(`FlexStart), - textWrap(TextWrapping.NoWrap), - transform(Transform.[TranslateX(float(- scrollOffset^))]), - ]; - }; + let {placeholder, value, selection, _}: Model.t = model; + let displayValue = prefix ++ value; + let showPlaceholder = displayValue == ""; let measureTextWidth = text => { let dimensions = @@ -307,17 +322,24 @@ let%component make = ; }; + let textColor = Colors.foreground(theme); + let text = () => textRef := Some(node)} text={showPlaceholder ? placeholder : displayValue} - style=Styles.text + style={Styles.text( + ~showPlaceholder, + ~placeholderColor, + ~textColor, + ~scrollOffset, + )} fontFamily fontSize />; - + diff --git a/src/Feature/InputText/dune b/src/Components/InputText/dune similarity index 73% rename from src/Feature/InputText/dune rename to src/Components/InputText/dune index 49e799f66b..873b63cd6e 100644 --- a/src/Feature/InputText/dune +++ b/src/Components/InputText/dune @@ -1,6 +1,6 @@ (library - (name Feature_InputText) - (public_name Oni2.feature.inputText) + (name Component_InputText) + (public_name Oni2.component.inputText) (inline_tests) (libraries Oni2.core Oni2.components Revery isolinear Oni2.feature.sneak) (preprocess diff --git a/src/Feature/Extensions/Feature_Extensions.re b/src/Feature/Extensions/Feature_Extensions.re index b1a93260a0..15b40ca31e 100644 --- a/src/Feature/Extensions/Feature_Extensions.re +++ b/src/Feature/Extensions/Feature_Extensions.re @@ -108,3 +108,14 @@ let sub = (~setup, model) => { | None => Isolinear.Sub.none }; }; + +module Contributions = { + open WhenExpr.ContextKeys.Schema; + + let contextKeys = (~isFocused) => { + let keys = isFocused ? Component_InputText.Contributions.contextKeys : []; + + [keys |> fromList |> map(({searchText, _}: model) => searchText)] + |> unionMany; + }; +}; diff --git a/src/Feature/Extensions/Feature_Extensions.rei b/src/Feature/Extensions/Feature_Extensions.rei index 7edd270044..0cb113395c 100644 --- a/src/Feature/Extensions/Feature_Extensions.rei +++ b/src/Feature/Extensions/Feature_Extensions.rei @@ -94,3 +94,7 @@ module DetailsView: { ) => Revery.UI.element; }; + +module Contributions: { + let contextKeys: (~isFocused: bool) => WhenExpr.ContextKeys.Schema.t(model); +}; diff --git a/src/Feature/Extensions/ListView.re b/src/Feature/Extensions/ListView.re index dbecba1602..d2649a30df 100644 --- a/src/Feature/Extensions/ListView.re +++ b/src/Feature/Extensions/ListView.re @@ -9,7 +9,7 @@ module Colors = Feature_Theme.Colors; module Styles = { open Style; let container = [flexDirection(`Column), flexGrow(1), overflow(`Hidden)]; - let input = [flexGrow(1), margin(12)]; + let inputContainer = [margin(12)]; }; type state = { @@ -143,7 +143,7 @@ let%component make = let userExtensions = Model.getExtensions(~category=Scanner.User, model) |> Array.of_list; let contents = - if (Feature_InputText.isEmpty(model.searchText)) { + if (Component_InputText.isEmpty(model.searchText)) { [ - dispatch(Model.SearchText(msg))} - theme - /> + + dispatch(Model.SearchText(msg))} + theme + /> + contents ; }; diff --git a/src/Feature/Extensions/Model.re b/src/Feature/Extensions/Model.re index 3f669b9a7b..301d4cafbb 100644 --- a/src/Feature/Extensions/Model.re +++ b/src/Feature/Extensions/Model.re @@ -17,7 +17,7 @@ type msg = | Pasted(string) | SearchQueryResults(Service_Extensions.Query.t) | SearchQueryError(string) - | SearchText(Feature_InputText.msg) + | SearchText(Component_InputText.msg) | UninstallExtensionClicked({extensionId: string}) | UninstallExtensionSuccess({extensionId: string}) | UninstallExtensionFailed({ @@ -119,7 +119,7 @@ type model = { selected: option(Selected.t), activatedIds: list(string), extensions: list(Scanner.ScanResult.t), - searchText: Feature_InputText.model, + searchText: Component_InputText.model, latestQuery: option(Service_Extensions.Query.t), extensionsFolder: option(string), pendingInstalls: list(string), @@ -143,7 +143,7 @@ let initial = (~workspacePersistence, ~globalPersistence, ~extensionsFolder) => activatedIds: [], selected: None, extensions: [], - searchText: Feature_InputText.create(~placeholder="Type to search..."), + searchText: Component_InputText.create(~placeholder="Type to search..."), latestQuery: None, extensionsFolder, pendingInstalls: [], @@ -377,9 +377,9 @@ let update = (~extHostClient, msg, model) => { ) | KeyPressed(key) => - let previousText = model.searchText |> Feature_InputText.value; - let searchText' = Feature_InputText.handleInput(~key, model.searchText); - let newText = searchText' |> Feature_InputText.value; + let previousText = model.searchText |> Component_InputText.value; + let searchText' = Component_InputText.handleInput(~key, model.searchText); + let newText = searchText' |> Component_InputText.value; let latestQuery = checkAndUpdateSearchText( ~previousText, @@ -388,9 +388,9 @@ let update = (~extHostClient, msg, model) => { ); ({...model, searchText: searchText', latestQuery}, Nothing); | Pasted(text) => - let previousText = model.searchText |> Feature_InputText.value; - let searchText' = Feature_InputText.paste(~text, model.searchText); - let newText = searchText' |> Feature_InputText.value; + let previousText = model.searchText |> Component_InputText.value; + let searchText' = Component_InputText.paste(~text, model.searchText); + let newText = searchText' |> Component_InputText.value; let latestQuery = checkAndUpdateSearchText( ~previousText, @@ -399,20 +399,26 @@ let update = (~extHostClient, msg, model) => { ); ({...model, searchText: searchText', latestQuery}, Nothing); | SearchText(msg) => - let previousText = model.searchText |> Feature_InputText.value; - let searchText' = Feature_InputText.update(msg, model.searchText); - let newText = searchText' |> Feature_InputText.value; + let previousText = model.searchText |> Component_InputText.value; + let (searchText', inputOutmsg) = + Component_InputText.update(msg, model.searchText); + let outmsg = + switch (inputOutmsg) { + | Component_InputText.Nothing => Nothing + | Component_InputText.Focus => Focus + }; + let newText = searchText' |> Component_InputText.value; let latestQuery = checkAndUpdateSearchText( ~previousText, ~newText, ~query=model.latestQuery, ); - ({...model, searchText: searchText', latestQuery}, Focus); + ({...model, searchText: searchText', latestQuery}, outmsg); | SearchQueryResults(queryResults) => queryResults |> Service_Extensions.Query.searchText - == (model.searchText |> Feature_InputText.value) + == (model.searchText |> Component_InputText.value) ? ({...model, latestQuery: Some(queryResults)}, Nothing) : (model, Nothing) | SearchQueryError(_queryResults) => diff --git a/src/Feature/Extensions/dune b/src/Feature/Extensions/dune index 37c15c994c..ec2696ccf6 100644 --- a/src/Feature/Extensions/dune +++ b/src/Feature/Extensions/dune @@ -2,7 +2,7 @@ (name Feature_Extensions) (public_name Oni2.feature.extensions) (inline_tests) - (libraries Oni2.core Oni2.components Oni2.exthost Oni2.feature.inputText + (libraries Oni2.core Oni2.components Oni2.exthost Oni2.component.inputText Oni2.service.extensions Oni2.service.exthost Oni2.feature.sneak Revery isolinear) (preprocess diff --git a/src/Feature/InputText/Feature_InputText.re b/src/Feature/InputText/Feature_InputText.re deleted file mode 100644 index fbb7c6b819..0000000000 --- a/src/Feature/InputText/Feature_InputText.re +++ /dev/null @@ -1,6 +0,0 @@ -include Model; - -[@deriving show] -type model = Model.t; - -module View = View; diff --git a/src/Feature/LanguageSupport/Rename.re b/src/Feature/LanguageSupport/Rename.re index bf4d21b5fc..47b84fd1f4 100644 --- a/src/Feature/LanguageSupport/Rename.re +++ b/src/Feature/LanguageSupport/Rename.re @@ -10,7 +10,7 @@ type command = [@deriving show] type msg = | Command(command) - | InputText(Feature_InputText.msg); + | InputText(Component_InputText.msg); type provider = { handle: int, @@ -23,7 +23,7 @@ type sessionState = | Resolving({sessionId: int}) | Resolved({ sessionId: int, //location: RenameLocation.t, - inputText: Feature_InputText.model, + inputText: Component_InputText.model, }) | Applying({ sessionId: int, @@ -66,7 +66,7 @@ let update = (msg, model) => { | InputText(inputMsg) => switch (model.sessionState) { | Resolved({inputText, _} as resolved) => - let inputText' = Feature_InputText.update(inputMsg, inputText); + let (inputText', _) = Component_InputText.update(inputMsg, inputText); ( { ...model, @@ -87,7 +87,7 @@ let update = (msg, model) => { sessionState: Resolved({ sessionId, - inputText: Feature_InputText.create(~placeholder="hi"), + inputText: Component_InputText.create(~placeholder="hi"), }), }, Outmsg.Nothing, @@ -187,7 +187,7 @@ module View = { color(Colors.Menu.foreground.from(theme)), ]> - KeyPressed(key); @@ -85,7 +86,7 @@ let handleTextInput = (model, key) => } | ExpressionRegister(expression) => let inputText' = - Feature_InputText.handleInput(~key, expression.inputText); + Component_InputText.handleInput(~key, expression.inputText); ( {mode: ExpressionRegister({...expression, inputText: inputText'})}, Nothing, @@ -116,7 +117,8 @@ let update = (msg, model) => { let model' = switch (model.mode) { | ExpressionRegister(expression) => - let inputText' = Feature_InputText.update(msg, expression.inputText); + let (inputText', _msg) = + Component_InputText.update(msg, expression.inputText); {mode: ExpressionRegister({...expression, inputText: inputText'})}; | NotActive => model | WaitingForRegister => model @@ -188,9 +190,28 @@ module Keybindings = { }; module Contributions = { + open WhenExpr.ContextKeys.Schema; + let commands = [Commands.insert, Commands.cancel, Commands.commit]; - let contextKeys = [ContextKeys.registerEvaluationFocus]; + let contextKeys = (~isFocused) => { + let inputTextKeys = + isFocused ? Component_InputText.Contributions.contextKeys : []; + + ContextKeys.[ + inputTextKeys + |> fromList + |> map(({mode}: model) => { + switch (mode) { + | ExpressionRegister({inputText, _}) => inputText + | NotActive => Component_InputText.empty + | WaitingForRegister => Component_InputText.empty + } + }), + [registerEvaluationFocus] |> fromList, + ] + |> unionMany; + }; let keybindings = [ Keybindings.cancel, @@ -242,7 +263,7 @@ module View = { color(Colors.Menu.foreground.from(theme)), ]> - { | Ok(str) => ExpressionEvaluated(str) | Error(err) => ExpressionError(err) ); - Service_Vim.Sub.eval(~toMsg, inputText |> Feature_InputText.value); + Service_Vim.Sub.eval(~toMsg, inputText |> Component_InputText.value); }; }; diff --git a/src/Feature/Registers/Feature_Registers.rei b/src/Feature/Registers/Feature_Registers.rei index 56c14ef072..ea66d78984 100644 --- a/src/Feature/Registers/Feature_Registers.rei +++ b/src/Feature/Registers/Feature_Registers.rei @@ -26,7 +26,7 @@ let isActive: model => bool; module Contributions: { let commands: list(Command.t(msg)); - let contextKeys: list(WhenExpr.ContextKeys.Schema.entry(model)); + let contextKeys: (~isFocused: bool) => WhenExpr.ContextKeys.Schema.t(model); let keybindings: list(Oni_Input.Keybindings.keybinding); }; diff --git a/src/Feature/Registers/dune b/src/Feature/Registers/dune index 050e8326b4..603d953987 100644 --- a/src/Feature/Registers/dune +++ b/src/Feature/Registers/dune @@ -2,7 +2,7 @@ (name Feature_Registers) (public_name Oni2.feature.registers) (libraries Oni2.core Oni2.exthost isolinear base libvim - Oni2.feature.commands Oni2.feature.inputText Oni2.feature.theme + Oni2.feature.commands Oni2.component.inputText Oni2.feature.theme Oni2.service.font Oni2.service.vim) (preprocess (pps ppx_let ppx_deriving.show brisk-reconciler.ppx))) diff --git a/src/Feature/SCM/Feature_SCM.re b/src/Feature/SCM/Feature_SCM.re index 01a7ee459b..95da2bab0f 100644 --- a/src/Feature/SCM/Feature_SCM.re +++ b/src/Feature/SCM/Feature_SCM.re @@ -56,14 +56,14 @@ module Provider = { [@deriving show({with_path: false})] type model = { providers: list(Provider.t), - inputBox: Feature_InputText.model, + inputBox: Component_InputText.model, textContentProviders: list((int, string)), originalLines: [@opaque] IntMap.t(array(string)), }; let initial = { providers: [], - inputBox: Feature_InputText.create(~placeholder="Do the commit thing!"), + inputBox: Component_InputText.create(~placeholder="Do the commit thing!"), textContentProviders: [], originalLines: IntMap.empty, }; @@ -167,7 +167,7 @@ type msg = | KeyPressed({key: string}) | Pasted({text: string}) | DocumentContentProvider(Exthost.Msg.DocumentContentProvider.msg) - | InputBox(Feature_InputText.msg); + | InputBox(Component_InputText.msg); module Msg = { let paste = text => Pasted({text: text}); @@ -329,7 +329,7 @@ let update = (extHostClient: Exthost.Client.t, model, msg) => // { // ...model, // inputBox: - // Feature_InputText.setPlaceholder(~placeholder, model.inputBox), + // Component_InputText.setPlaceholder(~placeholder, model.inputBox), // }, // Nothing, // ) @@ -466,7 +466,7 @@ let update = (extHostClient: Exthost.Client.t, model, msg) => ) | KeyPressed({key}) => - let inputBox = Feature_InputText.handleInput(~key, model.inputBox); + let inputBox = Component_InputText.handleInput(~key, model.inputBox); ( {...model, inputBox}, EffectAndFocus( @@ -475,7 +475,7 @@ let update = (extHostClient: Exthost.Client.t, model, msg) => |> List.map((provider: Provider.t) => Service_Exthost.Effects.SCM.onInputBoxValueChange( ~handle=provider.handle, - ~value=inputBox |> Feature_InputText.value, + ~value=inputBox |> Component_InputText.value, extHostClient, ) ), @@ -484,7 +484,7 @@ let update = (extHostClient: Exthost.Client.t, model, msg) => ); | Pasted({text}) => - let inputBox = Feature_InputText.paste(~text, model.inputBox); + let inputBox = Component_InputText.paste(~text, model.inputBox); ( {...model, inputBox}, EffectAndFocus( @@ -493,7 +493,7 @@ let update = (extHostClient: Exthost.Client.t, model, msg) => |> List.map((provider: Provider.t) => Service_Exthost.Effects.SCM.onInputBoxValueChange( ~handle=provider.handle, - ~value=inputBox |> Feature_InputText.value, + ~value=inputBox |> Component_InputText.value, extHostClient, ) ), @@ -501,10 +501,16 @@ let update = (extHostClient: Exthost.Client.t, model, msg) => ), ); - | InputBox(msg) => ( - {...model, inputBox: Feature_InputText.update(msg, model.inputBox)}, - Focus, - ) + | InputBox(msg) => + let (inputBox', inputOutmsg) = + Component_InputText.update(msg, model.inputBox); + let outmsg = + switch (inputOutmsg) { + | Component_InputText.Nothing => Nothing + | Component_InputText.Focus => Focus + }; + + ({...model, inputBox: inputBox'}, outmsg); }; let handleExtensionMessage = (~dispatch, msg: Exthost.Msg.SCM.msg) => @@ -625,14 +631,14 @@ module Pane = { let container = [flexGrow(1)]; + let inputContainer = [margin(12)]; + let text = (~theme) => [ color(Colors.SideBar.foreground.from(theme)), textWrap(TextWrapping.NoWrap), textOverflow(`Ellipsis), ]; - let input = [flexGrow(1), margin(12)]; - let item = (~isHovered, ~theme) => [ isHovered ? backgroundColor(Colors.List.hoverBackground.from(theme)) @@ -749,15 +755,16 @@ module Pane = { }); - dispatch(InputBox(msg))} - theme - /> + + dispatch(InputBox(msg))} + theme + /> + {groups |> List.filter_map(((provider, group: ResourceGroup.t)) => { let expanded = @@ -785,3 +792,14 @@ module Pane = { ; }; }; + +module Contributions = { + open WhenExpr.ContextKeys.Schema; + + let contextKeys = (~isFocused) => { + let keys = isFocused ? Component_InputText.Contributions.contextKeys : []; + + [keys |> fromList |> map(({inputBox, _}: model) => inputBox)] + |> unionMany; + }; +}; diff --git a/src/Feature/SCM/Feature_SCM.rei b/src/Feature/SCM/Feature_SCM.rei index 593c0a0fff..08e66500d0 100644 --- a/src/Feature/SCM/Feature_SCM.rei +++ b/src/Feature/SCM/Feature_SCM.rei @@ -101,3 +101,7 @@ module Pane: { ) => Revery.UI.element; }; + +module Contributions: { + let contextKeys: (~isFocused: bool) => WhenExpr.ContextKeys.Schema.t(model); +}; diff --git a/src/Feature/SCM/dune b/src/Feature/SCM/dune index 24e14fc520..42d23a45e4 100644 --- a/src/Feature/SCM/dune +++ b/src/Feature/SCM/dune @@ -1,7 +1,7 @@ (library (name Feature_SCM) (public_name Oni2.feature.scm) - (libraries Oni2.editor-core-types Oni2.core Oni2.feature.inputText + (libraries Oni2.editor-core-types Oni2.core Oni2.component.inputText Oni2.feature.theme Oni2.components Oni2.service.exthost Revery isolinear base) (preprocess diff --git a/src/Feature/Search/Feature_Search.re b/src/Feature/Search/Feature_Search.re index 6222a0dbb3..b0b3094d05 100644 --- a/src/Feature/Search/Feature_Search.re +++ b/src/Feature/Search/Feature_Search.re @@ -6,13 +6,13 @@ open Oni_Components; // MODEL type model = { - findInput: Feature_InputText.model, + findInput: Component_InputText.model, query: string, hits: list(Ripgrep.Match.t), }; let initial = { - findInput: Feature_InputText.create(~placeholder="Search"), + findInput: Component_InputText.create(~placeholder="Search"), query: "", hits: [], }; @@ -26,7 +26,7 @@ type msg = | Update([@opaque] list(Ripgrep.Match.t)) | Complete | SearchError(string) - | FindInput(Feature_InputText.msg); + | FindInput(Component_InputText.msg); type outmsg = | Focus; @@ -37,7 +37,7 @@ let update = (model, msg) => { let model = switch (key) { | "" => - let findInputValue = model.findInput |> Feature_InputText.value; + let findInputValue = model.findInput |> Component_InputText.value; if (model.query == findInputValue) { model; // Do nothing if the query hasn't changed } else { @@ -45,20 +45,26 @@ let update = (model, msg) => { }; | _ => - let findInput = Feature_InputText.handleInput(~key, model.findInput); + let findInput = + Component_InputText.handleInput(~key, model.findInput); {...model, findInput}; }; (model, None); | Pasted(text) => - let findInput = Feature_InputText.paste(~text, model.findInput); + let findInput = Component_InputText.paste(~text, model.findInput); ({...model, findInput}, None); - | FindInput(msg) => ( - {...model, findInput: Feature_InputText.update(msg, model.findInput)}, - Some(Focus), - ) + | FindInput(msg) => + let (findInput', inputOutmsg) = + Component_InputText.update(msg, model.findInput); + let outmsg = + switch (inputOutmsg) { + | Component_InputText.Nothing => None + | Component_InputText.Focus => Some(Focus) + }; + ({...model, findInput: findInput'}, outmsg); | Update(items) => ({...model, hits: model.hits @ items}, None) @@ -125,8 +131,6 @@ module Styles = { marginHorizontal(8), ]; - let input = [flexGrow(1)]; - let inputContainer = [width(150), flexShrink(0), flexGrow(1)]; }; @@ -175,8 +179,7 @@ let make = - ; }; + +module Contributions = { + open WhenExpr.ContextKeys.Schema; + + let contextKeys = (~isFocused) => { + let keys = isFocused ? Component_InputText.Contributions.contextKeys : []; + + [keys |> fromList |> map(({findInput, _}: model) => findInput)] + |> unionMany; + }; +}; diff --git a/src/Feature/Search/Feature_Search.rei b/src/Feature/Search/Feature_Search.rei index e69fc62350..25b61fd98d 100644 --- a/src/Feature/Search/Feature_Search.rei +++ b/src/Feature/Search/Feature_Search.rei @@ -13,7 +13,7 @@ type msg = | Update([@opaque] list(Ripgrep.Match.t)) | Complete | SearchError(string) - | FindInput(Feature_InputText.msg); + | FindInput(Component_InputText.msg); type outmsg = | Focus; @@ -35,3 +35,7 @@ let make: unit ) => React.element(React.node); + +module Contributions: { + let contextKeys: (~isFocused: bool) => WhenExpr.ContextKeys.Schema.t(model); +}; diff --git a/src/Feature/Search/dune b/src/Feature/Search/dune index de2ff86b0b..f573ea134c 100644 --- a/src/Feature/Search/dune +++ b/src/Feature/Search/dune @@ -2,6 +2,6 @@ (name Feature_Search) (public_name Oni2.feature.search) (libraries Oni2.editor-core-types Oni2.core Oni2.components - Oni2.service.font Oni2.feature.inputText Oni2.feature.theme Revery) + Oni2.service.font Oni2.component.inputText Oni2.feature.theme Revery) (preprocess (pps ppx_deriving_yojson ppx_deriving.show brisk-reconciler.ppx))) diff --git a/src/Model/Actions.re b/src/Model/Actions.re index a717d8e0e9..78c4b01812 100644 --- a/src/Model/Actions.re +++ b/src/Model/Actions.re @@ -81,7 +81,7 @@ type t = | QuickmenuPaste(string) | QuickmenuShow(quickmenuVariant) | QuickmenuInput(string) - | QuickmenuInputMessage(Feature_InputText.msg) + | QuickmenuInputMessage(Component_InputText.msg) | QuickmenuCommandlineUpdated(string, int) | QuickmenuUpdateRipgrepProgress(progress) | QuickmenuUpdateFilterProgress([@opaque] array(menuItem), progress) diff --git a/src/Model/ContextKeys.re b/src/Model/ContextKeys.re index 9adc919496..c5a8b4fc36 100644 --- a/src/Model/ContextKeys.re +++ b/src/Model/ContextKeys.re @@ -2,6 +2,7 @@ open WhenExpr.ContextKeys.Schema; let menus = fromList( + // TODO: This should be factored to a feature... Quickmenu.[ bool("listFocus", model => model != None), bool("inQuickOpen", model => model != None), @@ -11,11 +12,17 @@ let menus = | Some({variant: EditorsPicker, _}) => true | _ => false, ), + bool( + "textInputFocus", + fun + | Some({variant: EditorsPicker, _}) => false + | _ => true, + ), bool( "quickmenuCursorEnd", fun | Some({inputText, _}) - when Feature_InputText.isCursorAtEnd(inputText) => + when Component_InputText.isCursorAtEnd(inputText) => true | _ => false, ), @@ -98,11 +105,30 @@ let all = (focus: Focus.focusable) => { || focus == Focus.Search, ); + // TODO: These sidebar-specific UI pieces should be encapsulated + // by Feature_SideBar.contextKeys. + let scmContextKeys = + Feature_SCM.Contributions.contextKeys(~isFocused=focus == Focus.SCM); + + let extensionContextKeys = + Feature_Extensions.Contributions.contextKeys( + ~isFocused=focus == Focus.Extensions, + ); + + let searchContextKeys = + Feature_Search.Contributions.contextKeys( + ~isFocused=focus == Focus.Search, + ); + unionMany([ - Feature_Registers.Contributions.contextKeys - |> fromList + Feature_Registers.Contributions.contextKeys( + ~isFocused=focus == Focus.InsertRegister, + ) |> map(({registers, _}: State.t) => registers), sideBarContext |> fromList |> map(({sideBar, _}: State.t) => sideBar), + scmContextKeys |> map(({scm, _}: State.t) => scm), + extensionContextKeys |> map(({extensions, _}: State.t) => extensions), + searchContextKeys |> map(({searchPane, _}: State.t) => searchPane), Feature_LanguageSupport.Contributions.contextKeys |> map(({languageSupport, _}: State.t) => languageSupport), menus |> map((state: State.t) => state.quickmenu), diff --git a/src/Model/Quickmenu.re b/src/Model/Quickmenu.re index 5ba0f3f122..4e3fd59c81 100644 --- a/src/Model/Quickmenu.re +++ b/src/Model/Quickmenu.re @@ -3,7 +3,7 @@ open Actions; type t = { variant, prefix: option(string), - inputText: Feature_InputText.model, + inputText: Component_InputText.model, items: array(menuItem), filterProgress: progress, ripgrepProgress: progress, @@ -40,7 +40,8 @@ let placeholderText = let defaults = variant => { variant, prefix: None, - inputText: Feature_InputText.create(~placeholder=placeholderText(variant)), + inputText: + Component_InputText.create(~placeholder=placeholderText(variant)), focused: None, items: [||], filterProgress: Complete, diff --git a/src/Model/dune b/src/Model/dune index f320c157af..ebbd811429 100644 --- a/src/Model/dune +++ b/src/Model/dune @@ -8,7 +8,7 @@ Oni2.feature.clipboard Oni2.feature.configuration Oni2.feature.contextMenu Oni2.feature.exthost Oni2.feature.extensions Oni2.feature.messages Oni2.feature.theme Oni2.feature.notification Oni2.feature.changelog - Oni2.feature.commands Oni2.feature.input Oni2.feature.inputText + Oni2.feature.commands Oni2.feature.input Oni2.component.inputText Oni2.feature.search Oni2.feature.sideBar Oni2.feature.syntax Oni2.feature.language_support Oni2.feature.editor Oni2.feature.pane Oni2.feature.registers Oni2.feature.scm Oni2.feature.sneak diff --git a/src/Store/KeyBindingsStoreConnector.re b/src/Store/KeyBindingsStoreConnector.re index d4bea01c9e..454a6b4d55 100644 --- a/src/Store/KeyBindingsStoreConnector.re +++ b/src/Store/KeyBindingsStoreConnector.re @@ -91,32 +91,32 @@ let start = maybeKeyBindingsFilePath => { { key: "", command: Commands.List.focusDown.id, - condition: "listFocus || textInputFocus" |> WhenExpr.parse, + condition: "listFocus" |> WhenExpr.parse, }, { key: "", command: Commands.List.focusUp.id, - condition: "listFocus || textInputFocus" |> WhenExpr.parse, + condition: "listFocus" |> WhenExpr.parse, }, { key: "", command: Commands.List.focusDown.id, - condition: "isMac && listFocus || textInputFocus" |> WhenExpr.parse, + condition: "isMac && listFocus" |> WhenExpr.parse, }, { key: "", command: Commands.List.focusUp.id, - condition: "isMac && listFocus || textInputFocus" |> WhenExpr.parse, + condition: "isMac && listFocus" |> WhenExpr.parse, }, { key: "", command: Commands.List.focusDown.id, - condition: "listFocus || textInputFocus" |> WhenExpr.parse, + condition: "listFocus" |> WhenExpr.parse, }, { key: "", command: Commands.List.focusUp.id, - condition: "listFocus || textInputFocus" |> WhenExpr.parse, + condition: "listFocus" |> WhenExpr.parse, }, { key: "", @@ -142,7 +142,7 @@ let start = maybeKeyBindingsFilePath => { { key: "", command: Commands.List.select.id, - condition: "listFocus || textInputFocus" |> WhenExpr.parse, + condition: "listFocus" |> WhenExpr.parse, }, // Search commands { diff --git a/src/Store/QuickmenuStoreConnector.re b/src/Store/QuickmenuStoreConnector.re index e596c8b061..1ce7eb6713 100644 --- a/src/Store/QuickmenuStoreConnector.re +++ b/src/Store/QuickmenuStoreConnector.re @@ -143,7 +143,7 @@ let start = () => { }; let typeToSearchInput = - Feature_InputText.create(~placeholder="type to search..."); + Component_InputText.create(~placeholder="type to search..."); let menuUpdater = ( @@ -264,7 +264,7 @@ let start = () => { | QuickmenuPaste(text) => ( Option.map( (Quickmenu.{inputText, _} as state) => { - let inputText = Feature_InputText.paste(~text, inputText); + let inputText = Component_InputText.paste(~text, inputText); Quickmenu.{...state, inputText, focused: Some(0)}; }, @@ -275,7 +275,7 @@ let start = () => { | QuickmenuInput(key) => ( Option.map( (Quickmenu.{inputText, _} as state) => { - let inputText = Feature_InputText.handleInput(~key, inputText); + let inputText = Component_InputText.handleInput(~key, inputText); Quickmenu.{...state, inputText, focused: Some(0)}; }, @@ -289,10 +289,13 @@ let start = () => { (Quickmenu.{variant, inputText, _} as state) => { switch (variant) { | Wildmenu(_) => - let oldPosition = inputText |> Feature_InputText.cursorPosition; + let oldPosition = + inputText |> Component_InputText.cursorPosition; - let inputText = Feature_InputText.update(msg, inputText); - let newPosition = inputText |> Feature_InputText.cursorPosition; + let (inputText, _) = + Component_InputText.update(msg, inputText); + let newPosition = + inputText |> Component_InputText.cursorPosition; let transition = newPosition - oldPosition; if (transition > 0) { @@ -324,7 +327,7 @@ let start = () => { Quickmenu.{ ...state, inputText: - Feature_InputText.set(~text, ~cursor, state.inputText), + Component_InputText.set(~text, ~cursor, state.inputText), }, state, ), @@ -565,7 +568,7 @@ let subscriptions = (ripgrep, dispatch) => { let updater = (state: State.t) => { switch (state.quickmenu) { | Some(quickmenu) => - let query = quickmenu.inputText |> Feature_InputText.value; + let query = quickmenu.inputText |> Component_InputText.value; switch (quickmenu.variant) { | CommandPalette | EditorsPicker diff --git a/src/UI/QuickmenuView.re b/src/UI/QuickmenuView.re index 44dedd188d..8214ed2913 100644 --- a/src/UI/QuickmenuView.re +++ b/src/UI/QuickmenuView.re @@ -162,7 +162,7 @@ let make = let input = () => - " -authors: ["Daniel Bünzli "] -homepage: "http://erratique.ch/software/fpath" -doc: "http://erratique.ch/software/fpath/doc" -dev-repo: "git+http://erratique.ch/repos/fpath.git" -bug-reports: "https://github.com/dbuenzli/fpath/issues" -tags: [ "file" "system" "path" "org:erratique" ] -license: "ISC" -depends: [ - "ocaml" {>= "4.01.0" & < "4.12"} - "ocamlfind" {build} - "ocamlbuild" {build} - "topkg" {build & >= "0.9.0"} - "result" - "astring" -] -build: [[ - "ocaml" "pkg/pkg.ml" "build" - "--dev-pkg" "%{pinned}%" ]] -synopsis: "File system paths for OCaml" -description: """ -Fpath is an OCaml module for handling file system paths with POSIX or -Windows conventions. Fpath processes paths without accessing the file -system and is independent from any system library. - -Fpath depends on [Astring][astring] and is distributed under the ISC -license. - -[astring]: http://erratique.ch/software/astring""" -url { - src: "http://erratique.ch/software/fpath/releases/fpath-0.7.2.tbz" - checksum: "md5=52c7ecb0bf180088336f3c645875fa41" -} diff --git a/test.esy.lock/opam/fpath.0.7.3/opam b/test.esy.lock/opam/fpath.0.7.3/opam new file mode 100644 index 0000000000..ae3336e426 --- /dev/null +++ b/test.esy.lock/opam/fpath.0.7.3/opam @@ -0,0 +1,36 @@ +opam-version: "2.0" +maintainer: "Daniel Bünzli " +authors: ["The fpath programmers"] +homepage: "https://erratique.ch/software/fpath" +doc: "https://erratique.ch/software/fpath/doc" +dev-repo: "git+https://erratique.ch/repos/fpath.git" +bug-reports: "https://github.com/dbuenzli/fpath/issues" +tags: [ "file" "system" "path" "org:erratique" ] +license: "ISC" +depends: [ + "ocaml" {>= "4.03.0"} + "ocamlfind" {build} + "ocamlbuild" {build} + "topkg" {build & >= "0.9.0"} + "astring" +] +build: [[ + "ocaml" "pkg/pkg.ml" "build" + "--dev-pkg=true" {dev} ]] + +synopsis: """File system paths for OCaml""" +description: """\ + +Fpath is an OCaml module for handling file system paths with POSIX or +Windows conventions. Fpath processes paths without accessing the file +system and is independent from any system library. + +Fpath depends on [Astring][astring] and is distributed under the ISC +license. + +[astring]: http://erratique.ch/software/astring +""" +url { +archive: "https://erratique.ch/software/fpath/releases/fpath-0.7.3.tbz" +checksum: "0740b530e8fed5b0adc5eee8463cfc2f" +}