File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ load = withAgda $ withCurrentBuffer $ \b -> do
8181 agda <- getAgda b
8282 ready <- liftIO $ readIORef $ a_ready agda
8383 if ready then do
84- vim_command " noautocmd w"
84+ vim_command " silent! noautocmd w"
8585 name <- buffer_get_name $ a_buffer agda
8686 flip runIOTCM agda $ Cmd_load name []
8787 buffer_get_number b >>= resetDiff
Original file line number Diff line number Diff line change 1+ module Readonly where
2+
3+ open import Agda.Builtin.String
4+
5+ description : String
6+ description = "This is a read-only file. Loading it should work fine."
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import Control.Monad (void)
88import Cornelis.Subscripts (decNextDigitSeq , incNextDigitSeq )
99import Cornelis.Types
1010import Cornelis.Types.Agda (Rewrite (.. ))
11- import Cornelis.Utils (withBufferStuff )
11+ import Cornelis.Utils (withBufferStuff , withLocalEnv )
1212import Cornelis.Vim
1313import qualified Data.Text as T
1414import qualified Data.Vector as V
@@ -18,6 +18,7 @@ import Neovim.Test
1818import Plugin
1919import Test.Hspec
2020import Utils
21+ import Lib (cornelisInit )
2122
2223
2324broken :: String -> SpecWith a -> SpecWith a
@@ -26,6 +27,15 @@ broken = before_ . pendingWith
2627spec :: Spec
2728spec = focus $ do
2829 let timeout = Seconds 60
30+
31+ it " should load read-only file" $ do
32+ withVim timeout $ \ w b -> do
33+ env <- cornelisInit
34+ withLocalEnv env $ do
35+ vim_command " view test/Readonly.agda"
36+ liftIO $ threadDelay 1e6
37+ load
38+
2939 diffSpec " should refine" timeout " test/Hello.agda"
3040 [ Swap " unit = ?" " unit = one" ] $ \ w _ -> do
3141 goto w 11 8
You can’t perform that action at this time.
0 commit comments