# Pce editor with word wrap, and line numbers

**URL:** <https://swi-prolog.discourse.group/t/pce-editor-with-word-wrap-and-line-numbers/6202>\
**Category:** Help!\
**Tags:** discussion, how-to\
**Created:** [February 9, 2023, 1:03pm UTC](https://swi-prolog.discourse.group/t/pce-editor-with-word-wrap-and-line-numbers/6202 "2023-02-09T13:03:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![paule32](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/paule32/32/5112_2.png) [@paule32](https://swi-prolog.discourse.group/u/paule32)\
**Post date:** [February 9, 2023, 1:03pm UTC](https://swi-prolog.discourse.group/t/pce-editor-with-word-wrap-and-line-numbers/6202/1 "2023-02-09T13:03:16Z")

</div>

I’m using: SWI-Prolog version 9.0.4 for x64-win64

I want the code to: have a input editor for text manipulation (load, save, save as, modified)

But what I’m getting is: editor without word wrap, and no line numbers

My code looks like this:

```prolog
initialise(MyApp) :->
	programTitle(AppTitle),
	send_super(MyApp,initialise,AppTitle),
	send(MyApp,append,new(D,dialog)),
	
	send(D,append,new(menu_bar)),
	send(D,append,new(tool_bar(MyApp))),
	
	send(MyApp,fill_menu_bar),
	send(MyApp,fill_tool_bar),
	
	send(D,append,new(TE,editor)),
	send(new(report_dialog),below,D),

```

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [February 9, 2023, 1:52pm UTC](https://swi-prolog.discourse.group/t/pce-editor-with-word-wrap-and-line-numbers/6202/2 "2023-02-09T13:52:35Z")

</div>

The xpce editors do not have line number display. Possibly you can add that in Prolog, but I’m afraid that is quite a challenge. They do understand `->wrap: word`. The xpce graphics subsystem is a bit out of fashion though. It is still mostly used to deal with the IDE components.

---

<div class="post-metadata">

**Author:** ![paule32](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/paule32/32/5112_2.png) [@paule32](https://swi-prolog.discourse.group/u/paule32)\
**Post date:** [February 9, 2023, 2:53pm UTC](https://swi-prolog.discourse.group/t/pce-editor-with-word-wrap-and-line-numbers/6202/3 "2023-02-09T14:53:55Z")

</div>

Hello,

You are sure?  
Here a screen shoot:

[![Imgur](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/5/567d9d04bb97b33b41197d0ed9eeba3328a9637a.png "Imgur: The magic of the Internet") ](https://imgur.com/bqanOFG)

The Code can be download from here:  
[https://dpaste.com/CBCXFAHZU](https://dpaste.com/CBCXFAHZU)

would be nice for a example with line numbers.

Jens

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [February 9, 2023, 3:52pm UTC](https://swi-prolog.discourse.group/t/pce-editor-with-word-wrap-and-line-numbers/6202/4 "2023-02-09T15:52:35Z")

</div>

> [@paule32](#):
>
> You are sure?

The background window is from PrologEditor, which is a Windows application that embeds Prolog. The front window is from Prolog itself. They use completely unrelated technology.

You get what looks like a fairly decent editor, surely for Prolog code, using PceEmacs, which you can start using `?- edit(Something).` or `?- emacs(SomeFile).` It doesn’t do line numbers though. Well, it tells you in the status line at what line the cursor is.
