File: yi-PR-1127

package info (click to toggle)
haskell-yi-core 0.19.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 840 kB
  • sloc: haskell: 10,019; makefile: 5
file content (102 lines) | stat: -rw-r--r-- 3,892 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Description: upstream PR to fix build with GHC 9.0
Author: Marcel Fourné <debian@marcelfourne.de>
Origin: other, https://github.com/yi-editor/yi/pull/1127
Bug: https://github.com/yi-editor/yi/issues/1125
Forwarded: https://github.com/yi-editor/yi/pull/1127
Last-Update: 2022-08-25

--- haskell-yi-core-0.19.2.orig/src/Yi/Buffer/Misc.hs
+++ haskell-yi-core-0.19.2/src/Yi/Buffer/Misc.hs
@@ -1127,7 +1127,7 @@ savingExcursionB f = do
     moveTo =<< use (markPointA m)
     return res
 
-markPointA :: Mark -> Lens' FBuffer Point
+markPointA :: forall f . Functor f => Mark -> (Point -> f Point) -> (FBuffer -> f FBuffer)
 markPointA mark = lens getter setter where
   getter b = markPoint $ getMarkValueRaw mark b
   setter b pos = modifyMarkRaw mark (\v -> v {markPoint = pos}) b
--- haskell-yi-core-0.19.2.orig/src/Yi/Eval.hs
+++ haskell-yi-core-0.19.2/src/Yi/Eval.hs
@@ -121,28 +121,6 @@ infixl 1 <&>
 a <&> f = f <$> a
 -- TODO: should we be sticking Text here?
 
--- | Runs the action, as written by the user.
---
--- The behaviour of this function can be customised by modifying the
--- 'Evaluator' variable.
-execEditorAction :: String -> YiM ()
-execEditorAction = runHook execEditorActionImpl
-
--- | Lists the action names in scope, for use by 'execEditorAction',
--- and 'help' index.
---
--- The behaviour of this function can be customised by modifying the
--- 'Evaluator' variable.
-getAllNamesInScope :: YiM [String]
-getAllNamesInScope = runHook getAllNamesInScopeImpl
-
--- | Describes the named action in scope, for use by 'help'.
---
--- The behaviour of this function can be customised by modifying the
--- 'Evaluator' variable.
-describeNamedAction :: String -> YiM String
-describeNamedAction = runHook describeNamedActionImpl
-
 -- | Config variable for customising the behaviour of
 -- 'execEditorAction' and 'getAllNamesInScope'.
 --
@@ -157,11 +135,6 @@ data Evaluator = Evaluator
     -- ^ describe named action (or at least its type.), simplest implementation is at least @return@.
   } deriving (Typeable)
 
--- | The evaluator to use for 'execEditorAction' and
--- 'getAllNamesInScope'.
-evaluator :: Field Evaluator
-evaluator = customVariable
-
 -- * Evaluator based on GHCi
 -- | Cached variable for getAllNamesInScopeImpl
 newtype NamesCache = NamesCache [String] deriving (Typeable, Binary)
@@ -413,3 +386,29 @@ instance Default Evaluator where
 #endif
 
 instance YiConfigVariable Evaluator
+-- | Runs the action, as written by the user.
+--
+-- The behaviour of this function can be customised by modifying the
+-- 'Evaluator' variable.
+execEditorAction :: String -> YiM ()
+execEditorAction = runHook execEditorActionImpl
+
+-- | Lists the action names in scope, for use by 'execEditorAction',
+-- and 'help' index.
+--
+-- The behaviour of this function can be customised by modifying the
+-- 'Evaluator' variable.
+getAllNamesInScope :: YiM [String]
+getAllNamesInScope = runHook getAllNamesInScopeImpl
+
+-- | Describes the named action in scope, for use by 'help'.
+--
+-- The behaviour of this function can be customised by modifying the
+-- 'Evaluator' variable.
+describeNamedAction :: String -> YiM String
+describeNamedAction = runHook describeNamedActionImpl
+
+-- | The evaluator to use for 'execEditorAction' and
+-- 'getAllNamesInScope'.
+evaluator :: Field Evaluator
+evaluator = customVariable
--- haskell-yi-core-0.19.2.orig/src/Yi/Syntax/Layout.hs
+++ haskell-yi-core-0.19.2/src/Yi/Syntax/Layout.hs
@@ -70,7 +70,7 @@ layoutHandler isSpecial parens isIgnored
 
           parse :: IState t -> [(AlexState lexState, Tok t)] -> [(State t lexState, Tok t)]
           parse iSt@(IState levels doOpen lastLine)
-                toks@((aSt, tok @ Tok {tokPosn = Posn _nextOfs line col}) : tokss)
+                toks@((aSt, tok@Tok {tokPosn = Posn _nextOfs line col}) : tokss)
 
             -- ignore this token
             | isIgnored tok