forked from Shinonome/dots-hyprland
overview: math: make ^ power (#217)
This commit is contained in:
@@ -106,7 +106,7 @@ export const SearchAndWindows = () => {
|
|||||||
|
|
||||||
if (couldBeMath(text)) { // Eval on typing is dangerous, this is a workaround
|
if (couldBeMath(text)) { // Eval on typing is dangerous, this is a workaround
|
||||||
try {
|
try {
|
||||||
const fullResult = eval(text);
|
const fullResult = eval(text.replace(/\^/g, "**"));
|
||||||
// copy
|
// copy
|
||||||
execAsync(['wl-copy', `${fullResult}`]).catch(print);
|
execAsync(['wl-copy', `${fullResult}`]).catch(print);
|
||||||
App.closeWindow('overview');
|
App.closeWindow('overview');
|
||||||
@@ -168,7 +168,7 @@ export const SearchAndWindows = () => {
|
|||||||
// Calculate
|
// Calculate
|
||||||
if (couldBeMath(text)) { // Eval on typing is dangerous; this is a small workaround.
|
if (couldBeMath(text)) { // Eval on typing is dangerous; this is a small workaround.
|
||||||
try {
|
try {
|
||||||
const fullResult = eval(text);
|
const fullResult = eval(text.replace(/\^/g, "**"));
|
||||||
resultsBox.add(CalculationResultButton({ result: fullResult, text: text }));
|
resultsBox.add(CalculationResultButton({ result: fullResult, text: text }));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// console.log(e);
|
// console.log(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user